LX2160ARDB – How to update composite firmware in FlexSPI NOR Flash and SD/eMMC card using an SD card

cancel
Showing results for 
Search instead for 
Did you mean: 

LX2160ARDB – How to update composite firmware in FlexSPI NOR Flash and SD/eMMC card using an SD card

LX2160ARDB – How to update composite firmware in FlexSPI NOR Flash and SD/eMMC card using an SD card

 

The below steps are used to update composite firmware image in FlexSPI NOR flash and SD/eMMC card using an SD card.

  1. Load composite firmware image on SD card
    • Option 1: Using HxD editor on Windows system
    • Option 2: Using Linux system
  2. Program updated composite firmware in SD card
  3. Program updated composite firmware in FlexSPI NOR flash (DEV#0 and DEV#1)
  4. Program updated composite firmware in eMMC 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.

Step 1: Load composite firmware image in SD card

Option 1: Using HxD editor on Windows system

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/.

  1. Download composite firmware image on Windows machine using the following links:
  2. Format SD card.
  3. Open HxD editor and run as administrator.
  4. Open firmware_lx2160ardb_rev2_uboot_sdboot.img binary file in HxD editor.
  5. Copy the binary file (CTRL + A and CTRL + C).
  6. Plug the SD card either directly into the slot available on your Windows machine or using a memory card adapter/reader.
  7. Open disk (SHIFT + CTRL +D).

    Open diskOpen disk NOTE: Uncheck the 'Open as Readonly' option while opening the disk.

  8. Go to SD block (or sector) 8 (0x1000).

    HxD Editor - Sector 8HxD Editor - Sector 8

  9. Paste the copied binary image content (CTRL + B). Make sure to copy the image at SD block no. 8.
  10. Save the content.
  11. Repeat above steps to load firmware_lx2160ardb_rev2_uboot_xspiboot.img and firmware_lx2160ardb_rev2_uboot_emmcboot.img binary image in SD card.

    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.

  12. Eject the SD card.

Option 2: Using Linux system

  1. Download composite firmware image on Linux machine using the following links:
  2. Format SD card (optional, required if the card already has some data so to ensure that images have been loaded to card without conflicting with the existing data).

  3. Load composite firmware image to SD card.
    • For SD boot: dd if= firmware_lx2160ardb_rev2_uboot_sdboot.img of=/dev/sdb bs=512 seek=8
    • For FlexSPI boot: dd if= firmware_lx2160ardb_ rev2_uboot_xspiboot.img of=/dev/sdb bs=512 seek=150500
    • For eMMC boot: dd if= firmware_lx2160ardb_ rev2_uboot_emmcboot.img of=/dev/sdb bs=512 seek=300500
  4. Eject the SD card.

Step 2: Program updated composite firmware in SD card

NOTE: Since the updated composite firmware is now available at required block (SD start block no. in SD card, therefore, you can boot the board using SD card using following steps.

  1. Insert the SD card in SD slot of LX2160ARDB.
  2. Set switch settings to boot from SD card : SW1[1:4] = 1000 
  3. Restart the board.

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

Step 3: Program updated composite firmware in FlexSPI NOR flash (DEV#0 and DEV#1)

  1. Insert the SD card in SD slot of LX2160ARDB.
  2. Set switch settings to boot from SD card=> SW1[1:4] = 1000
  3. Restart the board and stop at U-Boot prompt.
  4. Load firmware_lx2160ardb_rev2_uboot_xspiboot.img at 0xa0000000 (DDR address) using the following command:

    => mmc read 0xa0000000 <start_block_number> <block_count>

    where, <start_block_number> - start block number in SD card where you have loaded the firmware.

    <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 150500 18DF9

  5. Program default FlexSPI NOR flash:

    =>sf probe 0:0

    =>sf update 0xa0000000 0x0 <firmware_lx2160ardb_rev2_uboot_xspiboot.img _filesize_in_hex>

    For example: => sf update 0xa0000000 0x0 31BDEAC   

  6. Program alternate FlexSPI NOR flash:

    => sf probe 0:1

    => sf update 0xa0000000 0x0 <firmware_lx2160ardb_rev2_uboot_xspiboot.img _filesize_in_hex> 

  7. Restart the board to boot from FlexSPI NOR flash 0 (DEV#0).
    • Switch settings to boot from DEV#0: SW1[1:8] = 1111 1000
    • 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

  8. Restart the board to boot from FlexSPI NOR flash 1 (DEV#1) as well.
    • Switch settings to boot from DEV#1
      • SW1[1:4] = 1111 1001 

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

Step 4: Program updated composite firmware in eMMC card

  1. Insert the SD card in SD slot of LX2160ARDB.
  2. Set switch settings to boot from SD card: SW1[1:4] = 1000
  3. Restart the board and stop at U-Boot prompt.
  4. Load firmware_lx2160ardb_rev2_uboot_emmcboot.img at 0xa0000000 (DDR address) using the following command:

    => 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.

    <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 300500 18DF9

  5. Program eMMC card.

    => mmc dev 1; mmc write 0xa0000000 8 18DF9

  6. Restart the board to boot from eMMC.

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

Version history
Revision #:
8 of 8
Last update:
‎10-22-2020 12:12 AM
Updated by:
 
Contributors