EHCI Debugging: Difference between revisions
Jump to navigation
Jump to search
Created page with "EHCI Debugging can be used on mainboards without a serial console. == Raspberry Pi Zero W == The Raspberry Pi Zero W can be used as a EHCI debugger. The required equipment for this tutorial is: * Raspberry Pi Zero W with a MicroSD card * A WPA2 WiFi Network * A Micro-USB cable for power, connected to PWR-IN (RPI) and a power source (5V 2A) * A Micro-USB cable for debugging, connected to USB (RPI) and a mainboard EHCI debugging port === Setup the RPI === * Image [https:..." |
(No difference)
|
Revision as of 02:25, 29 April 2025
EHCI Debugging can be used on mainboards without a serial console.
Raspberry Pi Zero W
The Raspberry Pi Zero W can be used as a EHCI debugger. The required equipment for this tutorial is:
- Raspberry Pi Zero W with a MicroSD card
- A WPA2 WiFi Network
- A Micro-USB cable for power, connected to PWR-IN (RPI) and a power source (5V 2A)
- A Micro-USB cable for debugging, connected to USB (RPI) and a mainboard EHCI debugging port
Setup the RPI
- Image 2024-10-22-raspios-bullseye-armhf-lite.img onto the MicroSD card
- Before attaching the MicroSD card to the RPI, mount /boot and add/edit the following files:
/boot/config.txt: append the following
dtoverlay=dwc2
/boot/ssh: empty file, activates sshd
/boot/wpa_supplicant.conf: edit to match your country/wifi
country=us
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
scan_ssid=1
ssid="WIFI_NAME"
psk="WIFI_PASSWORD"
}
/boot/userconf: create a default user (debug:debug)
debug:$6$bPlhEkH1cqka0J4L$heiwAMdszLhD4rbfOeNfApYapuS/D6HzJR4Lmk6hZxzvnRTNgu3XeBlG4t73n4mNyrdLCM4Cn8knhscJ9/0nD0
- Attach the MicroSD card into the RPI and power on the device. You should now be able to SSH the device once it boots
- SSH to the RPI (ssh debug@raspberrypi, password: debug)
- Nmap can be used to find the IP of the RPI if you do not have local DNS (nmap -p 22 192.168.1.1/24)
- Setup the RPI as a EHCI USB Debugger Gadget
sudo apt-get update sudo apt-get upgrade sudo apt-get install git bc libncurses5-dev flex bison libsssl-dev git clone --depth=1 https://github.com/raspberrypi/linux cd linux KERNEL=kernel make bcmrpi_defconfig make menuconfig # Device Drivers -> USB support -> USB Gadget Support -> USB Gadget precomposed configurations # Enable EHCI Debug Device Gadget # Set EHCI Debug Device mode to serial # Save and Exit make -j4 zImage modules dtbs # This make may take hours wget https://johnlewis.ie/debug_patches.tar.xz tar -xJf debug_patches.tar.xz patch -p0 < dbgp.patch patch -p0 < gadget.patch patch -p0 < u_serial.patch make -j4 zImage modules dtbs sudo make modules_install sudo cp arch/arm/boot/dts/broadcom/*.dtb /boot/ sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/ sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/ sudo cp arch/arm/boot/zImage /boot/kernel.img reboot