The below steps are used to update composite firmware image in FlexSPI NOR flash and SD/eMMC card using an SD card.
NOTE: Examples shown below use the LX2160ARDB Rev 2 image names. The same examples are applicable for LX2160ARDB Rev 1 also by replacing the Rev 2 image name with the corresponding Rev 1 image name.
The below steps describe how to use an HxD editor on a Windows machine to program firmware image on SD card without partitioning the card.
NOTE: Use the following link to download the HxD editor for Windows: https://mh-nexus.de/en/hxd/.
NOTE: Uncheck the 'Open as Readonly' option while opening the disk.
For example: Load firmware_lx2160ardb_rev2_uboot_xspiboot.img image in SD card at block no. 150500 and firmware_lx2160ardb_rev2_uboot_emmcboot.img image in SD card at block no. 300500.
NOTE: Make sure that you load these images in SD blocks so that the images do not get overwrite.
NOTE: Since the updated composite firmware is now available at required block (SD start block no.
The board boots from updated composite firmware (SD boot) image loaded in the SD card. The U-Boot log displays:
Model: NXP Layerscape LX2160ARDB Board
Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from SD
=> mmc read 0xa0000000 <start_block_number> <block_count>
where, <start_block_number> - start block number in SD card where you have loaded the firmware. For example, if you have loaded firmware at SD card block 150500, start_block_number in hex is 24be4
<block_count> - number of blocks in SD card that needs to be read as per the file size. It is calculated as ‘file size /512’ + ‘few sectors for rounding up so that last block is not missed’. If firmware file size is 52158124 (31bdeac hex), block_count is 52158124/512 = 101871 (18DEF hex) + 10 (A hex) = 101881 (18DF9 hex).
For example: => mmc read 0xa0000000 24be4 18DF9
=>sf probe 0:0
=>sf update 0xa0000000 0x0 <firmware_lx2160ardb_rev2_uboot_xspiboot.img _filesize_in_hex>
For example: => sf update 0xa0000000 0x0 31BDEAC
=> sf probe 0:1
=> sf update 0xa0000000 0x0 <firmware_lx2160ardb_rev2_uboot_xspiboot.img _filesize_in_hex>
The U-Boot log shows the following message:
Model: NXP Layerscape LX2160ARDB Board
Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from FlexSPI DEV#0
The U-Boot log shows the following message:
Model: NXP Layerscape LX2160ARDB Board
Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from FlexSPI DEV#1
=> mmc dev 0; mmc read 0xa0000000 <start_block_number> <block_count>
where, <start_block_number> - start block number in SD card where you have loaded the firmware. For example, if you have loaded firmware at SD card block 300500, start_block_number in hex is 495D4
<block_count> - number of blocks in SD card that needs to be read as per the file size. It is calculated as ‘file size /512’ + ‘few sectors for rounding up so that last block is not missed’. If firmware file size is 52158124 (31bdeac hex), block_count is 52158124/512 = 101871 (18DEF hex) + 10 (A hex) = 101881 (18DF9 hex).
For example: => mmc read 0xa000000 495D4 18DF9
=> mmc dev 1; mmc write 0xa0000000 8 18DF9
Set switch settings to boot from eMMC card.
SW1[1:8] = 1001 1000
The U-Boot log shows the following message:
Model: NXP Layerscape LX2160ARDB Board
Board: LX2160ACE Rev2.0-RDB, Board version: B, boot from eMMC