Home | Projects | Notes > Embedded Linux > Booting BBB over Serial Port

Booting BBB over Serial Port

[!] Note: The "Exercise" section leads to some errors. e.g., After loading U-boot image, cannot get into U-boot prompt.

 

Serial Booting

 

Mechanism of Serial Booting

 

am335x-boot-sequence

 

Summary

  1. Make the board slip into the UART boot mode.

  2. Once in the UART boot mode, the ROM Boot Loader will be waiting to receive the SPL over UART via Xmodem protocol, so send SPL form the host PC first.

  3. Then, SPL executes on the board and it will be waiting to receive the U-boot image. Send the U-boot image.

  4. When getting the control of U-boot on the board, use U-boot commands xmodem and ymodem protocol to download all the other boot images onto the DDR memory of the board, and then the booting will further proceed from there.

[!] Note: If you are facing issues with U-boot boot after downloading it through Xmodem, then refer to the following threads where TI Software team suggests to use Ymodem protocol to download the uboot image instead of Xmodem.

https://e2e.ti.com/support/arm/sitara_arm/f/791/t/646278?AM3358-UART-boot-mode

https://e2e.ti.com/support/arm/sitara_arm/f/791/t/646278?AM3358-UART-boot-mode

 

Exercise

  1. Open minicom.

  2. Put the board into UART boot mode - Press and hold the boot button (S2) and then press and release the power button (S3).

    The characters "CCCC..." is emitted by ROM code of the SoC, indicating it's waiting to grab the SPL via the UART. If you don't see characters "CCCC...", then the board is not in the UART boot mode.

  3. Transfer the first boot image; SPL using xmodem.

    Transfer protocol options: xmodem, ymodem, zmodem, kermit

    Ctrl + A, S to select the transfer protocol

    Select xmodem

    Locate the SPL image stored in the host PC (u-boot-spl.bin)

    Space bar, Enter, then the file transfer will begin.

    You've just finished sending SPL to the internal RAM of the SoC.

    Now, UART is looking for the U-boot image.

  4. Before the board times out, transfer U-boot image (u-boot-img) using ymodem.

    You've just finished downloading the U-boot image to the DDR memory of the BBB board.

    [!] Note: Mine worked after ignoring a number of timeout messages. I don't know what happened during the process. But, if you end up not entering the U-boot prompt properly, redo from Step 3, using MLO, and u-boot-img in the following link: https://github.com/emagii/training-materials/tree/master/lab-data/linux/bootloader/beaglebone-black

  5. Load the Linux kernel image using U-boot command.

    0x82000000 comes from the "recommended address" table above in the notes.

    U-boot will now download the binary image or any file using x-modem protocol at this location in the DDR RAM of the board.

    Ctrl + A, S select xmodem protocol transfer uImag.

    Transfer takes about 5-10 mins (4 MB). When finished, you'll see the following additional info printed.

  6. Load Device Tree Binary (DTB)

    Select the DTB file...

  7. Load initramfs

    Select the initramfs file... (It will take around 5 - 10 mins)

  8. Now, we are almost ready to boot the Linux kernel from memory.

    Since we are using RAM based file system, we have to tell this info to the Linux kernel using the boot arguments. Otherwise, Linux kernel will not know where to find the file system to mount during its booting process and the boot may fail.

    console=ttyO0,115200 - Console and baudrate info

    root=/dev/ram0 rw - RAMFS device file

    initrd=0x88080000 - initramfs address in memory

  9. Boot the Linux kernel from memory

    This should boot the Linux kernel successfully. Mine showed some errors!

 

 

References

Nayak, K. (2022). Embedded Linux Step by Step Using Beaglebone Black [Video file]. Retrieved from https://www.udemy.com/course/embedded-linux-step-by-step-using-beaglebone/