HARD FAULT uVisor

Hi,
I’m trying to test uvisor on my board. When I launch my application in the debug mode, I have this error :
“\r\tbox[0] acl[00]={0x20000000,size=10368,acl=0x00000030,HALT_ERROR(core/system/src/mpu/vm
pu_armv7m.c#462): box size (10368) not "
327,093 @“ounded, rounding disabled (rounded=16384)\n”
327,126 @”\r\n"

I think it’s due to SRAM and HOST SRAM configuration which is the following :

#define SRAM_LENGTH_MIN  0x40000  
#define HOST_SRAM_ORIGIN_MIN 0x20000000
#define HOST_SRAM_LENGTH_MAX 0x40000
#define SRAM_ORIGIN  0x20000000
#define SRAM_OFFSET  0x0

Anyone could help me?

I made some changes in my configuration and now i have this error :

770,156 @“\rbox[0] ACL list:\n”
770,188 @“ctx=0 stack=0\n”
770,220 @“\r\tbox[0] acl[00]={0x40011000,size=00024,acl=0x00000AB6,rounded=00032}\n”
770,233 @“\r\tbox[0] acl[01]={0x40012000,size=00024,acl=0x00000AB6,rounded=00032}\n”
770,246 @“\r\tbox[0] acl[02]={0x40008000,size=00180,acl=0x00000AB6,rounded=00256}\n”
770,259 @“\r\tbox[0] acl[03]={0x40020000,size=00052,acl=0x00000AB6,rounded=00064}\n”
770,272 @“\r\tbox[0] acl[04]={0x40000000,size=00056,acl=0x00000AB6,rounded=00064}\n”
770,285 @“\r\tbox[0] acl[05]={0x40006000,size=00024,acl=0x00000AB6,rounded=00032}\n”
770,298 @“\r\tbox[0] acl[06]={0x40000400,size=00008,acl=0x00000AB6,rounded=00032}\n”
770,311 @“\r\tbox[0] acl[07]={0x40029000,size=00068,acl=0x00000AB6,rounded=00128}\n”
770,325 @“\r\tbox[0] acl[08]={0xE000E000,size=04096,acl=0x00000AB6,rounded=04096}\n”
770,338 @“\rbox[1] ACL list:\n”
770,351 @“\tbox[1] stack=1024 context=0 rounded=2048\n”
770,364 @“\r\tbox[1] acl[09]={0x20002000,size=02048,acl=0x00000076,rounded=02048}\n”
770,377 @“\rvmpu_load_boxes [DONE]\n”
770,390 @“uvisor initialized\n”
770,404 @“\n”
770,417 @“\n"
770,449 @" HARD FAULT\n"
770,481 @"
\n”
770,513 @“\n”
770,526 @“* HFSR : 0x40000000\n”
770,539 @“\r\n”
770,552 @“\r* CFSR : 0x00000092\n”
770,584 @“\r\n”
770,597 @“\r* DFSR : 0x00000001\n”
770,610 @“\r\n”
770,623 @“\r* BFAR : 0x2000486C\n”
770,655 @“\r\n”
770,669 @“\r* MMFAR : 0x2000486C\n”
770,682 @“\r\n”
770,695 @“\r* EXCEPTION STACK FRAME\n”
770,708 @" Exception from privileged code\n"
770,740 @" msp: 0x20001F78\n"
770,753 @“\r lr: 0xFFFFFFF1\n”
770,766 @“\r Exception stack frame:\n”
770,779 @" msp[07]: 0x01000204 | xPSR\n"
770,792 @" msp[06]: 0x10002F5E | pc\n"
770,805 @" msp[05]: 0x10001745 | lr\n"
770,818 @" msp[04]: 0x00000000 | r12\n"
770,831 @" msp[03]: 0x20004860 | r3\n"
770,844 @" msp[02]: 0x10002F24 | r2\n"
770,876 @" msp[01]: 0x20001FE0 | r1\n"
770,908 @" msp[00]: 0xFFFFFFFD | r0\n"
770,921 @“\n”
770,934 @“* MPU CONFIGURATION\n”
770,947 @“\r\n”
770,960 @“\r Background region enabled\n”
770,973 @“\r MPU bypassed @NMI, @HardFault\n”
771,005 @“\r MPU enabled\n”
771,018 @“\r\n”
771,050 @“\r Region Start Size XN AP TEX S C B SRD Valid\n”
771,063 @“\r 0 0x10000000 128KB 0 110 000 0 0 0 00000000 1\n”
771,095 @“\r 1 0x20020000 128KB 0 011 000 0 0 0 00000000 1\n”
771,108 @“\r 2 0x40011000 032B 1 011 000 0 0 0 00000000 1\n”
771,140 @“\r 3 0x40012000 032B 1 011 000 0 0 0 00000000 1\n”
771,153 @“\r 4 0x40008000 256B 1 011 000 0 0 0 00000000 1\n”
771,166 @“\r 5 0x40020000 064B 1 011 000 0 0 0 00000000 1\n”
771,179 @“\r 6 0x40000000 064B 1 011 000 0 0 0 00000000 1\n”
771,192 @“\r 7 0x40006000 032B 1 011 000 0 0 0 00000000 1\n”
771,205 @“\r\n”
771,218 @“\r***********************************************************\n”

The problem was due to SRAM, i didn’t configure the SRAM and HOST SRAM correctly, now, I’ve got a BUS FAULT :confused: :
I though the problem was the region of 0xE000E000, but i made sure to declare it in my ACL
573,230 @“\rbox[0] ACL list:\n”
573,263 @“ctx=0 stack=0\n”
573,295 @“\r\tbox[0] acl[00]={0x40000000,size=00056,acl=0x00000AB6,rounded=00064}\n”
573,328 @“\r\tbox[0] acl[01]={0x42100000,size=04096,acl=0x00000AB6,rounded=04096}\n”
573,360 @“\r\tbox[0] acl[02]={0x40010000,size=24576,acl=0x00000AB6,rounded=32768}\n”
573,392 @“\r\tbox[0] acl[03]={0x40008000,size=00180,acl=0x00000AB6,rounded=00256}\n”
573,425 @“\r\tbox[0] acl[04]={0xE000E000,size=04096,acl=0x0000083F,rounded=04096}\n”
573,457 @“\rbox[1] ACL list:\n”
573,489 @“\tbox[1] stack=1024 context=0 rounded=2048\n”
573,522 @“\r\tbox[1] acl[05]={0x20002000,size=02048,acl=0x00000076,rounded=02048}\n”
573,554 @“\rvmpu_load_boxes [DONE]\n”
573,586 @“uvisor initialized\n”
573,618 @“\n”
573,650 @“\n"
573,682 @" BUS FAULT\n"
573,694 @"
\n”
573,727 @“\n”
573,740 @“* CFSR : 0x00008200\n”
573,773 @“\r\n”
573,805 @“\r* BFAR : 0xE000ED08\n”
573,817 @“\r\n”
573,850 @“\r* EXCEPTION STACK FRAME\n”
573,863 @" Exception from unprivileged code\n"
573,895 @" psp: 0x2000A720\n"
573,907 @“\r lr: 0xFFFFFFFD\n”
573,940 @“\r Exception stack frame:\n”
573,972 @" psp[08]: 0x10011F55 | align\n"
574,004 @" psp[07]: 0x21000000 | xPSR\n"
574,016 @" psp[06]: 0x1000F0AE | pc\n"
574,049 @" psp[05]: 0x10011FDF | lr\n"
574,081 @" psp[04]: 0x00000000 | r12\n"
574,114 @" psp[03]: 0xE000ED00 | r3\n"
574,146 @" psp[02]: 0x40011000 | r2\n"
574,159 @" psp[01]: 0x10011F55 | r1\n"
574,172 @" psp[00]: 0x00000006 | r0\n"
574,205 @“\n”
574,237 @“* MPU CONFIGURATION\n”
574,269 @“\r\n”
574,282 @“\r Background region enabled\n”
574,315 @“\r MPU bypassed @NMI, @HardFault\n”
574,347 @“\r MPU enabled\n”
574,380 @“\r\n”
574,413 @“\r Region Start Size XN AP TEX S C B SRD Valid\n”
574,446 @“\r 0 0x10000000 128KB 0 110 000 0 0 0 00000000 1\n”
574,478 @“\r 1 0x20000000 256KB 0 011 000 0 0 0 00000000 1\n”
574,511 @“\r 2 0x20000000 016KB 1 001 000 0 0 0 00000000 1\n”
574,524 @“\r 3 0x40000000 064B 1 011 000 0 0 0 00000000 1\n”
574,557 @“\r 4 0x42100000 004KB 1 011 000 0 0 0 00000000 1\n”
574,570 @“\r 5 0x40010000 032KB 1 011 000 0 0 0 00000000 1\n”
574,602 @“\r 6 0x40008000 256B 1 011 000 0 0 0 00000000 1\n”
574,636 @“\r 7 0xE000E000 004KB 0 011 000 0 0 0 00000000 1\n”
574,669 @“\r\n”
574,701 @“\r***********************************************************\n”
574,734 @“\n”
574,766 @“HALT_ERROR(core/system/src/mpu/vmpu_armv7m.c#268): Access to restricted resource denied\n”\

cc @AlessandroA @Kojto

The problem was resolved and it was due NVIC vectors functions, when we use uvisor we should use vIRQ_functions instead