Hi All,
I generated some code with STM32Cube IDE and structured it to be compiled with PlatformIO STM32 platform.
I’m also using LwIP and FreeRTOS that were copied from STM32CubeIDE as libraries in PlatformIO.
I’m having some issues because some of threads are not being created when compiling with PlatformIO and I notice that is because the heap gets out of memory (Heap4.c).
I also notice that the function sizeof()
returns different values when compiled with STM32Cube IDE and PlatformIO for same datatype. More specifically this code:
sizeof( TCB_t ) # tasks.c file
that returns 180 bytes when running compiled with STM32Cube IDE and 1152 bytes when compiled with PlatformIO.
TCB_t is a data structure from FreeRTOS files, which I’m using the same in STM32CubeIDE and PlatformIO.
This is my configuration:
[env]
platform = ststm32
board = genericSTM32F407VET6
framework = stm32cube
board_build.stm32cube.custom_config_header = yes
board_build.stm32cube.custom_system_setup = yes
board_build.stm32cube.startup_file = startup_stm32f407vgtx.s
board_build.ldscript = $PROJECT_DIR/STM32F407VETX_FLASH.ld
platform_packages =
framework-stm32cubef4 @ https://github.com/lealoureiro/STM32CubeF4.git#v1.27.1-pio
upload_protocol = stlink
[env:genericSTM32F407VET6_release]
build_type = release
build_flags = -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -DHSE_VALUE=16000000L -fstack-usage -O0 -fdata-sections -MMD -MP -g3
[env:genericSTM32F407VET6_debug]
build_type = debug
debug_tool = stlink
debug_build_flags = -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -DHSE_VALUE=16000000L -fstack-usage -O0 -fdata-sections -MMD -MP -g3 -Og
debug_init_cmds =
target extended-remote $DEBUG_PORT
$INIT_BREAK
monitor reset halt
$LOAD_CMDS
monitor init
monitor reset halt
Any idea why this might be happening? Different version off gcc/toolchain used? Some config missing while compiling?
Thanks in advance!