TestFlash.ino¶
Sketch path: examples/TestFlash/TestFlash.ino
Purpose¶
Interactive serial test console for operation-by-operation validation and isolation.
Full Command Map¶
getJEDECIDand ID byteswriteByte(addr, byte)readByte(addr)writeWord(addr, word)readWord(addr)writeStr(addr, inputString)readStr(addr, outputString)writeByteArray(addr, pageBuffer, SPI_PAGESIZE)(0..255pattern)readByteArray(addr, data_buffer, SPI_PAGESIZE)viaprintPage- full-chip dump via repeated
readByteArray eraseSector(addr)(4 KB)eraseBlock32K(addr)eraseBlock64K(addr)eraseChip()
Best Usage Pattern¶
- Run command
1first to verify comms. - Validate simple write/read (
2+3). - Move to string tests (
6+7). - Use erase commands (
11to14) only when needed.
Expected Output (Sample)¶
Boot:
Initialising..........
...
Please pick from the following commands...
1. getID
2. writeByte [address] [byte]
3. readByte [address]
...
14. Erase Chip
Command 1:
Function 1 : Get JEDEC ID
Manufacturer ID: efh
Memory Type: 40h
Capacity: 17h
JEDEC ID: ef4017h
Command 2 then 3 on same address:
Function 2 : Write Byte
... has been written to address ...
Function 3 : Read Byte
The byte at address ... is: ...
Common Mistakes¶
- Serial monitor line-ending mode not matching sketch expectations
- testing advanced erase/full-dump before basic read/write passes
- using wrong address assumptions near capacity boundary