-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flash erase command can't suport STM32H7 #26
Comments
For STM32H7 I have changed the erase flash with the following , notive that I keep one full sector in bank 1 for the bootloader /* Erase flash ---------------------------------------------------------------*/
uint8_t btld_EraseFlash(void) {
uint32_t SectorError = 0;
FLASH_EraseInitTypeDef pEraseInit;
HAL_StatusTypeDef status = HAL_OK;
HAL_FLASH_Unlock();
if (status == HAL_OK) {
// Bank 0
pEraseInit.Banks = FLASH_BANK_1;
pEraseInit.Sector = 1;
pEraseInit.NbSectors = 7;
pEraseInit.TypeErase = FLASH_TYPEERASE_SECTORS;
pEraseInit.VoltageRange = FLASH_VOLTAGE_RANGE_3;
status = HAL_FLASHEx_Erase(&pEraseInit, &SectorError);
// Bank1
pEraseInit.Banks = FLASH_BANK_2;
pEraseInit.Sector = 0;
pEraseInit.NbSectors = 8;
pEraseInit.TypeErase = FLASH_TYPEERASE_SECTORS;
pEraseInit.VoltageRange = FLASH_VOLTAGE_RANGE_3;
status = HAL_FLASHEx_Erase(&pEraseInit, &SectorError);
}
HAL_FLASH_Lock();
return (status == HAL_OK) ? BL_OK : BL_ERASE_ERROR;
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As title,when I use flash erase command on STM32H745, it deosn't work as all
The text was updated successfully, but these errors were encountered: