Removed references to pin fail area

This commit is contained in:
Jochen Hoenicke 2017-12-13 00:11:25 +01:00
parent 497021f2ef
commit 9f2bbb0e1a
4 changed files with 4 additions and 5 deletions

View File

@ -7,7 +7,7 @@
| Sector 0 | 0x08000000 - 0x08003FFF | 16 KiB | boardloader (1st stage) (write-protected)
| Sector 1 | 0x08004000 - 0x08007FFF | 16 KiB | boardloader (1st stage) (write-protected)
| Sector 2 | 0x08008000 - 0x0800BFFF | 16 KiB | boardloader (1st stage) (write-protected)
| Sector 3 | 0x0800C000 - 0x0800FFFF | 16 KiB | PIN counter area
| Sector 3 | 0x0800C000 - 0x0800FFFF | 16 KiB | unused
| Sector 4 | 0x08010000 - 0x0801FFFF | 64 KiB | storage area #1
| Sector 5 | 0x08020000 - 0x0803FFFF | 128 KiB | bootloader (2nd stage)
| Sector 6 | 0x08040000 - 0x0805FFFF | 128 KiB | firmware

View File

@ -86,6 +86,7 @@ static secbool copy_sdcard(void)
// erase all flash (except boardloader)
const uint8_t sectors[] = {
3,
FLASH_SECTOR_STORAGE_1,
FLASH_SECTOR_STORAGE_2,
FLASH_SECTOR_BOOTLOADER,
@ -106,7 +107,6 @@ static secbool copy_sdcard(void)
21,
22,
FLASH_SECTOR_FIRMWARE_EXTRA_END,
FLASH_SECTOR_PIN_AREA,
};
if (sectrue != flash_erase_sectors(sectors, sizeof(sectors), progress_callback)) {
display_printf(" failed\n");

View File

@ -371,7 +371,6 @@ int process_msg_FirmwareUpload(uint8_t iface_num, uint32_t msg_size, uint8_t *bu
FLASH_SECTOR_STORAGE_2,
};
ensure(flash_erase_sectors(sectors_storage, sizeof(sectors_storage), NULL), NULL);
ensure(flash_erase_sector(FLASH_SECTOR_PIN_AREA), NULL);
}
firstskip = IMAGE_HEADER_SIZE + vhdr.hdrlen;
@ -432,6 +431,7 @@ static void progress_wipe(int pos, int len)
int process_msg_WipeDevice(uint8_t iface_num, uint32_t msg_size, uint8_t *buf)
{
const uint8_t sectors[] = {
3,
FLASH_SECTOR_STORAGE_1,
FLASH_SECTOR_STORAGE_2,
FLASH_SECTOR_FIRMWARE_START,
@ -451,7 +451,6 @@ int process_msg_WipeDevice(uint8_t iface_num, uint32_t msg_size, uint8_t *buf)
21,
22,
FLASH_SECTOR_FIRMWARE_EXTRA_END,
FLASH_SECTOR_PIN_AREA,
};
if (sectrue != flash_erase_sectors(sectors, sizeof(sectors), progress_wipe)) {
MSG_SEND_INIT(Failure);

View File

@ -10,7 +10,7 @@
// 1
#define FLASH_SECTOR_BOARDLOADER_END 2
#define FLASH_SECTOR_PIN_AREA 3
// 3
#define FLASH_SECTOR_STORAGE_1 4