Perhaps it is just me, but I am a bit puzzled with the STM32 support, and I explain why.
When a board is selected (in my case nucleo_f446re) I am supposed to have all the machinery to build my project (Drivers
, etc.) in .platformio
and a platformio.ini
file which contains at least the essential automatically.
Then, my manual work would be to copy/paste the generated files from MX in Core/Src
and Core/Inc
into the platformio structure Src
and Inc
, plus copying the .ld
files and eventually the Middleware
folder and edit a bit my platformio.ini
files that today looks like this:
[env:nucleo_f446re]
platform = ststm32
board = nucleo_f446re
framework = stm32cube
board_build.stm32cube.custom_config_header = yes
lib_extra_dirs = Middlewares/Third_Party/FreeRTOS
build_flags =
-mfpu=fpv4-sp-d16
-mfloat-abi=softfp
-IInc
-IMiddlewares/Third_Party/FreeRTOS/Source/include
-IMiddlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2
-IMiddlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F
; select linker file generated by CubeMX
lib_archive = no
check_tool = cppcheck
Although I understand pretty much all of the above content, shouldn’t the flags -mfpu=fpv4-sp-d16
and -mfloat-abi=softfp
be automatically set by platformio?
Because if I don’t, I would have:
Error: selected processor does not support `vstmdbeq r0!,{s16-s31}' in Thumb mode
which is related to the used board and it is known, it is not related to the user preferences (like include paths and so on that I understand must be manually included).
The same applies to the option lib_archive = no
…
I feel very uncomfortable that these items have not being automatically added, given that it is clear what board I am using. Sure, I can learn these flags today and live happy. And I can learn even something more tomorrow. But then, where the abstraction provided by platformio will go along this line?
I adjusted my platformio.ini by copying from here here - but I have no idea what is that, if it I will have to change in the future, if I will have to add/remove something else and so on. That makes me to feel very nervous because I am using platformio exactly for the reason of avoiding dealing with such low level details.
Finally, I tried to use stm32pio but I had to manually do lot of work in removing files (Core/Src and Core/Inc, Drivers, etc.) anyway.
Plus, I had to edit the platformio.ini anyway, so why don’t do everything manually at this point? Provided that I am not missing something important of course…
What do you think?