Re: Increasing stack size seems to cause failure
Posted: Sat Mar 26, 2011 1:30 pm
I have something strange problems with stack overflow too.
At first everything was fine, but suddenly I began to get into port_halt() trap when try to insert chThdSleepMilliseconds(n) after chThdCreateStatic(). I have cut out all code except blinking thread and get this problem too. After reading articles in http://www.chibios.org I understand that stack overflow occurs. Switching on and off CH_DBG_ENABLE_STACK_CHECK flag has confirmed this. I have try to increase __main_stack_size__ and __process_stack_size__ to 0x0800, but this does not help. After a long "brute force" search I found, that adding -fomit-frame-pointer flag to compiler (both Codesourcery and Yagarto) solve problem. It is very strange, because earlier my project compile and run fine without this flag. I think that I do something totally wrong. But what and where?
I use: MCU - STM32F103RBT6, compiler - Codesourcery, version of ChibiOS - 2.3.0
At first everything was fine, but suddenly I began to get into port_halt() trap when try to insert chThdSleepMilliseconds(n) after chThdCreateStatic(). I have cut out all code except blinking thread and get this problem too. After reading articles in http://www.chibios.org I understand that stack overflow occurs. Switching on and off CH_DBG_ENABLE_STACK_CHECK flag has confirmed this. I have try to increase __main_stack_size__ and __process_stack_size__ to 0x0800, but this does not help. After a long "brute force" search I found, that adding -fomit-frame-pointer flag to compiler (both Codesourcery and Yagarto) solve problem. It is very strange, because earlier my project compile and run fine without this flag. I think that I do something totally wrong. But what and where?
I use: MCU - STM32F103RBT6, compiler - Codesourcery, version of ChibiOS - 2.3.0