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.

LP-AM263P: UniFlash issues with .mcelf_xip files

Part Number: LP-AM263P
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

Hello,

I've got a small multicore LED flashing application. Flashing this together with sbl_ospi, I can flash the .appimage/.appimage_xip files OK and can can run the application from ram or flash with XIP.

When I then flash the same Appl but with sbl_ospi_multicore_elf, and flashing .mcelf/.mcelf_xip files, I seem to be able to run the application OK, but I get an error with UniFlash whilst flashing the .mcelf_xip file.

Uniflash cmd line output:

I've also tried through the Uniflash GUI, this gives a bit more info on a potential error (invalid image format)

As mentioned, it appears the application on core 0 runs as expected, which is a bit odd given this uniflash error.

I started looiking into the .mcelf files in a bit more detail, it appears that all .mcelf_xip files only have a NOTE section generated at the start of the program headers, not at the end. For example:

.mcelf file:

.mcelf_xip file:

Is this something which could be causing the imvalid image error on Uniflash - even though the image still seems to have flashed ok?

If not - what are the other possible reasons for .mcelf_xip files to cause issues for UniFlash?

Additionally - what is the UniFlash error process? For example with this 'invalid image' error -  does Uniflash issue a subsequent flash erase command for the chunk it has just tried to write to if an error is detected during flashing?

Thanks,

Rens

  • Hi Rens,

    We have not observed this issue, Could you please share the example project tht you are working with. I will start looking from there.

  • Hi Nilabh,

    Please find attached example project with ocmc_example and sbl_ospi/sbl_ospi_multicore elf sbls, the same problem is seen on this.

    20250226_mcelf_xip_uniflash_issue.zip

    In this project I've included separate unifFlash configs, you should be able to just update adresses for your local repo and then run the batch files 'RunUniFlash.bat' and 'mcelf_RununiFlash.bat' consecutively.

     If I flash the .appimage_xip, uniflash gives expected response:

    The appliication seems to run OK:

    For .mcelf_xip, I get an error response:

    And the application seems to hang:

    Hopefully the attached .zip works. Would be useful if you could provide some more pointers on the Uniflash error behaviour/expected image format in the meantime.

    Thanks,

    Rens

  • Just to clarify as well, I'm using the Launchpad hardware, even though name of the Uniflash config files might suggest otherwise.

    There is one change in the attached sbl_ospi (from example) to add in a delay loop with timeout, but otherwise changes to sbl_ospi, sbl_ospi_multicore and ocmc should all be minimal compared to the original example projects.

    Thanks,

    Rens

  • Hi Rens,

    Can you try the ocmc multi core project and try flashing, I could not try it last week, as I was out sick, I will try it this week, wanted to keep you posted here.

  • Hi Nilabh,

    As mentioned, any changes from the example project for ocmc vs the project I've attached in the previous post are very minimal (if any) - either renaming the project to 'lp' from 'cc' (as i'm testing on Launchpad, ocmc is not available for Launchpad HW specifically from SDK), adding flash reset pin into sysfcg for core0, or just using later version of SysCfg. No major changes.  And the .appimage files run OK - so there's no fundamental issues with the general configuration either with sbl_ospi or sbl_multicore.

    One thing I did notice is that for both ospi_sbl and sbl_multicore core0 is incorrectly set to be running in lockstep in sysCfg - this should be standalone. However, I don't think this should affect Uniflash behaviour just for .mcelf files.

     

    I don't have access to UniFlash source code or even know what checks Uniflash is performing to determine that flashing failed so debugging further is difficult/futile from my side. Let me know if there's any issues running the attached project from your side.

    Thanks,

    Rens

  • Found the issue: I was using the --flash-xip tag for both .appimage and .mcelf files. To flash an .mcelf configured for XIP the Uniflash tag 

    --flash-mcelf-xip needs to be used instead

    With this, Uniflash provides a successful flash result.

    Debug output from Uniflash really was not clear. I had to dig into uart_uniflash.py and notice that this specific optype exists for .mcelf files to understand the problem.

    Might I suggest a simple file check in the uart_uniflash.py script to save other users a lot of headache in the future?

    if (filetype from --file does not match opcode)

    print (ERROR: File provided is not suitable for chosen operation)

    Thanks,

    Rens