External SPI Flash Commands#

Simplicity Commander supports reading, writing, and erasing data on an external SPI flash on a limited selection of boards and devices. The following configurations are currently supported:

  • The integrated SPI flash on EFR32MG1x632 and EFR32MG1x732 devices

  • The MX25 SPI flash on EFR32 radio boards

Erase External SPI Flash Command#

Use this command to erase data on an external flash. By default, the erased range is read back to verify that it was actually erased. This blank check can be disabled by including the --noverify option.

The extflash erase command always erases complete sectors. Any sector overlapping with the range provided will be erased. All currently supported flash devices have a sector size of 4096 bytes. For example, erasing with option --range 0xE00:0x1100 will effectively erase the first two sectors (equivalent to --range 0x0:0x2000).

Command Line Syntax

$ commander extflash erase --range <range expression> [--noverify]

Command Line Input Example

$ commander extflash erase --range 0x1000:0x3000

Command Line Output Example

Erasing 8192 bytes from 0x00001000 on external flash.
Resetting target...
Uploading flashloader...
Erasing external flash...
Verifying written data...
Waiting for flashloader to become ready...
Reading from external flash...
DONE

Read External SPI Flash Command#

Use this command to read from external flash.

Command Line Syntax

$ commander extflash read --range <range expression>

Command Line Input Example

$ commander extflash read --range 0x0:+0x20

Command Line Output Example

Reading 32 bytes from 0x00002000 on external flash.
Resetting target...
Uploading flashloader...
Waiting for flashloader to become ready...
Reading from external flash...
{address:  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F}
00002000: 48 65 6C 6C 6F 20 57 6F 72 6C 64 21 0A FF FF FF
00002010: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
DONE

Write External SPI Flash Command#

Use this command to write to external flash.

Any existing content in the affected flash sectors will be erased before writing.

In contrast to the flash command for internal flash, the extflash write command always flashes the raw content of the given file. If the address option is given the value is interpreted as a hexadecimal number. If, for example, an S-record file is provided, the ASCII content of the file is written; the S-record format is not parsed and written to the addresses specified in the file.

Command Line Syntax

$ commander extflash write <filename> --address <start address>

Command Line Input Example

$ commander extflash write myfile.txt --address 0x2000

Command Line Output Example

Flashing 13 bytes to 0x00002000 on external flash.
Resetting target...
Uploading flashloader...
Waiting for flashloader to become ready...
Erasing external flash...
Writing to external flash...
Verifying written data...
Waiting for flashloader to become ready...
Reading from external flash...
DONE