Description
As I pointed out in picotool pull request #66, erasing flash one 4096-byte sector at a time is a waste of time, since the flash chips generally support other commands that erase a larger amount of flash and have a smaller time per byte. For the RP2040, I was able to work around this by using the "exec" command to upload some assembly that accessed the "Flash Range Erase" command in the ROM table, as shown in that pull request. This sped up loading by 50%, saving 1.4 seconds when loading a MicroPython image onto the chip. For the RP2350 family, "exec" has been removed, so as far as I know, we are stuck erasing flash the slow way.
In future chip revisions, it would be nice to have a new USB command for accessing the s_varm_api_flash_range_erase
function that is already included in the bootloader, since that function is capable of using different, more efficient erase commands.
Activity