cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743ZI INTERNAL FLAsh memory 1 byte Erase and Write issue

SITARAM
Associate II

I am using a stm32h743zi controller  i tray to erase one byte and write one byte BUT HERE PROBLEM SECTOR ERASE NOT A ONE BYTE ERASE  PLEASE SUGGESTED ME

FLASH_EraseInitTypeDef erase_init={
.TypeErase = FLASH_TYPEERASE_SECTORS ,
.Sector = FLASH_SECTOR_0,
.NbSectors = 1,
.Banks = FLASH_BANK_2,
.VoltageRange = FLASH_VOLTAGE_RANGE_3

};


 if (HAL_FLASHEx_Erase(&erase_init,sectorerror) != HAL_OK) {
// Handle erase error
while (1)
{
// Error handling
}
}
flash_address =0x8100000;
// FLASH_Erase_Sector(FLASH_SECTOR_0,FLASH_BANK2_BASE, FLASH_VOLTAGE_RANGE_3);

if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_FLASHWORD, flash_address, ((uint32_t)FlashWord)) == HAL_OK)
{
flash_address = flash_address + 1;
}

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

Welcome @SITARAM, to the community!

I highly recommend that you work through the basics of the structure and function of the flash in your STM32H743, which you can find in RM0433, section 4. This flash is not EEPROM, which can be erased byte by byte, but sectored memory. If you absolutely want to be able to erase byte by byte, you should either consider EEPROM emulation or better connect external EEPROM.

Regards
/Peter

In order 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.

View solution in original post

2 REPLIES 2
Peter BENSCH
ST Employee

Welcome @SITARAM, to the community!

I highly recommend that you work through the basics of the structure and function of the flash in your STM32H743, which you can find in RM0433, section 4. This flash is not EEPROM, which can be erased byte by byte, but sectored memory. If you absolutely want to be able to erase byte by byte, you should either consider EEPROM emulation or better connect external EEPROM.

Regards
/Peter

In order 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.

thank you sir