Disabling optimizations (-O0) breaks the CortexM/RVC kernel
Posted: Sun Sep 30, 2012 9:27 pm
I already filed a bug, but I'm interested in knowing if anyone else can reproduce this error.
https://sourceforge.net/tracker/?func=d ... tid=995489
I'm using ChibiOS 2.4.x branch and Keil MDK-ARM Professional 4.50.0.0. My board is a STM32F4 discovery.
From the bug tracker you can download an absolutely minimal Keil project that will trigger the error when compiling with -O0 but will work fine when compiling with -O3:
halInit();
chSysInit();
chThdSleep(3);
chThdSleep(TIME_INFINITE);
If you just launch the program and the stop it, you'll either see it was looping in the unhandled exception function (with -O0) or in the idle thread (with -O3).
I've traced the execution in both cases but still can't figure out what's wrong. I'm new to ChibiOS and thus don't know that well its internals.
Sure, I can go with -O3 enabled all the time, but if there's something fundamentally wrong it will bite me sooner or later, so I'd rather don't go past this without a fix.
Thanks.
https://sourceforge.net/tracker/?func=d ... tid=995489
I'm using ChibiOS 2.4.x branch and Keil MDK-ARM Professional 4.50.0.0. My board is a STM32F4 discovery.
From the bug tracker you can download an absolutely minimal Keil project that will trigger the error when compiling with -O0 but will work fine when compiling with -O3:
halInit();
chSysInit();
chThdSleep(3);
chThdSleep(TIME_INFINITE);
If you just launch the program and the stop it, you'll either see it was looping in the unhandled exception function (with -O0) or in the idle thread (with -O3).
I've traced the execution in both cases but still can't figure out what's wrong. I'm new to ChibiOS and thus don't know that well its internals.
Sure, I can go with -O3 enabled all the time, but if there's something fundamentally wrong it will bite me sooner or later, so I'd rather don't go past this without a fix.
Thanks.