STM32 Issues

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

bspranger
Posts: 8
Joined: Wed Dec 22, 2010 9:16 pm

Re: STM32 Issues

Post by bspranger »

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?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32 Issues

Post by Giovanni »

This one:

http://chibios.svn.sourceforge.net/view ... iew=markup

Lines 94-96.

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.

Giovanni
bspranger
Posts: 8
Joined: Wed Dec 22, 2010 9:16 pm

Re: STM32 Issues

Post by bspranger »

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.

Thanks for all the help!

Brian
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32 Issues

Post by Giovanni »

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.

Giovanni
Post Reply