Can you tell me how to set the unit and chipselect in the luascript to flash files in different flash types?
Please use the flasher command line option info to get the desired information. Example for netX 90 is shown below.
enter inside a windows command line:
> lua5.1.exe cli_flash.lua info
enter number of the connected interface to the netX 90
look for the following information inside the output of the flasher
Board info:
Bus 1: Serial Flash
Unit 0: SQI
Unit 1: SPI0_APP
Unit 2: SPI1_APP
Unit 3: SPI2_APPBus 2: Internal Flash
Unit 0: IFLASH0
Unit 1: IFLASH1
Unit 2: IFLASH2
Unit 3: IFLASH01
use this information for the parameter -b and -u
use for the internal flash always -cs 0.
The final netX 90 version will not have any support to program other pages of the internal flash than the main flash. This is cs 0.
A file can be written in "flash" mode. The offset in flash is 0 by default, which corresponds to the beginning of the memory area. This can be changed with the option "-s".
Flash the file "firmware.bin" into memory on bus 1, unit 0, chip select 0 and offset 0:
- lua5.1.exe cli_flash.lua flash -b 1 -u 0 -cs 0 firmware.bin
- lua5.1.exe cli_flash.lua flash -b 1 -u 0 -cs 0 -s 0x1000 firmware.bin
Write to internal flash:
parameter cs is always 0 for netX 90 to address the internal flash memory
COM area: at offset 0x3000
- lua5.1.exe cli_flash.lua flash -b 2 -u 3 -cs 0 -s 0x3000 firmware_com.bin
APP range: at offset 0x0000
- lua5.1.exe cli_flash.lua flash -b 2 -u 2 -cs 0 -s 0x0000 firmware_app.bin