cancel
Showing results for 
Search instead for 
Did you mean: 

uC/OS-II Hangs

chenu
Associate II
Posted on September 16, 2008 at 20:48

uC/OS-II Hangs

3 REPLIES 3
chenu
Associate II
Posted on May 17, 2011 at 12:43

Hi,

I am using a STM32 with uC/OS-II from an IAR 5.11 toolchain. I am having a strange problem, the system hangs in the APP_Fault_ISR() randomly (meaning that it can happen straight away or half an hour later). Once in this ISR I am able to make out (by analysing the stack) that it was executing either 'OSIntExit()' or OSStartHighRdy() (in which case the ASM instruction causing the failure is ''CPSIE I'').

Would appreciate a little help on this as I am running out of ideas.

Many thanks,

Laurent

ryan2399
Associate II
Posted on May 17, 2011 at 12:43

Laurent,

Which version of uC/OS-II are you using? There was a bug in v2.84 (and possibly v2.85) That would cause the problem you are describing.

The bug affects OSCtxSw(), OSIntCtxSw() (called from OSIntExit()) and OSStartHighRdy().

They were using registers R4 and R5 in the assembly code without pushing them to the stack first. Eventually this would screw something up on a return. Also OSStartHighRdy() was setting PendSV to the highest priority by default (should have been lowest).

The latest code v2.86 appears to have the fix in for this. Using R0 and R1 instead (which follows ARM's AAPCS) and setting PendSV to the lowest priority.

Ryan

chenu
Associate II
Posted on May 17, 2011 at 12:43

Thank you very much Ryan for this information, will look into it and let you know. I have found my problem (was nothing to do with stm32 nor uCOS-II) however we still have some strange behaviors which may be related.

Rgds,

Laurent