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.

AM6548: Converting a user application to XIP

Part Number: AM6548

Hello,

after I managed to run the example application with XIP. I am now trying to runt my own application on the XIP.

For me the biggest questions is. What do I have to do to make my .appimage to.xer5f.bin and make it runable on the external OSPI Flash.

So far we can start with one core only. But is it possible to run multi-core application on the external OSPI also?

I attached my .map and linker file.

What is to do, after these files are edited? It seems like the common .appimage is not suitable to run in from Flash directly.
This is confusing me atm.

best regards

Niko

Linker+Map.zip

  • Hi Niko,

    I will take a look at the Linker and Map file and provide you my feedback shorty.

    Regards,

    Karan

  • Hi Niko,

    I looked at the Linker command file and the map file you attached.

    The first level things which you want to take care of is to create a *.bin from the *.xer5f and the *.bin should be small enough to fit in the flash - for this you need a tight mem map.

    The other care about will be that no write accesses should happen to the flash at run-time. Flash is read-only in XIP mode.

    *.bin will bloat up to an unreasonably large size if there are some things that load in the flash (0x50000000) and some things load in DDR / OCM / MSMC etc.. Upon conversion the empty bubbles in the memory will be filled with 0s.

    So I see two kinds of sections:

    1. Read only sections

    These sections you can put directly in the flash.

    2. Read-write but uninitialized sections

    These can be put in the DDR or any RAM memory.

    There is an application in the SDK7.0 called can_profile_xip - although this is not supported on AM65xx but I believe we can still reference the linker file and the bios config files for this application. (doc - http://downloads.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/mcusw/mcal_drv/docs/drv_docs/demo_xip_profile_top.html ) (source code - psdk_rtos_auto_j7_07_00_00_11/mcusw/mcuss_demos/profiling/can_profile_xip/.)

    So what you need to do is:

    1. Change the linker file as mentioned above. You should be able to generate a bin with compact mem map.

    2. Change the entry point to 0x5000_E000 - this is same as the xip_test application you had already run.

    On your question - on how to convert the xer5f to xer5f.bin - I think there is a utility which you can use, I will point you to that shortly.

    One question here - is your application residing in the PDK somewhere? If yes then you can just modify the *mk file for the component to add something similar to the xip_test app:

    sbl_boot_xip_test_SBL_APP_BINIMAGEGEN = yes
    export sbl_boot_xip_test_SBL_APP_BINIMAGEGEN

    This will take care of calling the utility and generating the xer5f.bin file.

    Regards,

    Karan

  • Hi Niko,

    You can use the below command to create a *.bin from your *.out or *.xer5f (elf formats):

    cd ti-cgt-arm_20.2.0.LTS/bin
    armobjcopy.exe -O binary <FULL_PATH_TO_YOUR_ELF> xip_app.bin

    Regards,

    Karan

  • Hi,

    I am on this Issue now and I have a question regarding XIP:

    You mentioned that in XIP mode the Flash is in read-only mode. What does that EXACTLY mean?

    -Is the flash accessable for read and writes when no "direct access" is running at the moment?

    -Or is the Flash completely "locked" when running once into XIP Mode?

    -How is the behaviour for AM64xx??

    We need to know the limits because we want to use XIP but we want also be able to read and write data to the same flash (file system, etc)

    Kind regards

    Andreas

  • Hi again,

    I tried to generate a bin file as you mentioned in your last post.

    I get the following error:

    ti-armobjcopy -O binary ../output/binary_basic_mcu0_debug/binary_basic_mcu0_debug_V0_0_0_0_alpha.elf xip binary_basic_mcu0_debug_V0_0_0_0_alpha.bin
    /home/user/ti/ti-cgt-arm_20.2.0.LTS/bin/armobjcopy: error: too many positional argument

    Without the option "xip" it works. Do I need this option? Why is it there?

    Also please answer the question: Where do I find the access addesses for OSPI XIP which I need to provide in the linker file??

    Kind regards

    Andreas