Commit 6043ad0da6d77eccb26fbd0421a696aca2ca1c2e

Authored by Tim Gover
1 parent 210a1775

readme.md: Add a troubleshooting section

Showing 1 changed file with 43 additions and 2 deletions
Readme.md
@@ -20,9 +20,11 @@ For more information run `rpiboot -h`. @@ -20,9 +20,11 @@ For more information run `rpiboot -h`.
20 ## Building 20 ## Building
21 21
22 ### Linux / Cygwin / WSL 22 ### Linux / Cygwin / WSL
23 -Clone this repository on your Pi or other Linux machine. 23 +Clone this repository on your Pi or other Linux machine.
24 Make sure that the system date is set correctly, otherwise Git may produce an error. 24 Make sure that the system date is set correctly, otherwise Git may produce an error.
25 25
  26 +**This git repository uses symlinks. For Windows builds clone the repository under Cygwin**
  27 +
26 ``` 28 ```
27 sudo apt install git libusb-1.0-0-dev pkg-config 29 sudo apt install git libusb-1.0-0-dev pkg-config
28 git clone --depth=1 https://github.com/raspberrypi/usbboot 30 git clone --depth=1 https://github.com/raspberrypi/usbboot
@@ -85,6 +87,45 @@ initramfs. @@ -85,6 +87,45 @@ initramfs.
85 On Raspberry Pi 4 / CM4 the recommended approach is to use a `boot.img` which is a FAT disk image containing 87 On Raspberry Pi 4 / CM4 the recommended approach is to use a `boot.img` which is a FAT disk image containing
86 the minimal set of files required from the boot partition. 88 the minimal set of files required from the boot partition.
87 89
  90 +## Troubleshooting
  91 +
  92 +This section describes how to diagnose common `rpiboot` failures for Compute Modules. Whilst `rpiboot` is tested on every Compute Module during manufacture the system relies on multiple hardware and software elements. The aim of this guide is to make it easier to identify which component is failing.
  93 +
  94 +### Hardware
  95 +* Inspect the Compute Module pins and connector for signs of damage and verify that the socket is free from debris.
  96 +* Check that the Compute Module is fully inserted.
  97 +* Check that `nRPIBOOT` / EMMC disable is pulled low BEFORE powering on the device.
  98 +* Remove any hubs between the Compute Module and the host.
  99 +* Disconnect all other peripherals from the IO board.
  100 +* Verify that the red power LED switches on when the IO board is powered.
  101 +* Use another computer to verify that the USB cable for `rpiboot` can reliably transfer data. For example, connect it to a Raspberry Pi keyboard with other devices connected to the keyboard USB hub.
  102 +
  103 +#### Hardware - CM4
  104 +* The CM4 EEPROM supports MMC, USB-MSD, USB 2.0, Network and NVMe boot by default. Try booting to Linux from an alternate boot mode (e.g. network) to verify the `nRPIBOOT` GPIO can be pulled low and that the USB 2.0 interface is working.
  105 +* If `rpiboot` is running but the mass storage device does not appear then try running the `rpiboot -d mass-storage-gadget` because this uses Linux instead of a custom VPU firmware to implement the mass-storage gadget. This also provides a login console on UART and HDMI.
  106 +
  107 +### Software
  108 +The recommended host setup is Raspberry Pi with Raspberry Pi OS. Alternatively, most Linux X86 builds are also suitable. Windows adds some extra complexity for the USB drivers so we recommend debugging on Linux first.
  109 +
  110 +* Update to the latest software release using `apt update rpiboot` or download and rebuild this repository from Github.
  111 +* Run `rpiboot -v | tee log` to capture verbose log output. N.B. This can be very verbose on some systems.
  112 +
  113 +#### Boot flow
  114 +The `rpiboot` system runs in multiple stages. The ROM, bootcode.bin, the VPU firmware (start.elf) and for the `mass-storage-gadget` or `rpi-imager` a Linux initramfs. Each stage disconnects the USB device and presents a different USB descriptor. Each stage will appears as a new USB device connect in the `dmesg` log.
  115 +
  116 +See also: [Raspberry Pi4 Boot Flow](https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-4-boot-flow)
  117 +
  118 +#### bootcode.bin
  119 +Be careful not to overwrite `bootcode.bin` or `bootcode4.bin` with the executable from a different subdirectory. The `rpiboot` process simply looks for a file called `bootcode.bin` (or `bootcode4.bin` on BCM2711). However, the file in `recovery`/`secure-boot-recovery` directories is actually the `recovery.bin` EEPROM flashing tool.
  120 +
  121 +### Diagnostics
  122 +* Monitor the Linux `dmesg` output and verify that a BCM boot device is detected immediately after powering on the device. If not, please check the `hardware` section.
  123 +* Check the green activity LED. On Compute Module 4 this is activated by the software bootloader and should remain on. If not, then it's likely that the initial USB transfer to the ROM failed.
  124 +* On Compute Module 4 connect a HDMI monitor for additional debug output. Flashing the EEPROM using `recovery.bin` will show a green screen and the `mass-storage-gadget` enables a console on the HDMI display.
  125 +* If `rpiboot` starts to download `bootcode4.bin` but the transfer fails then can indicate a cable issue OR a corrupted file. Check the hash of `bootcode.bin` file against this repository and check `dmesg` for USB error.
  126 +* If `bootcode.bin` or the `start.elf` detects an error then [error-code](https://www.raspberrypi.com/documentation/computers/configuration.html#led-warning-flash-codes) will be indicated by flashing the green activity LED.
  127 +* Add `uart_2ndstage=1` to the `config.txt` file in `msd/` or `recovery/` directories to enable UART debug output.
  128 +
88 <a name="secure-boot"></a> 129 <a name="secure-boot"></a>
89 ## Secure Boot 130 ## Secure Boot
90 Secure Boot requires the latest stable bootloader image. 131 Secure Boot requires the latest stable bootloader image.
@@ -202,7 +243,7 @@ The RSA public key must be stored within the EEPROM so that it can be used by th @@ -202,7 +243,7 @@ The RSA public key must be stored within the EEPROM so that it can be used by th
202 By default, the RSA public key is automatically extracted from the private key PEM file. Alternatively, 243 By default, the RSA public key is automatically extracted from the private key PEM file. Alternatively,
203 the public key may be specified separately via the `-p` argument to `update-pieeprom.sh` and `rpi-eeprom-config`. 244 the public key may be specified separately via the `-p` argument to `update-pieeprom.sh` and `rpi-eeprom-config`.
204 245
205 -To extract the public key in PEM format from a private key PEM file, run: 246 +To extract the public key in PEM format from a private key PEM file, run:
206 ```bash 247 ```bash
207 openssl rsa -in private.pem -pubout -out public.pem 248 openssl rsa -in private.pem -pubout -out public.pem
208 ``` 249 ```