Updating a Block Configuration Using the SmallSectorFee

This document gives a brief description of three types of configuration updates and the impacts. 

  1. New Block is added:

    When a new block is created it will always be added within the static memory layout after the last block within the related partition. There is no shifting of the already configured blocks.
  2. Existing Block is deleted:

    If a block is deleted, the BlockID for the following blocks within the partition are recalculated. This means the location of the blocks within flash change. All these blocks are then not readable or even give back wrong payload data (no identifier is saved within blocks management bytes). 
    • To avoid this problem, do not delete the block, but let it stay as a dummy block (not referenced/used by NvM) representing a gap between two valid blocks within the flash layout. 
  3. Update of FeeBlockSize, FeeNumberOfInstances or FeeNumberOfDatasets.

    An update of the FeeBlockSize and FeeNumberOfInstances may affect the flash location of the following blocks. The easiest way to find out if there is one, is to go into Comfort View of Memory Blocks and check if the summary of Overhead and UserData is not the same as before.

    An update of the FeeNumberOfDatasets always changes flash location for the following blocks within the same partition.
    • If the memory layout for a block is changed, it is recommended to write new data to that block, so it is ensured that no wrong data is given back while reading.
The BlockNumber has no influence on the memory layout. Changes on the BlockNumber are normally also abstracted by NvM, as the NvM block has its own BlockId. Be careful with shared blocks between bootloader and application (see also this article), as the Bootloader may also take care of changed BlockNumbers.
Every SmallSectorFee block has a BlockNumber and a BlockID, which are assigned automatically. The BlockNumber is unique inside the whole configuration and is assigned in ascending order the time the block is created. The BlockID is unique for each partition and is assigned in ascending order the time the reference to a partition is set.

The SmallSectorFee stores blocks inside RH850 data flash on a static addressing scheme, therefore every configured block has its own address range (a block is mapped to flash sectors). The order of the blocks inside the flash is not represented by the BlockNumber but by the BlockID together with the partition start address inside the related partition configuration.

Article ID: 1372
Last updated: 2019-07-03
Revision: 2
MICROSAR and DaVinci -> Troubleshooting -> MICROSAR MEM -> Updating a Block Configuration Using the SmallSectorFee