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.

SK-AM62P-LP: Upgrade mcu programs via SD card

Part Number: SK-AM62P-LP
Other Parts Discussed in Thread: SYSCONFIG, AM62P

Tool/software:

Hi,ti experts

mcu has such an upgrade scenario, the new software is saved in the sd card,the old mcu program is saved in flash, and the mcu needs to be upgraded.
The first solution is to put the new version of mcu program into SD, when the opsi mode is used to power on and start mcu, after starting linux, mcu can directly access the sd card, read the new mcu version and copy the data to flash, and then read the new mcu program from the new flash position and load the memory when ospi is started next time. Realize mcu software upgrade.

a1. Is this plan feasible?
a2. Can mcu directly access SD, read and write sd card?
a3. Can the mcu read and write flash?
a4.sd card stores the linux image. Follow this link to complete the operation. If the mcu needs to read the SD card, does the SD card need to be set up?
Writing the WIC Image to SD Card
dev.ti.com/.../node rue
a5. If this solution is possible, what is the format of saving programs in sd card?
a6. How do I save the mcu program to the corresponding address in the sd card, because the read from the sd card is read from the corresponding Block, so how do I write the file to the corresponding address, and how do I convert this address to Block to start reading data from
I am now burning through the serial port, mcu program file format is hs_fs.

b1. I have checked the sdk of mcu, flash and sd card can only be accessed by wkup domain for r5f processor, while mcu domain cannot be accessed. Can mcu domain read and write sd card and flash?

So the second option is ospi boot, wkup boot, mcu boot, then linux boot, then wkup program to access the sd card, read the data from the corresponding location, and then copy to flash, and then the next boot mcu from the new flash address boot. Is it feasible to complete the mcu upgrade? If so, what kind of file format should be used to save the mcu program to the sd card? Now, how should the mcu program file be stored to the corresponding position in sd in order to be read by the wkup program?
b2. Is the data of type uint_8 read? Can I save it as an int array and then write the contents of the array to flash?

The third scheme is ospi start, wkup start, mcu start, linux start, linux read the sd card file, and then directly write to flash.
c1. Can linux operate the sd card? How should the program file be saved to the corresponding position of the sd card? Can linux read the file directly?
c2. Can linux operate flash?

The fourth scheme is ospi start, wkup start, mcu start, linux start, linux read the file of sd card, linux send the data to wkup through rpmsg, wkup save the data to flash.
d1. Is this solution feasible?
This solution also involves the format of the program file saved to the sd card, and how to save it to the desired location of the sd card.

e1.The above scheme does not involve low-power mode, so the wkup domain can execute applications just like the mcu domain, right?

f1.Another question is if the mcu uses the uds upgrade, can the mcu save the data received by the uds into the flash?

The above mentioned content has the corresponding demo, including the linux application demo and the r5f processor application.

Thank you for your reply.

  • Hi ,ti experts, can you help answer these questions.

  • Hi Hehahe,

    a3. Can the mcu read and write flash?

    Currently this is not a part of TI's SW Offering hence when you check from MCU perspective SysConfig does not shows flash as an option.

    a1. Is this plan feasible?
    a2. Can mcu directly access SD, read and write sd card?

    I think a similar thread addressing the first two questions have been asked here: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1404579/sk-am62p-lp-how-does-the-mcu-access-sd-cards-and-flash

    Allow me few days to go through your others mentioned flows.

    Regards,

    Vaibhav

  • Hi

    MCU+ SDK on AM62P supports and MMCSD driver but as of today it is only supported on the DM (or WKUP) R5F. This is not a limitation from the hardware but mainly a software architecture decision based on how we see the AM62P being used by customers. We usually customers running AutoSAR on the MCU R5F and which is where the TI's MCAL offering feeds in.

    The software update which you envision would be simplest to realize with Linux owning the flash and the MMCSD controller (3rd scheme) and hence reading from the SD card and flashing to the flash. Linux has extensive support for reading/writing to SD cards and NOR/NAND flashes (flash part needs to be considered). The update mechanism which you see, I feel may also need to incorporate a fail safe mechanism where you have the ability to overcome a partial failed update. This usually is realised using an A/B Swap OTA. If this is your usecase, you need to add a thin layer (never OTA updated) where there is a logic for choosing A vs B partition for booting the MCU firmware.

    If there are additional safety concerns and you want to do the updates from R5F, that is possible but would be more complex as this would require sharing of ownership of MMCSD which is non trivial with our SW architecture. I'd recommend moving away from it unless absolutely necessary.

    e1.The above scheme does not involve low-power mode, so the wkup domain can execute applications just like the mcu domain, right?

    From a hardware perspective yes. WKUP domain can run applications like MCU domain, but there is a centralized device manager firmware which runs on the WKUP R5F aka DM R5F and hence any user application which needs to run on this core has to co exist with this firmware. So if there is a need for only one R5F, choose MCU R5F for simpler software integration.

    f1.Another question is if the mcu uses the uds upgrade, can the mcu save the data received by the uds into the flash?

    This tells me that you are probably looking at running AutoSAR on the MCU. If the flash (NOR) driver is available on the MCU (I think we do have MCALs for this) then it can write to the flash.

    Regards

    Karan