Giovanni wrote:BTW, are you using the ChibiOS/RT startup files? if not make sure that the processor is in process/privileged mode before initializing the OS.
We are not using your startup code, so which file should I be looking at to setup the process/privileged mode?
I am not sure if your startup already does that but without that initialization the processor would use a single stack and the kernel would not work because it expects interrupts processed in a dedicated stack. The startup/linker files are also responsible for *both* stacks initialization.
Sorry about the slow response but I wanted to do some testing before I was sure of my results.
As it turns out, we believe we had an issue with version 2.0.4 because we were using the PendSV interrupt vector. So we may have been compiling it incorrectly.
When we moved to 2.0.8 we had issues where the OS wasn't running. Well, I believe it was a problem in our makefiles. Our Hal gets compiled with with Chibios into a library. Then the library gets linked with out application as a secondary process. When the application was linking the library containing chibios 2.0.8 it was still using the chibios 2.0.4 header files. In a lot of places this probably wouldn't be the worst issue, but with Chibios, there are a lot of inline functions in the headers.
So at this point things seem to be operating smoothly.
The inlining can be disabled by turning off the CH_OPTIMIZE_SPEED option in the kernel configuration file. It is usually enabled because the performance benefit and all the compilers I tested do not have troubles with it.
Disabling this option may be useful in order to save some extra ROM space but it my also increase the RAM stack usage.