2025-06-04 6:39 AM
Hello together,
i have an application running with TZEN, unfortunately the readings of the internal temperature sensor calibration values are always zero.
Is there a secure address where the values are stored ?
Or any chance to get the values out in TZEN mode ?
As @Jocelyn RICARD knows i had to enable the trust zone to do the embeddeed provisioning
Kind regards
Martin
2025-06-13 10:48 AM
Hello @martinhaefner9 ,
this issue should not be related to TrustZone.
The access to system memory where calibration values is located is constrained.
You need to either disable ICache or add a MPU region to disable the cache only on this area.
You can find this in example:
STM32Cube_FW_H5_V1.5.0\Projects\NUCLEO-H563ZI\Examples_LL\UTILS\UTILS_ReadDeviceInfo\
I made the test on non secure side of a TrustZone project
Here is the simple MPU configuration I added:
void MPU_Config(void)
{
MPU_Region_InitTypeDef MPU_InitStruct = {0};
MPU_Attributes_InitTypeDef MPU_AttributesInit = {0};
/* Disables the MPU */
HAL_MPU_Disable();
/** Initializes and configures the Region 0 and the memory to be protected
*/
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER0;
MPU_InitStruct.BaseAddress = 0x08FFF000;
MPU_InitStruct.LimitAddress = 0x08FFFFFFU;
MPU_InitStruct.AttributesIndex = MPU_ATTRIBUTES_NUMBER0;
MPU_InitStruct.AccessPermission = MPU_REGION_ALL_RO;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
HAL_MPU_ConfigRegion(&MPU_InitStruct);
/** Initializes and configures the Attribute 0 and the memory to be protected
*/
MPU_AttributesInit.Number = MPU_ATTRIBUTES_NUMBER0;
MPU_AttributesInit.Attributes = INNER_OUTER(MPU_NOT_CACHEABLE);
HAL_MPU_ConfigMemoryAttributes(&MPU_AttributesInit);
/* Enables the MPU */
HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
}
Best regards
Jocelyn