2008-09-16 11:48 AM
uC/OS-II Hangs
2011-05-17 03:43 AM
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, Laurent2011-05-17 03:43 AM
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. Ryan2011-05-17 03:43 AM
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