v2.2.1:Using ngultra_flash_programmer.py

Erase flash

Erase full flash (slow)

ngultra_flash_programmer.py -e -f <flash_nr>

ngultra_flash_programmer.py -e -f 2

Erase flash (256KB) sectors

ngultra_flash_programmer.py –fast_erase -f <flash_nr> –erase_size<sector_count>

ngultra_flash_programmer.py --fast_erase -f 2 --erase_size 3

Write data to flash to a specific address

Warning: address should be a multiple of 256 ngultra_flash_programmer.py -w <your_input_file> -f <flash_nr> -a <address>

dd if=/dev/urandom of=random.bin bs=256 count=1
ngultra_flash_programmer.py -w random.bin -f 2 -a 512

Dump data from flash from a specific address for a specific size

Warning: address should be a multiple of 256 Warning: size is expressed in count of block 256 bytes (ex: 1 to read 256 bytes) ngultra_flash_programmer.py -d <your_output_file> -f <flash_nr> -a <address> -s <size>

ngultra_flash_programmer.py -d dump.bin -f 2 -a 512 -s 1

You can check that the md5sum of the 2 files are the same.

Write a BL1 into flash

Warning: This will erase the first 256KB of the flash Warning: address is fixed to 0 Warning: file will be signed by the script, use the unsigned file Warning: This will perform a Power On Reset on the board ngultra_flash_programmer.py –bl1 <your_bl1> -f <flash_nr> -k <key>

ngultra_flash_programmer.py --bl1 flash_programmer.bin -k keytest.der -f 2

Using fast commands

Fast commands are special commands used to speed up tranfer between the flash and the PC. For this, it uses a special binary that will be loaded into the TCM_A of the CPU.

Write data to flash to a specific address using fast_write

Warning: address should be a multiple of 256 ngultra_flash_programmer.py –fast_write <your_input_file> -f <flash_nr> -a <address>

dd if=/dev/urandom of=random.bin bs=256 count=1
ngultra_flash_programmer.py --fast_write random.bin -f 2 -a 512

Tips: -q is a shortcut for fast_write

Dump data from flash from a specific address for a specific size using fast_read

Warning: address should be a multiple of 256 Warning: size is expressed in count of block 256 bytes (ex: 1 to read 256 bytes) ngultra_flash_programmer.py –fast_read <your_output_file> -f <flash_nr> -a <address> -s <size>

ngultra_flash_programmer.py --fast_read dump.bin -f 2 -a 512 -s 1

Tips: -r is a shortcut for fast_read

© NanoXplore 2022