cancel
Showing results for 
Search instead for 
Did you mean: 

STm32CubeMx Generated Code w/ RTOS for EWARM toolchain

fsavaria
Associate II
Posted on January 28, 2016 at 22:18

I used Stm32CubeMx with STM32Cube_FW_F0_V1.4.0 to generate my project on STM32F030CC with FreeRTOS and EWARM toolchain. In debug mode. I only have the generated code at this time. It first crashes on HAL_TIM_PWM_ConfigChannel() call. It seems to loop inside a strange memory area around 0x1FFFDA7C, or so says the debugger. Log window displays ''The stack pointer for CSTACK (currently 0x20000A78) is outside the stack range (0x200000B8 to 0x200004B8).

I decided to comment MX_TIM3_Init() in main.c, but to no avail. I ended up commenting all MX_() calls to keep it as simple as possible, now it crashes with the same behaviour, but on the line __DSB() inside vPortYield(). I then tried to stard without any other initialisation besides osKernelStart(), still won't work. Decided to see if any ISR are being called, and the answer is none, not even PendSV_Handler() nor SysTick_Handler().

Reset default clock settings or not, same problem. I now have an empty SystemInit() and a main() containing only osKernelStart(). I just won't work.

Am I missing something here?

#stm32f030cc-stm32cubemx-rtos
1 REPLY 1
fsavaria
Associate II
Posted on January 28, 2016 at 23:45

Finally I switched debugger from J-Link Plus to ST-Link, problem solved. Symptom was really an unexpected system reset followed by unexpected boot load from system memory.

A lesson lived is a lesson learned.