This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM571x flashing procedure for QSPI NOR Flash devices

Other Parts Discussed in Thread: AM5718, UNIFLASH, DRA752

Hi,

I'm working on an AM5718 custom board with a NOR flash on the Quad-SPI interface.

I need to program U-Boot + Linux image + RootFS image + some applications code to the NOR flash.

I have found several detailed resources for the Sitara processors on the TI processor Wiki but all of them seem to be dedicated to the AM335x family:

- processors.wiki.ti.com/.../Sitara_Linux_Program_SPI_Flash_on_AM335x_EVM

- processors.wiki.ti.com/.../Sitara_Uniflash_Flash_Programming_with_U-Boot

Can anyone tell me if there is an equivalent procedure compatible with the AM5718 SoC ?

My host machine is running Ubuntu 14.04 so I guess the Uniflash tool is not usable in my use case.

Lot of thanks

Best Regards,

  • OK thank you Biser.

    Before trying something with my custom board, I have performed several times the procedure given in the last section "Booting U-Boot from the console UART" with my evaluation board (AM572x EVM rev. A3).

    But each time I get the following:

    antoine@UBUNTU01:~$ sx -kb /home/antoine/u-boot-spl.bin < /dev/ttyUSB0 > /dev/ttyUSB0
    Sending /home/antoine/u-boot-spl.bin, 391 blocks: Give your local XMODEM receive command now.
    Retry 0: Receiver Cancelled

    Transfer incomplete
    antoine@UBUNTU01:~$

    We are very interested in a first-boot procedure over UART for each bare board just coming from the industrial process. Our board is hardwarely ready for it.

    I've read here : http://processors.wiki.ti.com/index.php/DRA7xx_GLSDK_Software_Developers_Guide#Using_UART_boot

    that the same procedure with the DRA7x EVM needs some résistors to be wired on the board for the UART boot to succeed.

    Is there an equivalent hardware operation to do on our AM572x EVM ?

    Thanks, regards

     

  • You need to set the boot device jumpers before powering on the EVM as described here:

  • Hi Biser,

    That's the basic board configuration I've done. The 3 jumbers are set according to the "BOOT from UART" mode on my EVM board before performing the test.

    Something else is wrong...

  • Have you checked that your UART connection is working? Communication parameters should be set to 115.2 Kbps, 8 bits, even parity, 1 stop-bit, no flow control. Do you see debug messages when you boot from another source?
  • Absolutely. It works well with Minicom when I boot my board on the SD/eMMC position:

    U-Boot SPL 2015.07+ (Mar 24 2016 - 09:27:18)
    DRA752 ES1.1
    reading args
    spl_load_image_fat_os: error reading image args, err - -1
    reading u-boot.img
    reading u-boot.img


    U-Boot 2015.07+ (May 20 2016 - 16:50:42 +0200)

    CPU : DRA752 ES1.1
    Board: BeagleBoard x15
    I2C: ready
    DRAM: 2 GiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env

    But be careful that here Minicom is configured as follows: 115200-8N1. 'N' means an odd parity.

    I follow your last post so before calling sx I configure my ttyUSB0 interface this way:

    antoine@UBUNTU01:~$ stty -F /dev/ttyUSB0 115200 cs8 parenb -parodd -cstopb -ixon ixoff

    but when I reboot my EVM board with the UART boot setting enabled I get:

    antoine@UBUNTU01:~$ sx -kb /home/antoine/u-boot-spl.bin < /dev/ttyUSB0 > /dev/ttyUSB0

    Sending /home/antoine/u-boot-spl.bin, 391 blocks: Give your local XMODEM receive command now.
    Retry 0: Receiver Cancelled

    Transfer incomplete

  • 'N' means 'No parity' as far as I know. The AM572x TRM Rev. F states that communication parameters should be set to 115.2 Kbps, 8 bits, EVEN parity, 1 stop-bit, no flow control for UART boot. Did you try that? Another thing - I seem to remember there have been issues in the past with Minicom. Can you try with Picocom?
  • "The AM572x TRM Rev. F states that communication parameters should be set to 115.2 Kbps, 8 bits, EVEN parity, 1 stop-bit, no flow control for UART boot"
    That's precisely what I tried to do with the 'stty' configurator:
    'cs8' means 8 data bits
    'parenb' means parity ENABLED
    '-parodd' means parity EVEN
    '-cstopb' means 1 stop bit
    '-ixon' means flow control DISABLED
    'ixoff' means ENABLE sending of start/stop characters

    Concerning Minicom you may be right, "N: odd" is what I read when I go through the helper.
    But that's not the problem here as Minicom correctly prints the U-Boot startup traces when I boot fomr the SD/eMMC interface.
  • Hi Biser,

    Have you got some news about it ? On my side I've tried to  use Picocom but the result is the same:

    antoine@UBUNTU01:~$ picocom -b115200 -d8 -pe -fn -s "sx -kb" /dev/ttyUSB0
    picocom v1.7

    port is        : /dev/ttyUSB0
    flowcontrol    : none
    baudrate is    : 115200
    parity is      : even
    databits are   : 8
    escape is      : C-a
    local echo is  : no
    noinit is      : no
    noreset is     : no
    nolock is      : no
    send_cmd is    : sx -kb
    receive_cmd is : rz -vv
    imap is        :
    omap is        :
    emap is        : crcrlf,delbs,

    Terminal ready

    *** file: /home/antoine/u-boot-spl.bin
    sx -kb /home/antoine/u-boot-spl.bin
    Sending /home/antoine/u-boot-spl.bin, 391 blocks: Give your local XMODEM receive command now.
    Retry 0: Receiver Cancelled

    Transfer incomplete

    *** exit status: 128

    On your side can someone perform the same test with an AM572x EVM and tell me what's wrong ?

    Concerning the UART tty parity configuration, please notice that there is a mismatch between your last post (you wrote: EVEN parity) and the TI Wiki weblink you gave me before : http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User's_Guide#Booting_U-Boot_from_the_console_UART

    where it is clearly mentioned: "As per the TRM, the file is to be loaded via the X-MODEM protocol at 115200 baud 8 stop bits no parity"

    I strongly need your help to go forward...

    Thanks, regards

  • Hi,

    I've booted AM572x GP EVM through uart. There is this detail about AM572x GP EVM,  the PMIC cuts off the power, if in a specified time (~10-15 seconds) an image does NOT take over & set the PMIC to continue powering the board. Therefore if you don't have any image loaded in the DDR & executed by ROM code during that time the power will be cut off (power led  on the board stops glowing, which indicates when power is turned off).  

    This is most likely the reason why your binary transfer is interrupted.

    Which revision is your GP EVM board? To overcome this "limitation" populate J5 (or stuff a wire/paper clip/staple into it) on newer boards, or swap R23 with R28 on older boards.  

    Also don't forget to add #define CONFIG_SPL_YMODEM_SUPPORT in beagle_x15.h to include x-modem support in u-boot (this is necessary for UART boot).

    Hope this helps.

    Best Regards,

    Yordan

  • Hi Yordan, thanks for your answer.

    My AM572x EVM is a rev A3. I have located the J5 strap on the board and will populate it correctly before the next try.

    I also have added the CONFIG_SPL_YMODEM_SUPPORT define in the board config header and then rebuilt U-Boot, no now my u-boot-spl.bin contains YModem functions.

    But I'm not sure this latest modification will have an impact because as I said above, the problem:

    - happens at the very first loading stage, it concerns the loading of the SPL (u-boot-spl.bin) by the ROM code, so this is done using the XMODEM protocol while the SPL uses the YMODEM protocol to load U-Boot

    - happens before the PMIC powers down the board (the LED is still on when the error message appears in the console)

    Could you please send me the screenshot of your successful boot over UART showing the precise picocom or minicom or sx command you type with the tty config ?

    Regards.

  • The boot ROM does not use xmodem for downloading MLO. It uses a different protocol described in the Initialization chapter under Peripheral Booting. Once MLO is loaded, it can use xmodem to boot u-boot.

    Steve K.

  • Hi,

    As Steve noted you will need to use a binary transfer to load the u-boot-spl.bin to the device DDR.

    This could be done with a custom application.

    Best Regards,
    Yordan
  • Sorry guys but what you write here is really confusing.

    What part is still right in this procedure ? http://processors.wiki.ti.com/index.php/Linux_Core_U-Boot_User's_Guide#Booting_U-Boot_from_the_console_UART

    On my side I have performed the following modifications for the last test:

    - strap J5 on my board so that the EVM is always powered (or it seems to be so, as the power LED is ON until I unplug the power cable)

    - my SPL is now built with CONFIG_SPL_YMODEM_SUPPORT defined

    Here is the result:

    antoine@UBUNTU01:~$ picocom -b115200 -d8 -pe -fn -s "sx -kb" /dev/ttyUSB0
    picocom v1.7

    port is        : /dev/ttyUSB0
    flowcontrol    : none
    baudrate is    : 115200
    parity is      : even
    databits are   : 8
    escape is      : C-a
    local echo is  : no
    noinit is      : no
    noreset is     : no
    nolock is      : no
    send_cmd is    : sx -kb
    receive_cmd is : rz -vv
    imap is        :
    omap is        :
    emap is        : crcrlf,delbs,

    Terminal ready
    *** file: /home/antoine/u-boot-spl.bin
    sx -kb /home/antoine/u-boot-spl.bin
    Sending /home/antoine/u-boot-spl.bin, 475 blocks: Give your local XMODEM receive command now.
    Xmodem sectors/kbytes sent:   0/ 0kRetry 0: Got 01 for sector ACK
    Retry 0: NAK on sector
    Retry 0: Got 01 for sector ACK
    Retry 0: NAK on sector
    Retry 0: Got 01 for sector ACK
    Retry 0: NAK on sector
    Retry 0: Got 01 for sector ACK
    Retry 0: NAK on sector
    Retry 0: Got 01 for sector ACK
    Retry 0: NAK on sector
    Retry 0: Got 01 for sector ACK
    Retry 0: NAK on sector
    Retry 0: Got 01 for sector ACK
    Retry 0: NAK on sector
    Retry 0: Got 01 for sector ACK
    Retry 0: NAK on sector
    Retry 0: Got 01 for sector ACK
    Retry 0: NAK on sector
    Retry 0: Got 01 for sector ACK
    Retry 0: NAK on sector
    Retry 0: Got 01 for sector ACK
    Retry 0: NAK on sector
    Retry 0: Retry Count Exceeded

    Transfer incomplete

    *** exit status: 128

    So now can you be more precise on the difference between what I do and your successful boot loading over UART Yordan ?

    Thanks, regards.

  • Hi,

    As Steve noted, refer to Section 33.3.5 Peripheral Booting.

    When you connect the board board to your host PC & power it up, you will start getting the Asic ID. At this stage you first need to transfer the boot message, to tell the board to continue with the peripheral booting:

    1. Perform binary transfer of the boot message: 0xF0030002 -> this tells the board that you will transfer a boot image.
    2. Perform binary transfer of u-boot-spl.bin
    3. Perform xmodem transfer of the u-boot image

    Best Regards,
    Yordan
  • OK thanks I'm going to try something corresponding to that sequence.

    I give you a feedback once tested.

    Regards

  • Hi,

    It's now working well !

    Lot of thanks for your guidelines Yordan & Steve.

    Regards

  • Hi,
    According to your suggestions, I still can't boot from UART.
    My step as below .

    1. Set BOOT From UART (J3~J4).
    2. Short J5.
    3. Open Teraterm on Windows machine and set serial port to 115.2 Kbps, 8 bits, even parity, 1 stop-bit, no flow control.
    4. I can see that “VA!” characters appear on TeraTerm window continuously.
    5. Close the teraterm window.
    6. Open Linux Terminal and execute the following command.

    will@ubuntu:~/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/prebuilt-images$ sx -kb u-boot-spl.bin-am57xx-evm < /dev/ttyUSB0 > /dev/ttyUSB0
    Sending u-boot-spl.bin-am57xx-evm, 530 blocks: Give your local XMODEM receive command now.
    Retry 0: Receiver Cancelled

    Transfer incomplete
    will@ubuntu:~/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/prebuilt-images$


    Please give me some suggestions.
    Thanks a lot.
  • Hi,
    According to your suggestions, I still can't boot from UART.
    My step as below .

    1. Set BOOT From UART (J3~J4).
    2. Short J5.
    3. Open Teraterm on Windows machine and set serial port to 115.2 Kbps, 8 bits, even parity, 1 stop-bit, no flow control.
    4. I can see that “VA!” characters appear on TeraTerm window continuously.
    5. Close the teraterm window.
    6. Open Linux Terminal and execute the following command.

    will@ubuntu:~/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/prebuilt-images$ sx -kb u-boot-spl.bin-am57xx-evm < /dev/ttyUSB0 > /dev/ttyUSB0
    Sending u-boot-spl.bin-am57xx-evm, 530 blocks: Give your local XMODEM receive command now.
    Retry 0: Receiver Cancelled

    Transfer incomplete
    will@ubuntu:~/ti-processor-sdk-linux-am57xx-evm-03.00.00.04/board-support/prebuilt-images$


    Please give me some suggestions.
    Thanks a lot.
  • 5342.AM57_UART_Boot_SOP_By_TI_Rio_Final.pdfHi all:

      This issue for AM57 UART boot is solved, please see the attached.

    BR Rio

  • According to the attached,I encountered such a problem:

    gc-virtual-machine:6$perl ./serial-boot.pl -p /dev/ttyUSB0 -s u-boot-spl.bin -d1 -t40
    BYTES=82844 file_bytes=9c430100 prefix_bytes=020003f0 string bytes=020003f09c430100
    ----Please reset the Board NOW (timeout=40 sec)----
    00 80 04 01 05 01 56 41 07 02 13 02 01 00 12 15 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 21 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    Board Detected
    .
    waiting for draining 40
    TIOCSERGETLSR(21593) ioctl failed: Inappropriate ioctl for device at ./serial-boot.pl line 360.
    waiting for draining 39

    ......

    Please give me some suggestions.
    Thanks a lot.Serial-boot.zip