Page 1 of 1

STM32F407-Discovery Demo unhandled exception

Posted: Mon Mar 31, 2014 1:21 pm
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

Re: STM32F407-Discovery Demo unhandled exception

Posted: Mon Mar 31, 2014 1:27 pm
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

Re: STM32F407-Discovery Demo unhandled exception

Posted: Mon Mar 31, 2014 2:14 pm
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

Re: STM32F407-Discovery Demo unhandled exception

Posted: Mon Mar 31, 2014 2:29 pm
by Giovanni
Try enabling the debug options in chconf.h and see if something is trapped.

Giovanni