Skip to main content
Recep
Associate II
December 7, 2023
Solved

flashing stm32h563zi

  • December 7, 2023
  • 2 replies
  • 1273 views

Hi,

I am trying to flash STM32H563ZI,  (NUCLEO-H563ZI) but I get hard fault error

I will flash to BANK2 that starting address 0x081000000

MY CODE;

HAL_FLASH_Unlock();

erase.TypeErase = FLASH_TYPEERASE_SECTORS;

erase.Banks = FLASH_BANK_2;

erase.Sector = 0;

erase.NbSectors = 1;

if (HAL_FLASHEx_Erase(&erase, &sector_error) == HAL_OK)

{

HAL_FLASH_Program(FLASH_TYPEPROGRAM_QUADWORD, 0x0810A000, 0x11111111);

}

HAL_FLASH_Lock();

Thanks for your attention

This topic has been closed for replies.
Best answer by Recep

Thanks for reply, I figured out why it happens

because of Voltage scale range macro 1 is selected before it is 200 mhz

but my processor is 250 mhz chosen and I need to select Voltage scale range as "0"

2 replies

ST Employee
December 7, 2023

Hello @Recep

Please check the STM32CubeH5 examples in Flash > FLASH_EraseProgram

 

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.
Recep
RecepAuthorBest answer
Associate II
December 10, 2023

Thanks for reply, I figured out why it happens

because of Voltage scale range macro 1 is selected before it is 200 mhz

but my processor is 250 mhz chosen and I need to select Voltage scale range as "0"