UBoot recovery for am335 via xmodem

From Wiki-DB
Jump to navigation Jump to search

For the programming of the AM335x we take use of the X-Modem, so there is no use of external Hardware except a PC with a com-port. You also need a Linux distribution for example the Virtual Machine for Application Development with Debian Jessie

  1. Installation
    • installing the Debian package lrzsz
      • sudo apt-get install lrzsz
    • Standard password for VM is devel
  2. Programing
    • Download required files here: Programing File
    • The MLO.byteswap and the uBoot.img are normal uBoot files you can download here: uBoot_AM335
    • If you use the Virtual Machine, then don’t import the serial Port because this can cause issues
    • Am335 serialport.png
    • check which ttyUSBX port is needed for programing $ cd /dev && ls
    • Please change the ttyUSBX in the following code to the one you need
    • Navigate into the folder where the programing files are located
    • Power on the board and check if it prints "C" on the serial monitor
      • sx -kb u-boot-spl.bin < /dev/ttyUSBX > /dev/ttyUSBX
    • Wait for the message "Trying to boot from UART" on the serial monitor
      • sx -kb u-boot.img < /dev/ttyUSBX > /dev/ttyUSBX
    • Wait for uBoot to boot, if the output stops with "**No partition table - mmc 1 **" you can go on (can take a while)
      • echo 'loady ${loadaddr}' > /dev/ttyUSBX
    • Wait for the message "Ready for binary (ymodem) download to 0x82000000 at 115200 bps..." on the serial monitor
      • sx MLO.byteswap < /dev/ttyUSBX > /dev/ttyUSBX
    • Wait untill the Serial Monitor confirms that the data is sent
      • echo 'sf probe; sf erase 0x0 0x20000; sf write ${loadaddr} 0x0 ${filesize};' > /dev/ttyUSBX
    • Wait for the acknowledge“
        • SF: Detected S25FL216K with page size 256 Bytes, erase size 4 KiB, total 16 MiB
        • SF: 131072 bytes @ 0x0 Erased: OK
        • device 0 offset 0x0, size 0x6794
        • SF: 26516 bytes @ 0x0 Written: OK “
      • echo 'loady ${loadaddr}' > /dev/ttyUSBX
    • Ready for binary (ymode) download to 0x82000000 at 115200 bps...
      • sx u-boot.img < /dev/ttyUSBX > /dev/ttyUSBX
    • Wait till the Serial Monitor not the programing terminal confirms that the data is sent
      • echo 'sf probe; sf erase 0x20000 0xA0000; sf write ${loadaddr} 0x20000 ${filesize};' > /dev/ttyUSBX
    • Wait for the acknowledge “
        • SF probe; sf erase 0x20000 0xA0000; sf write ${loadaddr} 0x20000 ${filesize};
        • SF: Detected S25FL216K with page size 256 Bytes, erase size 4 KiB, total 16 MiB
        • SF: 655360 bytes @ 0x20000 Erased: OK
        • device 0 offset 0x20000, size 0x60eec
        • SF: 397036 bytes @ 0x20000 Written: OK
      • echo "reset" > /dev/ttyUSBX