IMX Serial Download Protocol (SDP)
The iMX processors internal boot ROM handles the first boot stage in order to be able to boot from a variety of devices (uSD, NAND, NOR, SPI, SATA, etc). One of the boot devices, referred to as the 'Serial Downloader Protocol' provides an API over USB OTG. Therefore an application can reside on a host PC that will can control the boot of the iMX as long as you can get the iMX to boot in this mode (referred to as 'BOOT_MODE0'). During the internal ROM's boot, a watchdog is used such that a corrupt or non-existent boot media will result in attempting to boot via SDP. This may be useful if you are working with a board that has an unprogrammed or misprogrammed FLASH device which also has access to USB OTG.
Booting Venice U-Boot over SDP with uuu
NXP provides 'uuu' (Universal Update Utility) which is an evolution of the old Freescale MFGtools. The most important update is that it is supported under Linux instead of Windows only.
For i.MX SoC's we use a 2-stage boot firmware comprised of the Secondary Program Loader (SPL) (provided by U-Boot) as well as U-Boot proper. Each stage is loaded separately as seen below in the examples. While no special code support is needed for the SPL boot over SDP, in order for the SPL to implement SDP to boot to U-Boot proper you need to have the following enabled in U-Boot:
- CONFIG_SPL_USB_HOST_SUPPORT=y
- CONFIG_SPL_USB_GADGET=y
- CONFIG_SPL_USB_SDP_SUPPORT=y
- CONFIG_CMD_USB_SDP=y (only if you want the 'sdp' command in U-Boot'
Linux Install:
wget https://github.com/NXPmicro/mfgtools/releases/download/uuu_1.4.69/uuu chmod +x uuu sudo mv uuu /usr/local/bin
Examples: First, activate SDP in the bootloader on the Gateworks SBC:
- Invoke SDP while in U-Boot on the Gateworks SBC:
u-boot=> sdp 0 SDP: initialize... SDP: handle requests...
- List SDP devices on the USB bus on the Linux host PC (desktop/laptop):
$ uuu -lsusb # list compatible devices on the USB bus in SDP mode uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.69-0-g63b1d3c Connected Known USB Devices Path Chip Pro Vid Pid BcdVersion ================================================== 3:2 MX8MM SDP: 0x1FC9 0x0134 0x0101
- Boot Venice U-Boot over SDP (using flash.bin and u-boot.itb):
- Linux host:
$ sudo uuu flash.bin && sudo uuu SDPV: write -f u-boot.itb -addr 0x42000000 && sudo uuu SDPV: jump -addr 0x42000000 uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.139-0-g1a8f760 Success 1 Failure 0 2:13 2/ 2 [Done ] SDP: done uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.139-0-g1a8f760 Success 0 Failure 0 2:13 1/ 1 [=================100%=================] SDPV: write -f u-boot.itb Okay uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.139-0-g1a8f760 Success 0 Failure 0 2:13 1/ 1 [=================100%=================] SDPV: jump -addr 0x420000 Okay
- Target
U-Boot SPL 2021.07-00066-g7cc5a04f34ab (Dec 06 2021 - 14:56:21 -0800) GSC : v61 0x1d6f RST:VIN Thermal Protection Disabled Model : GW7211-00-CB Serial : 852420 MFGDate : 11-19-2021 RTC : 1 PMIC : MP5416 DRAM : LPDDR4 1 GiB WDT: Started with servicing (60s timeout) Trying to boot from USB SDP SDP: initialize... SDP: handle requests... Downloading file of size 968812 to 0x42000000... done Jumping to header at 0x42000000 Header Tag is not an IMX image Found header at 0x42000000 DTB : imx8mm-venice-gw72xx-0x NOTICE: BL31: v2.4(release):f884ad7b0ba2 NOTICE: BL31: Built : 13:06:09, Oct 20 2021 U-Boot 2021.07-00066-g7cc5a04f34ab (Dec 06 2021 - 14:56:21 -0800) CPU: Freescale i.MX8MMQ rev1.0 1600 MHz (running at 1200 MHz) CPU: Industrial temperature grade (-40C to 105C) at 31C Reset cause: POR Model: Gateworks Venice GW72xx-0x i.MX8MM Development Kit DRAM: 1 GiB temp : 23.6C vdd_bat : 0.000V vdd_vin : 16.932V vdd_adc1: 0.000V vdd_adc2: 0.000V vdd_dram: 1.097V vdd_1p2 : 1.192V vdd_1p0 : 0.982V vdd_2p5 : 2.470V vdd_3p3 : 3.254V vdd_0p95: 0.949V vdd_1p8 : 1.801V vdd_gsc : 2.942V WDT: Started with servicing (60s timeout) MMC: FSL_SDHC: 1, FSL_SDHC: 2 Loading Environment from MMC... MMC Device 0 not found *** Warning - No MMC card found, using default environment In: serial Out: serial Err: serial Net: DP83867 eth0: ethernet@30be0000 [PRIME] GSC : boot watchdog disabled Hit any key to stop autoboot: 0 u-boot=>
- Linux host:
Note in order to force booting from SDP you must erase the eMMC SPL code (ie 'mmc dev 2 && mmc erase 0 8000) as the default boot cfg fuses are set to boot from eMMC.