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.

MSPM0G3519: Live firmware update (LFU) examples

Part Number: MSPM0G3519
Other Parts Discussed in Thread: MSPM0G3507

Tool/software:

Hi champs,

I am asking this for our customer.

Q1: As there are two flash banks, MSPM0G3519 should be able to do live firmware update (LFU) with reset and without reset. Is it right?

Q2: Would you please show us where to get an example for live firmware update "with" reset? This is also called OTA update in the datasheet below.

Q3: Would you please show us where to get an example for live firmware update "without" reset? 

That is, all running/used preserved globals/statics are kept before, during, and after the firmware update and the compiler is responsible for new global/statics warm initialization.

  • Hi, 

    For the "reset", there are two condition:

    1. Using reset to jump from boot code to app code when startup or update is finished.

    2. Using reset to enable the dual bank swap feature, this reset is called by init_done function in boot code, this feature is related to customer security code.

    Q1: As there are two flash banks, MSPM0G3519 should be able to do live firmware update (LFU) with reset and without reset. Is it right?

    See description above.

    Q2: Would you please show us where to get an example for live firmware update "with" reset? This is also called OTA update in the datasheet below.

    https://dev.ti.com/tirex/explore/node?node=A__APjkYg9RWxwM6nRUc3InzA__MSPM0-SDK__a3PaaoK__LATEST

    BIM is for G3507.

    And CSC is for G3519 dual bank.

    For Dual bank handle, there is a internal demo for your reference.

    But, assert init_done will trigger reset.

    G3519_Bank_Swap_Demo_V2.1.zip

    Q3: Would you please show us where to get an example for live firmware update "without" reset? 

    Just directly jump from boot to app is OK, there is a jump example in BSL code:

    C:\ti\mspm0_sdk_2_04_00_06\examples\nortos\LP_MSPM0G3507\bsl\secondary_bsl_uart

    BSL is for image update and program to Flash, and BIM and CSC is for image management.

    Regards,

    Helic

  • Hi Helic,

    For Q3:

    How can we guarantee the preserved global/static variables are kept in the same memory location before, during and after firmware update?

  • Hi, 

    We can use the variables in boot while running in app.

    Also, directly jump from boot to app will not clear the SRAM, customer can use the fix address to save some parameters.

    And this kind of application depending on customer's requirement.

    Regards,

    Helic

  • Hi Helic,

    In C2000, compiler can support preserved global/static variables by default or uses attribute to handle fix addresses, so the user does not need to handle fix addresses.

    float32_t __attribute__((preserve)) BUCK_update_test_variable1_cpu;

    float32_t __attribute__((update)) BUCK_update_test_variable2_cpu;

    Compiler also has a warm initialization (called __TI_auto_init_warm) to initialize the global/static variables that are new in the new image referring to the old image.

    4.4 LFU Compiler Support in

    https://www.ti.com/lit/pdf/spruiu9?keyMatch=SPRUIU9&tisearch=universal_search

    Does MSPM0 compiler has similar functions?

  • Hi, 

    MSPM0 using ti arm clang as complier, here is the user guide: https://software-dl.ti.com/codegen/docs/tiarmclang/compiler_tools_user_guide/

    I didn't find any preserve function support in this page: https://software-dl.ti.com/codegen/docs/tiarmclang/compiler_tools_user_guide/compiler_manual/c_cpp_language_implementation/attributes/variable_attributes.html

    Also, MSPM0 support gcc from ARM, this is support by arm, you can also refer to ARM's gcc toolchain user guide here:

    https://documentation-service.arm.com/static/5e81ba167225781b57b0352b?token=

    Regards,

    Helic

  • Hi Helic,

    You said "directly jump from boot to app will not clear the SRAM, customer can use the fix address to save some parameters."

    1) When it jumps from boot to app, do you mean there are two projects (boot project and app project) and you mean jumps from boot project to app project entry point _cint00? But since it jumps to _cint00, doesn't it mean the run time support library (RTS) will initialize all global/static variables, which is not desired in LFU without reset. 

    C2000 compiler uses a warm initialization (called __TI_auto_init_warm) rather than _cint00 so that it only initializes these global/static variables in attributes  __attribute__((update)) and keeps __attribute__((preserve)) in the same memory locations without initializing them.

    2) The user uses TI ARM clang. Since TI ARM Clang does not support warm initialization or similar, would you please show us how to write codes to place global/static variables in fixed RAM so that both old and new images can access them? How does the user do to prevent the compiler from initializing them?

    3) How does the user handle different interrupt vectors here? That is, the old image still runs with its interrupts, but the new image runs with its new interrupts. What if there are different interrupts in old and new images? How do we handle switch over here?

    Do we have any doc/example to show these?

  • 1) When it jumps from boot to app, do you mean there are two projects (boot project and app project) and you mean jumps from boot project to app project entry point _cint00? But since it jumps to _cint00, doesn't it mean the run time support library (RTS) will initialize all global/static variables, which is not desired in LFU without reset. 

    Two project, app + boot.

    If there is no variable implemented in this specific are in the app, so c_init_00 won't change this area.

    2) The user uses TI ARM clang. Since TI ARM Clang does not support warm initialization or similar, would you please show us how to write codes to place global/static variables in fixed RAM so that both old and new images can access them? How does the user do to prevent the compiler from initializing them?

    Implement in boot, using these param:

    software-dl.ti.com/.../variable_attributes.html

    Don't implement the variable in app, using fixed address to access them.

    Please seperate some area from SRAM to make sure app won't change them.

    3) How does the user handle different interrupt vectors here? That is, the old image still runs with its interrupts, but the new image runs with its new interrupts. What if there are different interrupts in old and new images? How do we handle switch over here?

    There is a register to set the interrupt vector offset.

    https://dev.ti.com/tirex/explore/node?node=A__APjkYg9RWxwM6nRUc3InzA__MSPM0-SDK__a3PaaoK__LATEST

    BIM is for G3507, there is start_app function in it.

  • Hi Helic,

    Thank you for your information.

    I will discuss with the customer and then discuss you further offline in a real example if needed.