Dual cores

How to install STM32 core into the Arduino IDE, and any OS specific issues
Post Reply
Bingo600
Posts: 86
Joined: Sat Dec 21, 2019 3:56 pm

Dual cores

Post by Bingo600 »

I currently have Rodgers core (latest git 2 days old) , installled.

If i want to plat around w. the Official STM core too , would installing that (via arduino ide) , interfere w. Rodgers core ??

I mean now i'd have 2 libraries for ie. a bluepill , is that as easy as a select from the pulldown menu.
Or would i get duplicate defines etc ???

I'm on linux , so i coud prob do some symlink tricks , but would like to hear what other are doing.

TIA
/Bingo
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Dual cores

Post by ag123 »

what i did is in eclipse (not arduino ide), i placed the codes of the core with the sketch that i use.
and the reason is that what is the same is probably the 'high level' arduino api.
any deeper down, official core is based on HAL and libmaple core is based on libmaple :evil:
i've not really explored writing codes that would build in both cores, i'd guess it'd take some ifdef kind of stuff, won't be too easy.
the 2 cores are dissimilar as the origins in the first place isn't the same (libmaple is based on leaflabs and further improved by the community)
ST's cores is built around HAL developed further by fpiSTM and team with some contributions from the community
there is also some difference in the approach, for libmaple it tends to be 'fitted' to the particular mcu, so it is unlikely portable with even a slightly different mcu. e.g. things that works on stm32f103 may not necessarily work in stm32f4xx and vice versa
libmaple works well on stm32f103 (for libmaple itself that is) as in part that is the origin from leaflabs maple mini
and further improved by the community based on maple mini, blue pills et.al.
stm32f407* is added later as lower costs variety of those boards start surfacing on aliexpress, ebay etc
libmaple is pretty much a 'community core'
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Dual cores

Post by mrburnette »

Just stick Roger's code in .../Arduino/hardware/STM32

Install the official core via the JSON link. Both can coexist. If you have difficulty, you can always rename the "hardware" folder to simplify the selection menu.

Ray
Bingo600
Posts: 86
Joined: Sat Dec 21, 2019 3:56 pm

Re: Dual cores

Post by Bingo600 »

Thanx guyzz ...

I wish Arduino used makefiles instead of that "SH.." they use , it's a "lottery" system that even M$ couldn't have done worse

Normally i'd only use Arduino IDE for compiling (due to the library finding stuff) , and i once had some working makefiles , but they didn't get updated as the IDE updated .


/Bingo
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Dual cores

Post by ag123 »

i've not explored the stm core in sufficient depth.
but if i configure the dependencies in eclipse CDT, i've been able to get the official core to build with the sketch.
the makefiles are 'auto' generated by eclipse CDT. i think the various eclipse based addons (e.g. sloeber, and system workbench improves further on that)

as for libmaple, i've actually moved towards makefiles but pretty much used it only personally
https://gist.github.com/ag88/a6a02acbc7 ... 7c0f310268
the motivations of using a makefile is that configuring the dependencies in eclipse (defines, includes and source directories) can be quite tedious.
but i think it is possible to export that configuration and import it in another project with the more recent release.
but with a makefile when i wanted to start a new sketch (project), i simply copy an existing makefile and start making changes. hence, it is considerably less tedious.

in terms of the libraries, my personal habit is to copy them as sub folders into the source folder in eclipse.
so long as the dependencies are correctly referenced, compilation would find them and build the sketch / libraries / core into the elf and bin
i took quite a while to create the libmaple makefile that actually works (for myself), but this basically associate all the various (libmaple) dependencies together with the sketch.

i'd think it should be possible to make a makefile for the official core too, just that it'd take one some effort to work it

a good thing about environments like eclipse is that if you bother to configure the dependencies in the ide (defines, includes, source ), jumping from point to point in the call stack or referenced variables is much easier. in that way it is much easier for one to drill down say in the call stack all the way into the methods or functions and figure things out especially when one encounter issues or is trying to understand something about it

and if one has the st-link v2 (or a jtag dongle) one can literally debug, step codes and examine variables / registers.
this requires some additional stacks e.g. gdb etc. instead of eclipse, i often use an external tool DDD
https://www.gnu.org/software/ddd/
as i find it more lightweight

but well made add ons in eclipse e.g sloeber or system workbench, probably integrates it all and debug goes into the eclipse IDE. pretty much like the professional IDE tools

and the usual thing i'd do is when things are pretty much straightened up, i copy the same things into a sketch folder and build in arduino IDE to see that things works just the same
Post Reply

Return to “Installation and OS related”