From 9fd1724b39423fde04c39a7c129ec2ba88ca5da9 Mon Sep 17 00:00:00 2001 From: Igor Opaniuk Date: Wed, 11 Dec 2024 15:04:32 +0100 Subject: [PATCH] README: add flash instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add initial flash instructions for Qualcomm® RB3 Gen 2 Development Kit. Signed-off-by: Igor Opaniuk --- README.md | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/README.md b/README.md index c320b5d3..e293f4ec 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,102 @@ an easy way to setup bitbake based projects. For more details, visit the For a manual build without KAS, refer to the [Yocto Project Quick Build](https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html). +## Flash + +### Build QDL tool + +QDL tool communicates with USB devices of PID:VID `05c6:9008` and uploads a +flash loader, which is then used for flashing images. Follow the steps below +to download and compile QDL for your platform: + +1. Clone the QDL repository: + + ``` + git clone https://github.com/linux-msm/qdl + ``` + +2. Read the README and install build dependencies (`libxml2-dev` and + `libusb-1.0-0-dev`). On Debian-based distribution run: + + ``` + sudo apt install libxml2-dev libusb-1.0-0-dev + ``` + +3. Build the QDL tool using make: + + ``` + cd qdl + make + ``` + +As QDL tool requires raw USB access, so to able to run it from non-root user +create an appropriate `udev` rule by following steps described in +[Update udev rules](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254/flash_images_unregistered.html#update-udev-rules) + +### Prepare the Board + +#### RB3 Gen 2 + +Location of all DIP switches, USB debug port and buttons (`F_DL` for instance) +can be found on [RB3 Gen 2 Quick Start Guide](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-253/ubuntu_host.html). + +1. Set up `DIP_SW_0` positions `1` and `2` to `ON`. This enables serial output + to the debug port. +2. To put the device into EDL mode press and hold the `F_DL` button + before connecting the power cable. + +### Flash images + +Make sure that ModemManager is not running, disable it if necessary. + +1. Connect the micro USB debug cable to the host. Baud rate should be `115200`. + Check in `dmesg` how UART shows up (e.g. `/dev/ttyUSB0`): + + ``` + $ sudo dmesg | grep tty + [217664.921039] usb 3-1.1.4: FTDI Serial Device converter attached to ttyUSB0 + ``` + +2. Use your favorite serial comminication program to access the console, such + as minicom, picocom, putty etc. Baud rate should be 115200: + + ``` + picocom -b 115200 /dev/ttyUSB0 + ``` + +3. Plug in the USB-C cable from the host. +4. Unpack the tarball stored in the deploy directory: + + ``` + cd build/tmp/deploy/images/qcs6490-rb3gen2-core-kit/ + tar zxvf core-image-base-qcs6490-rb3gen2-core-kit.rootfs.qcomflash.tar.gz + ``` + +5. Use the QDL tool (built in the previous section) to flash the images: + + ``` + qdl --debug prog_firehose_ddr.elf rawprogram*.xml patch*.xml + ``` + + If you have multiple boards connected the host, provide the serial + number of the board to flash through `--serial` param: + + ``` + qdl --serial=0AA94EFD --debug prog_firehose_ddr.elf rawprogram*.xml patch*.xml + ``` + + Serial can be obtained using `lsusb -v -d 05c6:9008` command. + +6. Ensure that the device is booted in Emergency Download (EDL) mode + (please refer to Quick Start Guide for your board). The process of + flashing should start automatically: + + ``` + USB: using out-chunk-size of 1048576 + HELLO version: 0x2 compatible: 0x1 max_len: 1024 mode: 0 + READ64 image: 13 offset: 0x0 length: 0x40 + ``` + ## Contributing Please submit any patches against the `meta-qcom-hwe` layer (branch **main**)