flashprog [OPTION]... flashprog [OPTION]
All the options are their related parameters are listed in below section.
-i, --information
List down flash memory device identifiers. In this option FlashProg issue RDID (0x9F) instruction to the flash memory device and get manufacturer ID, memory type and memory dencity data from chip.
-r, --read
Read specified address range from flash memory and write received data to file. This option need additional parameters as listed in below:
-r start-address length filename
Start-address represent starting address to perform read operation. Length parameter indicate number of bytes to read and it must be higher value than 0. For read command all the above 3 parameters are mandatory.
This option read flash memory using READ (0x03) instruction.
-e, --erase
This option erase entire flash memory using CE (0xC7) instruction.
-s, --sector-erase
Erase sector of flash memory using SE (0x20) instruction. This option need additional parameters as listed in below:
-s address
For this option address is any address within the target sector. Refer flash memory datasheet to get the valid address ranges for each sector.
-b, --block-erase
Erase block of flash memory using BE (0xD8) instruction. This option need additonal parameters as listed in below:
-b address
For this option address is any address within the target block. Refer flash memory datasheet to get the valid address ranges for each memory block.
-w, --write
Write binary file to flash memory using page program – PP (0x02) instruction. This option need additional parameters as listed in below:
-w filename
This option start writing data of the given file from address 0x00 up-to end of file.
-g, --set-status
Set status register value of flash memory device. Use this option to set SRWD (Status Register Write Protected) and BP0-BP2 (Block protection) bits of flash memory status register. This option need additional parameters as listed in below:
-g status-register-value
status-register-value is 8 bit integer with following format:
bit 7 | bit 6 | bit 5 | bit 4 | bit 3 | bit 2 | bit 1 | bit 0 |
---|---|---|---|---|---|---|---|
SRWD | x | x | BP2 | BP1 | BP0 | x | x |
For example to set the SRWD use following command:
flashprog -g 128
To clear the SRWD bit use following command:
flashprog -g 0
To get more detailed information about status register refer flash memory datasheet.
-u, --get-status
Use this option to print the following status register bit values:
This option read status register using RDSR(0x05) instruction.
-v, --version
Show version information.
-h, --help
Display help.