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.

LAUNCHCC3220MODASF: OTA and Secured files

Part Number: LAUNCHCC3220MODASF

Hello all,

I want to verify the data written at the OTA update using the TI example out_of_the_box\ota_archive.c.
The answer in the topic e2e.ti.com/.../cc3235modasf-sl_fswrite---data-consistency inspired me to simply add a call to the function sl_FsRead after the data are written in the state OtaArchiveState_SaveFile.
That results in the error SL_ERROR_FS_FILE_ACCESS_IS_DIFFERENT (-10329L).
Adding an additional FsOpenFlags |= SL_FS_READ to sl_FsOpen results in an security error.
Open Flags set in ota_archive.c:
        FsOpenFlags = SL_FS_CREATE;
        FsOpenFlags |= SL_FS_OVERWRITE;
        FsOpenFlags |= SL_FS_CREATE_NOSIGNATURE;
        FsOpenFlags |= SL_FS_WRITE_BUNDLE_FILE;
        FsOpenFlags |= SL_FS_CREATE_FAILSAFE;

The TI documentation states the the token returned by the function sl_FsOpen can be used to access the file.
In my case that token is always 0.

My questions are:
How can I get the right file token for secured files that are overwritten during the update process, e.g. /sys/mcuflashimg.bin?
Is the behavior related to sl_FsOpen is the same for all secured files, that one signed with an certificate and that ones without signing?

Best regards,
Roman

  • Basically using a digital signature verifies that the content of the file is as expected.

    The tokens are generated at file creation (not upon every sl_Open).

    You can also use you own vendor token (that is given as an input to the sl_Open).

    For files that can be updated in OTA we use the public-write which enables writing without using the token.

    if you are just testing this during development - you can create the file with public-read (don't use this in production as the file can't be considered secure with this flag).

  • Hello Kobi,

    that's what I thought. Many thanks for clarification.
    That's why I chose the file /sys/mcuflashimg.bin. This is overwritten during the OTA update, not newly created.
    As this file is not created by the application/firmware, there is no associated token. This also makes sense to protect the content of this file.

    > Basically using a digital signature verifies that the content of the file is as expected.

    So there is no difference between secured files and signed secured files in terms of access via token, right?

    Best wishes,
    Roman

  • Secure file means that the file is stored encrypted and uses the authorized access (through the tokens).

    The only difference is  whether the file gets authenticated (using signature) when it is written.