cancel
Showing results for 
Search instead for 
Did you mean: 

Bus Fault occured randomly during normal operation

edison72
Associate
Posted on November 01, 2012 at 07:44

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

-----------------------------------------------------------------------------------
1 REPLY 1
Posted on November 01, 2012 at 12:48

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.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..