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.

AM1808: Updating SPI Flash u-boot from SD card

Other Parts Discussed in Thread: AM1808

Hi,


I have a custom made AM1808 board that works well, it uses preprogrammed SPI Flash memories, that contains u-boot and a MAC address, which is product specific.

My question is, is it possible to update the u-boot in the SPI Flash memory from u-boot itself? If it is possible what are the commands? Alternatively is it possible to update the u-boot section in SPI Flash from Linux?

 

Regards,

Nicce

  • Hi Nicce

    It seems possible to do so using either the 'fatload' commands (if the uboot supports mmc and fatload commands) or by downloading the image through a tftp server. The main assumption is that the board is being started by the ARM UBL which then loads and starts the uboot. You will only update the uboot binary in the SPI flash, keeping the UBL intact.

    I would recommend going through the following page at TI Embedded Processors WIKI. It contains most of the details that you need to get started with updating uboot image in flash:

    http://processors.wiki.ti.com/index.php/GSG:_DA8x/OMAP-L1/AM1x_DVEVM_Additional_Procedures

    Here is how I think you can go ahead. For an mmc based update operation, the commands will look something like following. It assumes that you have placed the uboot binary file named uboot.bin on an Sd card and plugged it into the board:

    U-Boot > sf probe 0

    U-Boot > sf erase <Start Adress of uboot binary> <uboot binary size>

    U-Boot >
    mmc init 0

    U-Boot > fatload mmc 0 0xC0700000 uboot.bin

    U-Boot > sf write C0700000 <Start Adress of uboot binary> <uboot binary size>


    The tftp based uboot update should look something like this. It assumes that you have a TFTP serve running on a host system and the uboot.bin file is placed at the server:


    U-Boot > sf probe 0

    U-Boot > sf erase <Start Adress of uboot binary> <uboot binary size>

    U-Boot > setenv serverip <TFTP server IP where the uboot.bin is placed>
    U-Boot >
    setenv ipaddr <target IP address>

    U-Boot > tftp 0xc0700000 u-boot.bin

    U-Boot > sf write c0700000 <Start Adress of uboot binary> <uboot binary size>


    Note that I haven't tested it but the idea is valid that the uboot binary is placed in SPI flash which can be erased and rewritten using the uboot commands. All you need is the starting addresses of uboot and UBL to update the correct binaries.

    Regards,

     

    Awais Masood

    Mentor Embedded

    Nucleus | Services | UI | Multi-OS

  • Thanks, I thought it would be possible in this way. Just one followup question, how can I find out the size of the UBL?

     

    The UBL starts at address 0x0, I would assume, and the the uboot probably starts after it, am I right?

     

    Best Regards,

    Nicce

  • Hi Nicce,

    I have looked into the SPI flasher code and found that it copies the uboot by assuming that it is located at address 64K from the start of SPI flash memory. The UBL is assumed to be located at address 0.

     

    Regards,

    Awais Masood

    Mentor Embedded

    Nucleus | Services | UI | Multi-OS

  • Hi,

     

    I have also verified this with my own hex file, it is indeed like this. I will try it to see how it works.

     

    Best Regards,

    Nicce