.pioenvs/nucleo_l152re/src/freertos.o: In function `StartDefaultTask':
freertos.c:(.text.StartDefaultTask+0x4): undefined reference to `osDelay'
.pioenvs/nucleo_l152re/src/freertos.o: In function `MX_FREERTOS_Init':
freertos.c:(.text.MX_FREERTOS_Init+0x14): undefined reference to `osThreadCreate'
.pioenvs/nucleo_l152re/src/main.o: In function `main':
main.c:(.text.startup.main+0xe): undefined reference to `osKernelStart'
.pioenvs/nucleo_l152re/src/stm32l1xx_it.o: In function `SysTick_Handler':
stm32l1xx_it.c:(.text.SysTick_Handler+0xa): undefined reference to `osSystickHandler'
collect2: error: ld returned 1 exit status
*** [.pioenvs/nucleo_l152re/firmware.elf] Error 1
Also, the main.c file is the standard file generated by cubemx.
It doesn’t compile the FreeRTOS sources because it thinks they aren’t used. You can move the FreeRTOS foder into src/ to make it work. Or even just say lib_deps = FreeRTOS in the platformio.ini will make it compile.
Ah actually for that to work you need to have the FreeRTOS files in lib/. Unfortunately there already is a registered library named ‘FreeRTOS’ so I named by folder ‘FreeRTOS_cubemx’ and referenced that; otherwise it would try and download a library. See the new branch at GitHub - maxgerhardt/pio-cubemx-freertos at using-lib-folder
Your link to the github repo worked perfectly. I’m assuming, however, that I will not be able to do a true roundtrip from cubemx modifications, code generation and rebuild without moving files around that it generates?
For FreeRTOS, lib/FreeRTOS code itself shouldn’t change but only the FreeRTOSConfig.h. Copying files is rather quick; Set CubeMX to generate for SW4STM32, copy everything in Src to src, Inc to include. That should do it in most cases unless some new drivers under Drivers/ are added.
Least-work case is of course having the perfect CubeMX project configuration in the first place and only having to copy once