let me introduice myself

ag123
Posts: 1657
Joined: Thu Dec 19, 2019 5:30 am
Answers: 25

Re: let me introduice myself

Post by ag123 »

mrburnette wrote: Mon Jan 13, 2020 8:52 pm
I know it is frustrating working new code.
But it takes a long, long time to sanitize a codebase. One of the reasons I tell every serious programmer of the STM32 to drop Roger's code inherited from Leaflabs and move to the STM Official port is that every user counts. Your work effort will be rewarded with better code. There is a business behind STM Official Arduino codebase, Corporate STM needs to see activity to warrant the costs. Nothing is free.
my thoughts are that the more experienced stm32duino'ers can do both tracks, official core + libmaple
i found writing codes for the official core may lead to rather neat codes, thanks to the efforts of fpiSTM et.al.
reading mcu temperature literally does so using a minor 'twist' to the same arduino api.
it looked superficially simple, but in the implementation is some quite elaborate codes to read from adc and various ifdefs to make it 'cross platform'

Code: Select all

pinMode(ATEMP, INPUT_ANALOG);
pinMode(AVREF, INPUT_ANALOG);
uint16_t vrefint = analogRead(AVREF);
uint16_t vtemp = analogRead(ATEMP);
viewtopic.php?f=14&t=9&start=40#p509

the goals of HAL are to go 'cross platform', i.e. across nearly all STM32 mcus, this may inevitably introduce some overheads with IO etc.
it may also have a 'lowest common denominator' effect, e.g. that rather than using a specific mode or feature of a particular mcu, it may target a common feature set instead. I took a look at the HAL ADC codes, apparently HAL really did an effort to implement the 'esoteric' modes as well, hence you're not limited to a common denominator, but it added complexity to the api as well
viewtopic.php?f=62&t=82&start=10#p504
While for libmaple, it is true bare metal programming, the codes mostly if written for one mcu e.g. stm32f103 may not be portable even to say stm32f4. not all cases are non portable though, but those that directly patch and reference mcu registers may be impacted as they are after all different but still when built from source, it likely still work if after all the symbols are the same

writing codes for HAL should aim to use HAL, though one can still reference the registers, but inevitably once the mcu change, there will be ifdefs to accommodate the differences. while i've not really tested it much, perhaps a sketch written for HAL on one mcu may just work across different mcus.
but there still are challenges, HAL may require one to anchor things like NVIC vector tables to point into the HAL stacks. those are apparently left 'open' (i.e. unimplemented), i'd guess as the HAL designers aim for portability. the catch is that in the sketch, it would be necessary to patch hardware level NVIC vector tables to call into the appropriate HAL hooks, the HAL itself literally. this can be different across mcus and it would involve touching the 'core' codes and they are likely different between mcus. i'm not too sure if CubeMX generates codes that in effect patch into HAL. but if it doesn't do that, one would need to patch the h/w hooks manually.
viewtopic.php?f=62&t=82&start=10#p505
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: let me introduice myself

Post by mrburnette »

my thoughts are that the more experienced stm32duino'ers can do both tracks, official core + libmaple
IMO: experienced programmers likely have their own "flavor" of Libmaple, etc... Steve's, Dan's, etc. Folks that cannot understand Libmaple or support themselves need to leave the code alone (Roger's or others) ... it will only frustrate and is unsuitable for commercial use (beyond blinking leds... definitely avoid situations where a s/w failure would involve property, life, etc.)

If you must use the ArduinoUDE, use the STM Official Arduino Core. Otherwise, I could care less if you use Notepad and I doubt if any other member cares either. An IDE does not write good software; the IDE simply is a tool to help the programmer be efficient.

Opinion
For most hobbyists, if you already know Arduino and need to continue the IDE, then Roger's core will give you fair service for hobby use.
If you are an advanced programmer, you will be better served by the STM tools.
ag123
Posts: 1657
Joined: Thu Dec 19, 2019 5:30 am
Answers: 25

Re: let me introduice myself

Post by ag123 »

well notepad is after all quite an 'ide' and that is if one use a makefile or better arduino-cli,
the 'notepad' concept is now exploited to do the same on the web, e.g. those javascript based 'ide' :lol:
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: let me introduice myself

Post by mrburnette »

ag123 wrote: Tue Jan 14, 2020 8:29 am well notepad is after all quite an 'ide' and that is if one use a makefile or better arduino-cli,
the 'notepad' concept is now exploited to do the same on the web, e.g. those javascript based 'ide' :lol:
Modern Javascript is a on-steroid language. By "blob-ing" from the server, the client-side browser becomes a full application. Node.js provides server-side capabilities... thus, one language can be utilized for both client and server applications.

For readers not familiar with JS, an extract from Wikipedia:
As a multi-paradigm language, JavaScript supports event-driven, functional, and imperative (including object-oriented and prototype-based) programming styles. It has APIs for working with text, arrays, dates, regular expressions, and the DOM, but the language itself does not include any I/O, such as networking, storage, or graphics facilities. It relies upon the host environment in which it is embedded to provide these features.
Post Reply

Return to “Let us know a bit about you and your projects”