cancel
Showing results for 
Search instead for 
Did you mean: 

SBSFU Memory fault when SFU_MPU_PROTECT_ENABLE is used

OOni
Associate II

We have ported STM32CubeExpansion_SBSFU_V2.4.0 to use STM32H7B0 instead of the STM32H7B3-DK.

When I enable SFU_MPU_PROTECT_ENABLE the bootloader generates MEMORY FAULT! when starting up and not yet called user application.

I have tried to debug as much as I can and come to suspect the following entry in the MpuAreas data structure SFU_MPU_InitTypeDef in sfu_low_level_security.c

{
    SFU_PROTECT_MPU_PERIPH_2_RGNV, SFU_PROTECT_MPU_PERIPH_2_START, SFU_PROTECT_MPU_PERIPH_2_SIZE,
    SFU_PROTECT_MPU_PERIPH_2_PERM, SFU_PROTECT_MPU_PERIPH_2_EXECV, SFU_PROTECT_MPU_PERIPH_2_SREG,
    SFU_PROTECT_MPU_PERIPH_2_TEXV, SFU_PROTECT_MPU_PERIPH_2_C, SFU_PROTECT_MPU_PERIPH_2_B
  }

If I comment out the above code the SBSFU boots okay. Examining the fault report dialog window I see that the fault is pointing to address 0x58024540 as the offender.

But when I look at this register address it is the RCC AHB4 Clock Register (RCC_AHB4ENR) and I can not see why this is causing this fault. I am assuming that I am correct and the fault dialog windows is showing the correct address.

I arrived at the suspected register name by looking at the constant definitions.

//
// SBSFU\Drivers\CMSIS\Device\ST\STM32H7xx\Include\stm32h7b0xx.h
//
#define PERIPH_BASE          (0x40000000UL) /*!< Base address of : AHB/ABP Peripherals */
#define SRD_AHB4PERIPH_BASE  (PERIPH_BASE + 0x18020000UL)   /*!<  D3_AHB1PERIPH_BASE (PERIPH_BASE + 0x18020000UL) */
#define RCC_BASE             (SRD_AHB4PERIPH_BASE + 0x4400UL)
RCC_BASE = 58024400
 
===========
@1:58024400 size:9 sub:0 perm:1 exec:1

Any pointers to my issues. Many thanks in advance.

Regards

0 REPLIES 0