Hard Fault exception is triggered when an user interrupt fired with uvisor enabled

Hi All,
I am new to mbed and uVisor, when I enabled uvisor for a new platform having MPU in cortex-M4 cpu. I am now able to register one user interrupt successfully, but when ever the system fires a user interrupt, I am getting an Hard Fault exception(debug prints are showing). but in the HFSR(Hard fault status register) is having all zeros only.

I am working with “mbed OS 15.11 Technology Preview Release”.

Thanks for your quick answer.

cc @AlessandroA

If you have a license for uVision could you take a look at http://blog.mbed.com/post/139539984822/debugging-a-crashed-device-with-cmsis-dap and share the stack trace?

Hi, you mentioned you are getting debug prints, so I guess you enabled semihosting. Could you please post here the full set of semihosting messages, from reset up to the fault?

Also, it would help to see a snippet that shows the code sequence you use to set, enable and handle an IRQ. Which platform are you running this code on?

Hi AlessandroA,
ARM’s Semihosting feature is not enabled in this case. and for debugging prints we are using UART. and coming to platform ours is a own in house platform.
Here are the debug UART prints for reference.

debug
uvisor_mode: 2
uvisor_ram : @0x00140200 (8192 bytes) [config]
(0x00140200 (8192 bytes) [linker]
MPU.REGIONS=8
MPU.ALIGNMENT=0x0000001F
MPU.ALIGNMENT_BITS=5

box stack segment start=0x00142200 end=0x00142200 (length=3584)

box[0] acl[00]={0x00100000,size=44864,acl=0x000000BF,rounded=65536}

box[0] acl[00]={0x00140000,size=262144,acl=0x000000BF,rounded=262144}

box[0] acl[00]={0xE0000000,size=1048575,acl=0x000000BF,rounded=1048576}

box[0] ACL list:
ctx=0 stack=0

box[0] acl[00]={0x40004000,size=04096,acl=0x00000AB6,rounded=04096}

box[0] acl[01]={0x40082000,size=04096,acl=0x00000AB6,rounded=04096}

box[1] ACL list:
box[1] stack=1024 context=17 rounded=2048

box[1] acl[02]={0x00142800,size=02048,acl=0x02000076,rounded=02048}

vmpu_load_boxes [DONE]
uvisor initialized

InitIRQ 3 registered to box 0

IRQ 3 enabled

***** uvisor-helloworld example *****

main unprivileged box configured


                HARD FAULT

  • HFSR : 0x00000000

  • EXCEPTION STACK FRAME
    Exception from privileged code
    Cannot print exception stack frame.

  • MPU CONFIGURATION

    Background region enabled

    MPU bypassed @NMI, @HardFault

    MPU enabled

    Region Start Size XN AP TEX S C B SRD Valid

    0 0x00100000 064KB 0 110 000 0 0 0 00000000 1

    1 0x00140000 256KB 0 110 000 0 0 0 00000000 1

    2 0xE0000000 001MB 0 110 000 0 0 0 00000000 1

    3 0x40004000 004KB 1 110 000 0 0 0 00000000 1

    4 0x40082000 004KB 1 110 000 0 0 0 00000000 1

    5 0x00000000 000B 0 000 000 0 0 0 00000000 0

    6 0x00000000 000B 0 000 000 0 0 0 00000000 0

    7 0x00000000 000B 0 000 000 0 0 0 00000000 0