2012-10-31 11:44 PM
Dear all,
MCU we are using is STM32 F103CBT6, on a motor driver application. Wehave encountered a strange phenomenon that Bus Fault occurred randomly duringnormal operation, and the fault message shows that the PC we are getting arealso jumps randomly to invalid area. We have turn off Prefetch buffer, and even reduce operation freq from 72Mhzdown to 36Mhz, the problem still exist. does anyone ever seen this problem? These are few of the random fault we are receiving: Stack-R0 => 0x00000000 Stack-R1 => 0x00000000 Stack-R2 => 0x00000005 Stack-R3 => 0x00000000 Stack-R12 => 0x00000020 Stack-LR => 0x08011095 Stack-PC => 0x08010DF0 Stack-PSR => 0x61000000 SP Now => 0x200026E8 SP Startup => 0x20002708 HFSR => 0x00000000 CFSR => 0x00008200 BFSR-PRECISERR = 1 BFSR-BFARVALID = 1 BFAR => 0x29014628 DFSR => 0x00000000 AFSR => 0x00000000 --------------------------------------------------------------------- Stack-R0 => 0x20000065 Stack-R1 => 0x00000000 Stack-R2 => 0x00000009 Stack-R3 => 0x00000000 Stack-R12 => 0x00000020 Stack-LR => 0x08011095 Stack-PC => 0x08010DEC Stack-PSR => 0x61000000 SP Now => 0x200026E8 SP Startup => 0x20002708 HFSR => 0x00000000 CFSR => 0x00008200 BFSR-PRECISERR = 1 BFSR-BFARVALID = 1 BFAR => 0x000701D5 DFSR => 0x00000000 AFSR => 0x00000000 --------------------------------------------------------------------------- Stack-R0 => 0x20000065 Stack-R1 => 0x00000000 Stack-R2 => 0x00000031 Stack-R3 => 0x00000000 Stack-R12 => 0x00000020 Stack-LR => 0x08011095 Stack-PC => 0x08010DEC Stack-PSR => 0x61000000 SP Now => 0x200026E8 SP Startup => 0x20002708 HFSR => 0x00000000 CFSR => 0x00008200 BFSR-PRECISERR = 1 BFSR-BFARVALID = 1 BFAR => 0x00060066 DFSR => 0x00000000 AFSR => 0x00000000 ---------------------------------------------------------------------------------- Stack-R0 => 0x40000000 Stack-R1 => 0x00000000 Stack-R2 => 0x0000AAAA Stack-R3 => 0x40003000 Stack-R12 => 0x00000020 Stack-LR => 0x08010E01 Stack-PC => 0x08010E4A Stack-PSR => 0x01000000 SP Now => 0x200026E8 SP Startup => 0x20002708 HFSR => 0x00000000 CFSR => 0x00000400 BFSR-IMPRECISERR = 1 DFSR => 0x00000000 AFSR => 0x00000000 --------------------------------------------------------------------------------- Stack-R0 => 0x20000065 Stack-R1 => 0x00000000 Stack-R2 => 0x00000017 Stack-R3 => 0x00000000 Stack-R12 => 0x00000020 Stack-LR => 0x08011095 Stack-PC => 0x08010DEC Stack-PSR => 0x61000000 SP Now => 0x200026E8 SP Startup => 0x20002708 å †ç–Šä½¿ç�?¨æ•¸é‡� : 32 Byte HFSR => 0x00000000 CFSR => 0x00008200 BFSR-PRECISERR = 1 BFSR-BFARVALID = 1 BFAR => 0x001E018D DFSR => 0x00000000 AFSR => 0x00000000 -----------------------------------------------------------------------------------2012-11-01 04:48 AM
Seems some consistency in SP and LR at the failure point. Are you reporting the application stack? What subroutine is being called by the code immediately prior to LR?
You should confirm your stack is big enough, check for things which could overrun the stack variables, or DMA/IRQ which might be modifying the stack content. Make your user stack twice as big, put a fill pattern in there, and gauge maximal usage.