mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Erase flash before writing upload image
This commit is contained in:
1 parent
09d90d6d97
commit
9714818b1f
2 files changed
+6
No files matched your search
@@ -332,6 +332,10 @@ uint8_t stream_upload(uint16_t bptr)
|
||||
if (write_len >= FLASHMEM_PAGE_SIZE) {
|
||||
dbg_string("len: "); dbg_short(write_len); dbg_char(' ');
|
||||
dbg_string("CRC16: "); dbg_short(crc_value); dbg_char('\n');
|
||||
if (uptr % FLASH_SECTOR_SIZE == 0) {
|
||||
flash_region.addr = uptr;
|
||||
flash_sector_erase();
|
||||
}
|
||||
flash_region.addr = uptr;
|
||||
flash_region.len = FLASHMEM_PAGE_SIZE;
|
||||
flash_write_bytes(flash_buf);
|
||||
|
||||
Reference in new issue
Block a user