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.

AM335x boot from SPI flash

Sorry if this appears to be a double post. Originally, this was posted as a reply to a thread that was marked as resolved, so I was afraid that it wouldn't be looked at again.

 

After reading the RM, I am still confused on 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.

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

5) 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 ?

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

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

 

  • Hi Gregory,

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

    No, it's not necessary. This is a fail-safe feature in case you have some initial sectors damaged.

    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 ?
    4) Where is the "First" byte of the image locationed ?  First byte of sector 4 ?

    See this link about programming the SPI Flash: http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User's_Guide#SPI_2

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

    AM335X TRM, Rev.I section 26.1.7.6.3: As the A8 is a little-endian processor, and SPI operates in a big-endian format, this means that while writing to the flash, care needs to be taken to write the image in a big-endian format. This way we can avoid doing the endian conversion at boot time, thus improving boot performance.

    I'm afraid I can't answer your other questions.