2022-04-27 04:47 AM
@JHOUD @TDK @Dimitrios Bako
I have configured HDP as follows :
By 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 :
Now 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?
2022-04-27 07:17 AM
2022-04-27 07:42 AM
if possible ...can you direct it to someone ?
2022-05-03 01:39 AM
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.
2022-05-03 08:37 AM
Hi @JHOUD
yes device is STM32U575.
Code is divided into 3 Applictions :
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: