How to port Arduino firmware into STM32 Cube IDE

Post here first, or if you can't find a relevant section!
Post Reply
demy
Posts: 3
Joined: Wed Mar 06, 2024 8:27 am

How to port Arduino firmware into STM32 Cube IDE

Post by demy »

Hi Everyone,
I am total newbie on the forum.
I have been given a task that is as below.

I must port the that can be founder under following location => .....SparkFun_u_blox_GNSS_Arduino_Library-2.2.25\examples\Example13_PVT

Files can be found out https://www.arduino.cc/reference/en/lib ... o-library/ in this location.

I have no clue how to start, how to progress on this task.

Can anyone please help me with this ?

Regards,
dannyf
Posts: 446
Joined: Sat Jul 04, 2020 7:46 pm

Re: How to port Arduino firmware into STM32 Cube IDE

Post by dannyf »

usually very simple:

1. understand what the code is trying to do;
2. understand how it does on the original chip;
3. implement it on the target chip;
4. enjoy the fruit of your labor :)
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: How to port Arduino firmware into STM32 Cube IDE

Post by ag123 »

For beginners, it is much easier to simply follow the getting started guide
https://github.com/stm32duino/Arduino_C ... ng-Started
and to use a supported board on the STM core page.
https://github.com/stm32duino/Arduino_Core_STM32
it is also suggested to get a chip that has more sram and flash, e.g. Nucleo stm32f401 or stm32f411 boards to start with.
That is so that you won't get caught with 'out of flash' or worse 'out of memory' condition too quickly.
For a good board Adafruit has a STM32F405 Feather Express
https://www.adafruit.com/product/4382
(this board is directly supported in STM core) check Adafruit's tutorial from the product link and the stm32duino wiki
https://github.com/stm32duino/Arduino_Core_STM32/wiki)
with lots of guides from Adafruit and runs Circuitpython from Adafruit as well.
And if one wants to wander out there to the online 'flea markets' there are things like:
https://www.aliexpress.com/w/wholesale-stm32f401.html
various offers from micropython as well
https://store.micropython.org/
and various offers from Olimex
https://www.olimex.com/Products/ARM/ST/
https://www.olimex.com/Products/Duino/S ... e-hardware
probably many more if one bothers to 'google' for them.

There is actually no need to use STM32 Cube IDE with the core, though that is still possible.
Arduino IDE 2.x is actually pretty usable these days.
And if you really want to do so, it is documented here how to use CMake based build with Cube IDE
https://github.com/stm32duino/Arduino_C ... ki/cubeIDE
considered 'Advanced' use case but that it is actually 'better' than Arduino IDE style builds.
e.g. CMake builds are not limited by the Arduino build framework and you can build it anyway you want by redefining things in cmakefiles.

for beginners start with the 'standard' tools e.g. Arduino IDE, and one can get 'simple' things out and running in no time. e.g. to blink a led,
that is the 1st sketch to get working to make sure that things are after all working and that you have a tool chain properly setup.
Post Reply

Return to “General discussion”