AM263P4-Q1: flash, bootloader, addresses

Part Number: AM263P4-Q1
Other Parts Discussed in Thread: UNIFLASH, SYSCONFIG

Hi,

I am trying to extend the OSPI-SBL to be able to receive data via CAN and write that data to flash, specifically I want to be able to write a mcelf file to update my firmware.

Some things are still unclear to me, please help me clarify a few things.

  1. What is the difference between 0x80000000 address space and 0x60000000? Both seem to return the same values, when I read these with UniFlash.
  2. What is the correct address to write the mcelf-file to. 0x60081000?
  3. What is the correct address to read the written data for verification/checksum? also 0x60081000?
  4. Can I change this address freely (avoiding the SBL space, obviously) by changing  “boot image offset” in sysconfig of the SBL?
  5. I read that at 0x60080000 is data for the OSPI Phy. Before writing my mcelf to 0x60081000, I would delete the flash sector, so this will also be deleted. Where do I get this data from, so I can rewrite it?
  6. Is the mcelf_xip file important? It is only 224B long. Do I need this at all? (I don’t use the flash for anything other than storing the application code to be loaded by the SBL once.)
  7. UniFlash will write mcelf_xip to 0xF0000000. What is there? I don’t see this in the memory map.

Best regards,
Frank

  • Hello,

    This thread has been routed to the intended expert, please expect a response next Monday.

    Best,

    Matt

  • HI Frank,

    What is the difference between 0x80000000 address space and 0x60000000? Both seem to return the same values, when I read these with UniFlash.

    The external flash is memory mapped to 3 SoC address spaces. 0x6000_0000, 0x8000_0000 and 0x8800_0000. These regions serve 3 different purposes.

    Please see the below excerpt from TRM

    If AB swap (flash remap feature ) is not used. Then 0x6000_0000 and 0x8000_0000 address is the same functionally.


    What is the correct address to write the mcelf-file to. 0x60081000?

    This address can be customized. By default, the SBL in SDK is configured to look for the application at 0x81000 offset in flash. So yes, the address to write is 0x6008_1000.


    What is the correct address to read the written data for verification/checksum? also 0x60081000?

    Yes, since the application image is written at this address, for calculating checksum or image verification read back also needs to be done at this address- 0x6008_1000.


    I read that at 0x60080000 is data for the OSPI Phy. Before writing my mcelf to 0x60081000, I would delete the flash sector, so this will also be deleted. Where do I get this data from, so I can rewrite it?

    The PHY attach vector is present at 0x6008_0000. If you have erase this address, then attack vector can be written back by the following ways

    1. By running an application which has Flash enabled with PHY checkbox  (in sysconfig) turned on.

    2. Flashing some image using the uart uniflash writer. The tool will write the attack vector

    If your SBL has Flash and OSPI PHY enabled, then just running the SBL again would be enough. This is because the OSPI driver will check if the attack vector is there. If not there, then it will re write the attach vector again.


    Is the mcelf_xip file important? It is only 224B long. Do I need this at all? (I don’t use the flash for anything other than storing the application code to be loaded by the SBL once.)

    This file is required only if XIP is used or if you have any .rodata content to be stored in flash configured by linker. If not then it is not requried.


    UniFlash will write mcelf_xip to 0xF0000000. What is there? I don’t see this in the memory map.

    Yes, it is not in the memory map. This address is just a label address for the underlying flasher SW in the uniflash tool to identify that it is a mcelf_xip file.

    Thanks & Regards,

    Aswin