cancel
Showing results for 
Search instead for 
Did you mean: 

BCM4 boot option byte, software modification on STM32H747

baptor
Associate III

Hi, I am curently working on the STM32H747. I need to have the CM7 booting while the CM4 is not. Then after, the CM4 BOOT is triggered by the CM7.

Using STM32 cube programmer, I am able to disable the BCM4 bit of the SYSCFG_UR1 register.

The required sequency is then working.

BUT, I would like to change this BCM4 bit in the CM7 c code. I found HAL functions to do the work, ( HAL_SYSCFG_DisableCM4BOOT(); ) but when I check the BCM4 bit using cube programmer, it is never changed.

I tried to read the value of this bit using READ_BIT(REG, BIT) function, but it always return 0, even if ticked in cube programmer.

I am using IAR 9.10, and I can check register values SYSCFG_UR0 to SYSCFG_UR17, but the only missing register is the UR1, the one I need...

Is there an access limitation to this register? or do I miss something else?

Thank you

Baptor

2 REPLIES 2
baptor
Associate III

Ok, moved forward.

The SYSCFG registers are reseted after each reboot, and are reloaded after the HAL_Init() in the CM7 code. I moved read of BCM4 bit after the HAL_init().

 if( (SYSCFG->UR1 & 0x00010001U ) > 0x0U) ( should detect BCM7 and BCM4 bit)

 {

   CLEAR_BIT(SYSCFG->UR1, SYSCFG_UR1_BCM4);

 }

it goes inside the If().

but if I do :

if( (SYSCFG->UR1 & 0x00000001U ) > 0x0U) ( should detect only BCM4 bit)

it dosn't go in the if.

Also, I need to make the modification permanentely, so to modify the register value only, will maybe not be enought if not saved into flash.

need to check that now.

baptor
Associate III

found some explainations and tried this :

HAL_Init(); // reset of all peripherals + initializes the flash interface and the Systick timer

 HAL_FLASH_Unlock();

 HAL_FLASH_OB_Unlock();

 if( READ_BIT(SYSCFG->UR1, SYSCFG_UR1_BCM4 ))

 {

   HAL_SYSCFG_DisableCM4BOOT();

   HAL_FLASH_OB_Launch();

 }

 HAL_FLASH_OB_Lock();

 HAL_FLASH_Lock();

but still not entering in the If(). but it seems to be the right way to do it.