Skip to main content
Explorer II
October 10, 2024
Solved

STM32H5 getUID with enabled ICACHE

  • October 10, 2024
  • 2 replies
  • 910 views

Hi. 
Is there any consideration that I need to take care of when I use HAL_GetUIDw0~2 while ICACHE is enabled?
even the simplest project with STM32H573IIK3Q that the ICACHE is enabled will get a hardfault when trying to get UID bytes.

This is the whole code that I have:

 /* USER CODE BEGIN WHILE */
 while (1)
 {
	 uint32_t x,y,z;
	 x=HAL_GetUIDw0();
	 //y=HAL_GetUIDw1();
	 //z=HAL_GetUIDw2();
	 HAL_Delay(1000);
 /* USER CODE END WHILE */

 /* USER CODE BEGIN 3 */
 }
 /* USER CODE END 3 */

 

    This topic has been closed for replies.
    Best answer by Guillaume K

    see How to obtain and use the STM32 96-bit UID - STMicroelectronics Community , paragraph "2.1 STM32H5 specific issue" : you have to configure an MPU region to remove cache on the UID registers addresses.

     

     

    2 replies

    ST Employee
    October 10, 2024

    see How to obtain and use the STM32 96-bit UID - STMicroelectronics Community , paragraph "2.1 STM32H5 specific issue" : you have to configure an MPU region to remove cache on the UID registers addresses.

     

     

    Explorer II
    October 10, 2024

    Thanks @guillaume , looks like that solves the problem.