SPRADN2 January   2025 MSPM0G1518 , MSPM0G1519 , MSPM0G3518 , MSPM0G3519 , MSPM0L1227 , MSPM0L1228 , MSPM0L2227 , MSPM0L2228

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Nonvolatile Memory (NVM) Basic Introduction
    1. 1.1 Flash Memory Protection
  5. 2Customer Secure Code (CSC) Introduction
    1. 2.1 CSC Execution Overview
    2. 2.2 CSC Memory Maps
    3. 2.3 CSC Execution Process
  6. 3Bank Swap Example Implementation
    1. 3.1 CSC Code Project Preparation
      1. 3.1.1 Enable CSC in NONMAIN
      2. 3.1.2 Implementation of CSC Application Code - Bank Swap Feature
    2. 3.2 Application Code Project Preparation
  7. 4Common Use Case Introduction
  8. 5Data Bank Introduction
    1. 5.1 Data Bank Protection
    2. 5.2 Data Bank Erase Write Operation
  9. 6Summary
  10. 7References

Bank Swap Example Implementation

In dual-bank or quad-bank devices, based on which bank (or pair) is executable, that bank (pair) gets readexecute privileges and loses write or erase privileges. The other bank (or pair) is readable, and writeable but not executable. This mechanism enforces the policy that any firmware update can only be saved in the writeable bank in the current session but can never be executed. Upon a subsequent BOOTRST, the CSC runs and needs to authenticate the update and decide if the updated image needs to be made executable. If the updated image exists in Upper bank, then configure USEUPPER to 1. If the updated image does not exist in Upper bank, then no other action is needed. When the CSC issues INITDONE, this bank-swap takes effect, swapping the execution or write privileges of the upper and lower banks and re-mapping the upper bank (or pair) to the lower half of the flash memory address space and re-mapping the upper bank (or pair) to the upper half of the flash memory address space.

Dual bank swap function is part of CSC function and follows CSC execution sequence describes in former chapter. On the application side, customers usually need to prepare the projects below to achieve bank swap function.

  1. CSC code project.
  2. Application code project in Bank0/1.