cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H5 getUID with enabled ICACHE

miladmohtashamirad
Associate III

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 */

 

1 ACCEPTED SOLUTION

Accepted Solutions
Guillaume K
ST Employee

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.

 

 

View solution in original post

2 REPLIES 2
Guillaume K
ST Employee

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.

 

 

miladmohtashamirad
Associate III

Thanks @guillaume , looks like that solves the problem.