cancel
Showing results for 
Search instead for 
Did you mean: 

flashing stm32h563zi

Recep
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions

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"

View solution in original post

2 REPLIES 2
Sarra.S
ST Employee

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.

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"