How to program custom firmware from microSD SD MMC card

Pre programmed U-Boot on i.MX modules offers Ethernet = tftp, USB (memory stick), maybe slow serial upload, or µSD/SD/MMC card to program your customer U-Boot and operating system firmware into the flash.
Unfortunately the pre programmed U-Boot was not always compiled with USB support and the USB support does not work very well with many USB sticks showing: EHCI timed out on TD - token=0x248d80

If your board does not have Ethernet or setting up Ethernet/TFTP during in your production setup is not possible, you may use µSD/SD/MMC card to program your custom firmware images into the flash. Below explains the U-Boot commands to do this on a Digi JSK:

To use a µSD or SD card to program your custom Windows Embedded, Linux or Android firmware, please format the (micro)SD card on a PC as vfat = fat32.

On your development PC copy your custom U-Boot image u-boot-ccwmx53js.bin and your custom Windows Embedded firmware image wce-CCXMX53 or Linux/Android kernel image uImage-ccwmx53js as well as root file system images to the (micro)SD card. Savely eject the (micro)SD card to ensure everything was written.

Insert the (mirco)SD card to your i.MX53 board, boot pre programmed U-Boot from flash and stop autoboot procedure. From the U-Boot prompt first update to your custom U-Boot (to have maybe any custom partition or environment settings enabled):


U-Boot 2009.08 - DUB-1.4.0.3 - (Jul 12 2012 - 13:40:22) - GCC 4.4.6
for ConnectCore Wi-i.MX53 on a JumpStart Kit Development Board

I2C:   ready
NAND:  512 MiB
MMC:   FSL_ESDHC: 0, FSL_ESDHC: 1
DRAM:  512 MB
In:    serial
Out:   serial
Err:   serial
Net:   FEC0 [PRIME]
Hit any key to stop autoboot:  0

CCWMX53 # update uboot mmc 0:1 fat

If you are using the SD card (on Digi JSK mmc device 0), just substitute mmc 0:1  by mmc 1:1 if you prefer to use the microSD card slot.

Now reset/reboot the module to get your custom U-Boot running / booting from flash:
CCWMX53 # reboot

Again interrupt autoboot process of your own U-Boot now booted from flash and create partitions for WindowsEmbedded, Linux or Android respectively:

CCWMX53 # flpart
Nr | Name   |  Start     | Size       | Type                 | FS    | Flags
----------------------------------------------------------------------------
 0 | U-Boot |          0 |      1 MiB | U-Boot               |       | fixed
 1 | NVRAM  |      1 MiB |    512 KiB | NVRAM                |       | fixed
 2 | Kernel |   1536 KiB |      3 MiB | Linux/Android-Kernel |       |
 3 | RootFS |   4608 KiB |    120 MiB | Filesystem           | JFFS2 | rootfs
 4 | UserFS | 127488 KiB | 396800 KiB | Filesystem           | JFFS2 |
Commands:
   a) Append partition
   d) Delete partition
   m) Modify partition
   p) Print partition table
   r) Reset partition table
   q) Quit
Cmd (? for help)> r
  OS Types:
   n) None
   l) Linux
   a) Android
   w) WinCE
   o) NET+OS
OS (? for help)> w
Partition table reset
Nr | Name    |  Start     | Size       | Type         | FS    | Flags
---------------------------------------------------------------------
 0 | U-Boot  |          0 |      1 MiB | U-Boot       |       | fixed
 1 | NVRAM   |      1 MiB |    512 KiB | NVRAM        |       | fixed
 2 | Kernel  |   1536 KiB |     40 MiB | WinCE-Kernel |       |
 3 | Filesys |  42496 KiB | 481792 KiB | Filesystem   | ExFAT |
Cmd (? for help)> q
Partition table has been modified. Save? (y): y
Writing Parameters to NVRAM


On the U-Boot prompt update to your Windows Embedded firmware image from SD card (on Digi JSK mmc device 0):

CCWMX53 # update wce mmc 0:1 fat
reading wce-CCXMX53
...........................................................................
34696940 bytes read
Calculated checksum = 0x2144df1c
Updating partition 'Kernel'
Erasing:   complete
Writing:   complete
Verifying: complete
Update successful
CCWMX53 #


and either program your initial custom filesystem images or erase the filesystem partition to start with an empty file system:

CCWMX53 # erase_pt Filesys
Erasing:   complete


Similar for Linux use update linux mmc ..  and update rootfs mmc ... to get your custom firmware programmed.

On U-Boot configure device to autoboot Windows Embedded:

# setenv bootcmd dboot wce flash;saveenv


or dboot linux flash or dboot android flash respectively

For more information use the U-Boot commands:
 help update mmc
 help mmc


OR Check the U-Boot reference manual from the below link 
https://www.digi.com/resources/documentation/digidocs/PDFs/90001129.pdf

Last updated: Oct 21, 2024

Filed Under

Embedded

Recently Viewed

No recently viewed articles

Did you find this article helpful?