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.

AM2612: How to handle persistent data during FOTA update?

Part Number: AM2612

Hello team,

how should persistent data like filesystems, logs, etc. be handled during a FOTA update.

If the full memory is divided into 2 banks, this would mean after every update, the device will need to copy the persistent data from the old bank to the new one.

Is there also a way to create more banks and keep one of them persistent?

Best regards
Manuel

  • Hi Manuel,

    Can you provide me some insights into how the FOTA is being done now?

    Are you using the AB Swap mechanism here? If AB Swap mechanism is used then you can exclude the data banks from AB Swap. This means that post fota the code will read from the same area itself. The OSPI IP will not route the access to a different area.

    But to further understand the question, can you please provide me more details on your FOTA architecture?

    Thanks & Regards,

    Aswin

  • Hello Aswin,

    yes, so far the method was AB swap.

    So you are saying it is not required to split all of the flash memory into 2 banks (A & B) but rather that these banks can be smaller than the full memory and we can leave some space for the persistant data?

    Best regards
    Manuel

  • Hi Manuel,

    The ideas is correct but there is a catch here. I will explain with an example aligning with your use case.

    Suppose flash size is 8MB, I am planning to use the first 4MB for FOTA, i.e region A is 2MB and region B is 2MB. Bootseg happens between them. 

    Now I have my code shuttling between 0-2MB and 2MB-4MB.

    Suppose the persistent data is at 6MB, then what happens is that the boot segmentation logic will route this to either 0MB or 2MB. It is mentioned in the TRM that address should not go out side the FOTA region size. If goes out wrap around happens. Access to 6MB wraps around and goes to 2MB. 

    To handle persistent data what could be done is that,

    1. Configure 4MB as FOTA, reset 4MB can be used for persistent data. Access persistent data using 0x6xxx_xxxx memory window so that boot seg does not take place.

    2. If you are comfortable with keeping persistent data inside fota region,

    2.a Configure 8MB (entire flash size) as FOTA, keep persistent data at any place, for example at 6MB i.e in region B. When accessing persistent data always select FSS region B, post access select FSS region A is required. 

    2.b Configure 8MB (entire flash size) as FOTA, keep persistent data at any place, for example at 6MB i.e in region B. When accessing persistent data always select use 0x6xxx_xxxx memory window.

    Please note that FOTA size should be a power of 2.

    Thans & Regards,

    Aswin