Skip to main content
Associate
August 29, 2025
Solved

STM32G474 Configuring SEC_SIZE1 for enabling secure memory

  • August 29, 2025
  • 2 replies
  • 698 views

Hello,

I am trying to configure the secure memory in Secure Protection Bank 1 of options bytes section and for this I have followed the STM32 MOOC tutorial to understand the concept of using secure boot code. But I am facing issues as the base address for Bank 1 is expected be 0x08000000 as mentioned in STM32 G4 system memory protection document and also in tutorial whereas its showing as 0x00000000 

Below is the screenshot from STMCube Programmer Option Byte settings from G474RE Board for your reference.

SHuddar_2-1756467431448.png

I have also checked the similar settings with G071 board and I am able to get the base address as 0x08000000 as below and implement the secure boot code but unable to do in G474.

SHuddar_3-1756467571550.png

Are there any other settings that I am missing out to configure in G474 to add the SEC_SIZE1 value?

Can you please help me with this?

Thanks

 

Best answer by SHuddar

Hello ST Team,

I am able to resolve this issue. I was not setting the Bank1 (FLASH_BANK_1) explicitly in application firmware and due to this the Sector Size along with base address was wrongly calculated.

As per my understanding, even if the address field in Security Protection (Bank1) of STM32G474 option bytes is displayed as 0x00000000 the base address is internally set to 0x08000000 and the offset is then calculated as per the value set in Value and Address fields as below. e.g For Value = 0x00000010 and Address = 0x00000010, the secure memory size area would be 0x08008000

SHuddar_1-1756886796571.png

SHuddar_2-1756887493141.png

Thanks,

SH

 

 

 

 

2 replies

Lina_DABASINSKAITE
Community Manager
August 29, 2025

Hi @SHuddar,

Your question is escalated to our Online support team. We will reach out to you directly. 

Regards,
Lina

​In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
SHuddarAuthorBest answer
Associate
September 3, 2025

Hello ST Team,

I am able to resolve this issue. I was not setting the Bank1 (FLASH_BANK_1) explicitly in application firmware and due to this the Sector Size along with base address was wrongly calculated.

As per my understanding, even if the address field in Security Protection (Bank1) of STM32G474 option bytes is displayed as 0x00000000 the base address is internally set to 0x08000000 and the offset is then calculated as per the value set in Value and Address fields as below. e.g For Value = 0x00000010 and Address = 0x00000010, the secure memory size area would be 0x08008000

SHuddar_1-1756886796571.png

SHuddar_2-1756887493141.png

Thanks,

SH