STM32F407-Discovery Demo unhandled exception

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
aley_i
Posts: 4
Joined: Tue Mar 25, 2014 10:06 am

STM32F407-Discovery Demo unhandled exception

Post by aley_i »

Hi,
I am working with STM32F407 Discovery board and was running the Demo provided in ChibOS version 2.6.3 on Keil uvision 5, the provided project works fine when I run it with the optimization level set to 3 and check the optimize for time box in the project Options (C/C++ tab), however if I Select the optimization level to be 0 and uncheck Optimize for time I end up with an unhandled exception.
Any ideas why this is happening ?
Thanks
Aley
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F407-Discovery Demo unhandled exception

Post by Giovanni »

It could be a stack overflow, unoptimized code uses more space. Try increasing PORT_IDLE_THREAD_STACK_SIZE, it is the stack allocated to the idle thread, normally it is 16.

Giovanni
aley_i
Posts: 4
Joined: Tue Mar 25, 2014 10:06 am

Re: STM32F407-Discovery Demo unhandled exception

Post by aley_i »

Thank for your reply Giovanni, I have tried increasing the PORT_IDLE_STACK_SIZE to 18, 24 and event 32 but I get the same problem. Any thing else that I can try ?
Aley
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F407-Discovery Demo unhandled exception

Post by Giovanni »

Try enabling the debug options in chconf.h and see if something is trapped.

Giovanni
Post Reply