cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to jump to application after enabling HDP

vsing.1
Associate II

@JHOUD​ @TDK​ @Dimitrios Bako​ 

I have configured HDP as follows :

0693W00000LzCUYQA3.pngBy Bootloader .icf details are :

define symbol __ICFEDIT_region_ROM_start__       = 0x0C000800;

define symbol __ICFEDIT_region_ROM_end__        = 0x0C007FFF;

Configurations when i debug the code are also fine :

0693W00000LzCVgQAN.pngNow from Bootloader i Jump to my secure application in which i Enable Hide protection :

HAL_FLASHEx_EnableSecHideProtection(FLASH_BANK_1);

issue is after this i am not able to jump to my nonsecure application. .icf details are:

define symbol __ICFEDIT_intvec_start__ = 0x08020000;

/*-Memory Regions-*/

define symbol __ICFEDIT_region_ROM_start__   = 0x08020800;

define symbol __ICFEDIT_region_ROM_end__    = 0x08027FFF;

without enabling Hide protection it works fine.

Am i missing something?

4 REPLIES 4
TDK
Guru
Not my area of expertise, sorry.
If you feel a post has answered your question, please click "Accept as Solution".

if possible ...can you direct it to someone ?

Bubbles
ST Employee

Hi, I assume it's a U5, but can you be more specific about the product next time?

When you say not able to jump, what exactly happens? security exception, hard fault?

I haven't yet encountered a problem like this, HDP only does what the RM says, makes a portion of Flash inaccessible until reset.

Are you sure there is no access to that HDP area?

BR,

J

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.

Hi @JHOUD​ 

yes device is STM32U575.

Code is divided into 3 Applictions :

  1. Bootloader
  2. Secure App
  3. Non Secure App

HDP is applied on Bootloader region:

i.e WMHDPEndPage = 3 of Bank 1

Code jumps to secure App from Bootloader App :

Hide Protection access disabled in Secure App.

HAL_FLASHEx_EnableSecHideProtection(FLASH_BANK_1);

Secure App then jumps to Non-secure App :

here firmware kind of hangs and program counter shows

[PC = 0xefff'fffe]

I have checked HDP by applying it to BANK 2 ,which is working fine.

But when i am applying it to Bank1 (where my code lies) this issue occurs.

I am detailing memory segregation below ,because it seems like jumping to non-secure app is accessing HDP region somehow.

BOOTLOADER APP:

/*-Specials-*/

define symbol __ICFEDIT_intvec_start__ = 0x0C000000;

/*-Memory Regions-*/

define symbol __ICFEDIT_region_ROM_start__       = 0x0C000800;

define symbol __ICFEDIT_region_ROM_end__        = 0x0C007FFF;

define symbol __ICFEDIT_region_ROM_static_data_start__ = 0x0C008000;

define symbol __ICFEDIT_region_ROM_static_data_end__  = 0x0C00BFFF;

define symbol __ICFEDIT_region_ROM_dynamic_data_start__ = 0x0C00C000;

define symbol __ICFEDIT_region_ROM_dynamic_data_end__  = 0x0C00FFFF;

define symbol __ICFEDIT_region_RAM_start__       = 0x30000000;

define symbol __ICFEDIT_region_RAM_end__        = 0x3002FFFF;

SECURE APP:

/*-Specials-*/

define symbol __ICFEDIT_intvec_start__ = 0x0C010000; // add memory for keys

/*-Memory Regions-*/

define symbol __ICFEDIT_region_ROM_start__   = 0x0C010800;

define symbol __ICFEDIT_region_ROM_end__    = 0x0C017FFF;

define symbol __ICFEDIT_region_ROM_NSC_start__ = 0x0C018000;

define symbol __ICFEDIT_region_ROM_NSC_end__  = 0x0C01FFFF;

define symbol __ICFEDIT_region_RAM0_start__   = 0x30000000;

define symbol __ICFEDIT_region_RAM0_end__    = 0x3002FFFF;

define symbol __ICFEDIT_region_RAM1_start__   = 0x30030000;

define symbol __ICFEDIT_region_RAM1_end__    = 0x30037FFF;

define symbol __ICFEDIT_region_RAM2_start__   = 0x30038000;

define symbol __ICFEDIT_region_RAM2_end__    = 0x3003FFFF;

NON-SECURE APP:

/*-Specials-*/

define symbol __ICFEDIT_intvec_start__ = 0x08020000;

/*-Memory Regions-*/

define symbol __ICFEDIT_region_ROM_start__   = 0x08020800;

define symbol __ICFEDIT_region_ROM_end__    = 0x08027FFF;

define symbol __ICFEDIT_region_RAM_start__   = 0x20040000;

define symbol __ICFEDIT_region_RAM_end__    = 0x20057FFF;

Adding few details when issue occur:

0693W00000Np75CQAR.png0693W00000Np75WQAR.png