1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-12 18:49:07 +00:00

bootloader: erase all sectors except first two

This commit is contained in:
Pavol Rusnak 2017-03-29 02:42:55 +02:00
parent 41af56222a
commit 2725792528
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -69,7 +69,7 @@ bool copy_sdcard(void)
EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3; // voltage range needs to be 2.7V to 3.6V
EraseInitStruct.NbSectors = 1;
uint32_t SectorError = 0;
for (int i = 3; i <= 11; i++) { // TODO: change start to 2
for (int i = 2; i < 12; i++) {
EraseInitStruct.Sector = i;
if (HAL_FLASHEx_Erase(&EraseInitStruct, &SectorError) != HAL_OK) {
HAL_FLASH_Lock();