Hard fault after enable MPU protection
Porting SBSFU 2.6.2 to STM32G0B1CEU6 (512K FLASH and 144K RAM) based on Nucleo-G071RB example.
See the history of my previous Solved: SBSFU 2.6.2 firmware swapping issue - STMicroelectronics Community
After I solved the firmware swapping issue, I went on and test all the other security features. All are good until I turned
@7:8000000 size:e sub:c0 perm:5 exec:0
@6:20000000 size:b sub:0 perm:1 exec:1
@5:20000000 size:10 sub:0 perm:3 exec:1
@4:8010000 size:a sub:0 perm:1 exec:1
@3:8000000 size:f sub:0 perm:6 exec:0
@2:8000000 size:12 sub:0 perm:3 exec:1
@0:40000000 size:1c sub:0 perm:3 exec:1
@1:40021000 size:9 sub:0 perm:1 exec:1
= [SBOOT] RuntimeProtections: 100
= [SBOOT] System Security Check successfully passed. Starting...
======================================================================
= (C) COPYRIGHT 2017 STMicroelectronics =
= =
= Secure Boot and Secure Firmware Update =
======================================================================
= [SBOOT] SECURE ENGINE INITIALIZATION SUCCESSFUL
= [SBOOT] STATE: CHECK STATUS ON RESET
INFO: A Reboot has been triggered by a Software reset!
= [SBOOT] STATE: CHECK NEW FIRMWARE TO DOWNLOAD
= [SBOOT] STATE: CHECK USER FW STATUS
SLOT_ACTIVE_1 state = 1
A FW is detected in the slot SLOT_ACTIVE_1
= [SBOOT] STATE: VERIFY USER FW SIGNATURE
Hard fault
========= End of Execution ==========
The changes I did are just in stu_low_level_security.h to define the MPU region.
Changed region 2 (flash) from MPU_REGION_SIZE_128KB 0x00U to MPU_REGION_SIZE_512KB 0x00U
Changed region 5 (sram) from MPU_REGION_SIZE_64KB 0xE0 to MPU_REGION_SIZE_128KB 0x00U
All the rest of the settings looks good to me. Is there anything else I need to consider before I can use MPU function on a dual bank memory MCU?
