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.

AM3517 boot from SPI Flash

Hello,

I want to boot from a SPI Flash.

We use SPI1 CS0.

I can program the spi flash with my debugger and u-boot.

When i measure the SPI signals after a reset i see the following.

- CS 0 works

- a data read on address 0x0 is transmitted on MOSI

- after that i can see the correct data which i programmed into the flash on the MISO line.

So i think there must be an error with the image header:

I used the following layout:

- two bytes with 0xFF to mark a valid sector

- image size (4 bytes)

- loadaddress (4 bytes) in sram

Debugging the sram content after the spi read shows me, that there is not the data from the spi-flash in the memory.

What goes wrong?

Do I have to add ECC?

Regards,

Ludwig

  • The solution was to start with the image size and to do a little/big endian conversion of the binary file.

    Maybe this helps someone.

    Regards,

    Ludwig

  • Sorry, but I'm brand new to this micro. After reading the RM, I am still confused on what exactly where, and what should be in the SPI for booting from it.

    Reading 26.1.7.6.3, it says :

    --------------------------------------------------------------

    1. Read Sector 1, Check the address: 0x0

    2. Read Sector 2, Check the address: 0x200

    3. Read Sector 3, Check the address: 0x400

    4. Read Sector 4, Check the address: 0x600

    The addresses mentioned above should contain the image size. If the value of the addresses mentioned

    above is neither 0x0 nor 0xFFFFFFFF, then the boot will proceed else it will move to the next sector. If no

    image is found after checking four sectors, the ROM bootloader will move to the next device.

    --------------------------------------------------------

    I have these questions.

    1) Does the beginning of ALL of these sectors (0,1,2,3 - addresses 0x0000000, 0x000200, 0x000400, 0x000600 respectively) contain the image size ?

    1a) If the starting bytes of ALL of these sectors have the image size, can the other bytes in that sector be used for something else ?

    2) How many bytes is the image size ? 3 bytes or 4 bytes ?

    3) Is the image size stored in Little Endian format or Big Endian format? I assume Big Endian.

    3) Where is the "First" byte of the image locationed ?  First byte of sector 4 ?

    4) Is there more information needed by the bootloader ?  Is there a "header" file as someone mentioned ?  If so, what's it's format, and where is it located ?

    5) Is there a CRC or other memory check that is stored with the image ? If so, where is it located ? What method ? CRC32, other ?

    6) Does the bootloader verify the image from a safe area (ROM) before code execution is started in RAM ?