Page 1 of 1

Question about Arduino for STM32

Posted: Mon Apr 20, 2020 2:51 pm
by noweare
Does using the arduino core also give me access to arduino libraries written for other devices like tft displays, etc...?
I am currently using MxCubeIDE and I am comfortable with it but I am wondering if by using the arduino core I
also get the benefit of not having to write code from scratch (drivers/libraries) to use other devices & modules.
Thanks

Re: Question about Arduino for STM32

Posted: Mon Apr 20, 2020 2:58 pm
by mrburnette
YES, and no.

If the Arduino library is properly written (many Adafruit, Sparkfun libs) then technology unique to uC will be encapsulated in defines. Many libraries were originally modified and tested for STM32F1xx: (Roger's core)
https://github.com/rogerclarkmelbourne/ ... /libraries

Using the STM Official core, most modern libs will work or changes will be minimum.
... the benefit of not having to write code from scratch (drivers/libraries) to use other devices & modules.
That is, of course, the draw to Arduino for many professional programmers... quick prototyping using open-source. After vetting a mockup with a client, one can drop deeper and optimize.


Ray

Re: Question about Arduino for STM32

Posted: Mon Apr 20, 2020 3:04 pm
by noweare
Thanks Ray, that is good news. I am assuming I will still have access to the HAL and the low level libraries using the stm32 core correct ?

Re: Question about Arduino for STM32

Posted: Mon Apr 20, 2020 3:41 pm
by mrburnette
noweare wrote: Mon Apr 20, 2020 3:04 pm Thanks Ray, that is good news. I am assuming I will still have access to the HAL and the low level libraries using the stm32 core correct ?
Only IF you use core:
https://github.com/stm32duino/Arduino_Core_STM32
Which is known around the forum as the "Official core" ...

The history of Arduino support for STM32F103 is sorted: started with
- LeafLabs Maple development
- continued here: https://forum.arduino.cc/index.php?topi ... msg1981364
- and STM Corporate developed their core and took over this forum.

* Bob Cousins migrated the LeafLabs core into a directory structure that would compile on the publicly available ArduinoIDE 1.5.x and concocted the required properties files for the IDE.

Re: Question about Arduino for STM32

Posted: Mon Apr 20, 2020 4:40 pm
by noweare
Interesting history. I am glad ST decided to write their own core as I am familiar with there SDK. I have not used Rogers or any other core so I would use the "official" core. Thanks for your insight into this kind of confusing topic.