diff --git a/flash/nuke/nuke.c b/flash/nuke/nuke.c index 521f5d74f..5a3156b16 100644 --- a/flash/nuke/nuke.c +++ b/flash/nuke/nuke.c @@ -27,12 +27,11 @@ int main() { uint flash_size_bytes; -#ifndef PICO_FLASH_SIZE_BYTES -#warning PICO_FLASH_SIZE_BYTES not set, assuming 16M - flash_size_bytes = 16 * 1024 * 1024; -#else - flash_size_bytes = PICO_FLASH_SIZE_BYTES; -#endif + uint8_t txbuf[4]; + uint8_t rxbuf[4]; + txbuf[0] = 0x9f; + flash_do_cmd(txbuf, rxbuf, 4); + flash_size_bytes = 1u << rxbuf[3]; flash_range_erase(0, flash_size_bytes); // Leave an eyecatcher pattern in the first page of flash so picotool can // more easily check the size: