Perform a rescue boot

If the bootloader has been erased from the storage media (or written with an invalid image) and the target does not boot, you can boot the target from a different media.

Boot in USB debug mode

Requirements

  • Linux host computer.

  • Root/administrator permissions on your host computer.

For the ConnectCore MP25 Development Kit:

  • A USB type-C cable for the console.

  • A USB type-C cable for recovery.

Instructions

  1. Download the TF-A binary image file suitable to boot from USB (tf-a-ccmp25-dvk-usb.stm32) from https://ftp1.digi.com/support/digiembeddedyocto/5.0/r3/images/ccmp25-dvk/wayland/.

  2. Download the FIP DDR firmware binary image file (fip-ccmp25-dvk-ddr-optee-emmc.bin) from https://ftp1.digi.com/support/digiembeddedyocto/5.0/r3/images/ccmp25-dvk/wayland/.

  3. Download the FIP binary image file (fip-ccmp25-dvk-optee-emmc.bin) from https://ftp1.digi.com/support/digiembeddedyocto/5.0/r3/images/ccmp25-dvk/wayland/.

  4. Install the dfu-util software tool on your host computer:

    $ sudo apt-get install dfu-util
  5. Connect a USB type-C cable to your host computer and the other end to the target CONSOLE connector.

  6. Connect a USB type-C cable to your host computer and the other end to the target USB recovery connector (USBC on the ConnectCore MP25 Development Kit).

  7. Change the boot mode configuration to boot from USB. To do so, set the boot mode micro-switches as follows:

    ON
    1 2 3 4
  8. Open a serial terminal at 115200/8/n/1.

  9. Power up the board.

  10. On the host computer, run the dfu-util tool with the TF-A and FIP files as follows:

    $ dfu-util -a 0 -D tf-a-ccmp25-dvk-usb.stm32
    $ dfu-util -a 0 -e
    $ sleep 1
    $ dfu-util -a 0 -D fip-ccmp25-dvk-ddr-optee-emmc.bin
    $ dfu-util -a 0 -e
    $ sleep 1
    $ dfu-util -a 1 -D fip-ccmp25-dvk-optee-emmc.bin
    $ dfu-util -a 0 -e

    The serial terminal shows the device starting U-Boot.

    When booting in USB recovery mode, U-Boot runs the command in variable bootcmd_mfg, which runs fastboot command by default, to await commands from the USB port. Press Ctrl+C to get the U-Boot prompt.
  11. Once you have booted U-Boot, you can proceed to re-program U-Boot into the eMMC. See Reprogram bootloader in the eMMC.

Reprogram bootloader in the eMMC

Once U-Boot is running, you can use it to update the TF-A and FIP images in the eMMC:

  1. Download the TF-A binary image file suitable to boot from eMMC (tf-a-ccmp25-dvk-optee-emmc.stm32) from https://ftp1.digi.com/support/digiembeddedyocto/5.0/r3/images/ccmp25-dvk/wayland/.

  2. Download the FIP binary image file suitable to boot from eMMC (fip-ccmp25-dvk-optee-emmc.bin) from https://ftp1.digi.com/support/digiembeddedyocto/5.0/r3/images/ccmp25-dvk/wayland/.

  3. Download the Metadata binary image file (metadata-ccmp25-dvk.bin) from https://ftp1.digi.com/support/digiembeddedyocto/5.0/r3/images/ccmp25-dvk/wayland/.

  4. Reset the environment to default values:

    => env default -a
  5. Reset to the default partition table into the eMMC:

    => run partition_mmc_linux
  6. Save the environment with saveenv.

  7. Use one of the following methods to update the files to the eMMC:

Re-program bootloader from USB OTG using Fastboot

To update U-Boot via USB OTG using uuu and the Fastboot protocol:

  1. Connect a USB type-C cable to your host computer and the other end to the target USB recovery connector (USBC on the ConnectCore MP25 Development Kit).

  2. Then, on the target, run the fastboot command from the U-Boot console, selecting the USB interface you want it to listen to:

    => fastboot 0
  3. On the host, run the following fastboot commands through the uuu tool (as root):

    $ uuu FB: flash boot1 tf-a-ccmp25-dvk-optee-emmc.stm32
    $ uuu FB: flash boot2 tf-a-ccmp25-dvk-optee-emmc.stm32
    $ uuu FB: flash metadata1 metadata-ccmp25-dvk.bin
    $ uuu FB: flash metadata2 metadata-ccmp25-dvk.bin
    $ uuu FB: flash fip-a fip-ccmp25-dvk-optee-emmc.bin
    $ uuu FB: flash fip-b fip-ccmp25-dvk-optee-emmc.bin
  4. Change the boot mode configuration to boot from the internal eMMC.

    To do so, set the boot mode micro-switches as follows:

    ON
    1 2 3 4
  5. Power-cycle the board. The target now boots from the eMMC.

For additional commands and information, see the NXP UUU manual.

Re-program bootloader from Ethernet (TFTP)

  1. Place the TF-A and FIP binaries inside your host computer TFTP exported folder.

  2. On the target, configure your network settings (IP of the device, IP of the host/server):

    => setenv ipaddr <your-ip>
    => setenv serverip <server-ip>
  3. Connect an Ethernet cable to the Ethernet port.

  4. Run the following commands to update TF-A and FIP images into the eMMC:

    => update boot1 tftp tf-a-ccmp25-dvk-optee-emmc.stm32
    => update boot2 tftp tf-a-ccmp25-dvk-optee-emmc.stm32
    => update metadata1 tftp metadata-ccmp25-dvk.bin
    => update metadata2 tftp metadata-ccmp25-dvk.bin
    => update fip-a tftp fip-ccmp25-dvk-optee-emmc.bin
    => update fip-b tftp fip-ccmp25-dvk-optee-emmc.bin
  5. Change the boot mode configuration to boot from the internal eMMC.

    To do so, set the boot mode micro-switches as follows:

    ON
    1 2 3 4
  6. Power-cycle the board. The target now boots from the eMMC.

Re-program bootloader from microSD card

  1. Place the TF-A and FIP binaries inside a FAT-formatted microSD card.

  2. Insert the microSD card in the board.

  3. Run the following commands to update TF-A and FIP images into the eMMC:

    => update boot1 mmc 1 tf-a-ccmp25-dvk-optee-emmc.stm32
    => update boot2 mmc 1 tf-a-ccmp25-dvk-optee-emmc.stm32
    => update metadata1 mmc 1 metadata-ccmp25-dvk.bin
    => update metadata2 mmc 1 metadata-ccmp25-dvk.bin
    => update fip-a mmc 1 fip-ccmp25-dvk-optee-emmc.bin
    => update fip-b mmc 1 fip-ccmp25-dvk-optee-emmc.bin
  4. Change the boot mode configuration to boot from the internal eMMC.

    To do so, set the boot mode micro-switches as follows:

    ON
    1 2 3 4
  5. Power-cycle the board. The target now boots from the eMMC.

Re-program bootloader from a USB mass storage

  1. Place the TF-A and FIP binaries inside a FAT-formatted USB mass storage.

  2. Insert the USB storage in the board.

  3. Start the USB:

    => usb start
  4. Run the following commands to update TF-A and FIP images into the eMMC:

    => update boot1 usb 0 tf-a-ccmp25-dvk-optee-emmc.stm32
    => update boot2 usb 0 tf-a-ccmp25-dvk-optee-emmc.stm32
    => update metadata1 usb 0 metadata-ccmp25-dvk.bin
    => update metadata2 usb 0 metadata-ccmp25-dvk.bin
    => update fip-a usb 0 fip-ccmp25-dvk-optee-emmc.bin
    => update fip-b usb 0 fip-ccmp25-dvk-optee-emmc.bin
  5. Change the boot mode configuration to boot from the internal eMMC.

    To do so, set the boot mode micro-switches as follows:

    ON
    1 2 3 4
  6. Power-cycle the board. The target now boots from the eMMC.