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.

RM48L952: CRC calculates random numbers even if there is no data change in the data blocks. Just increased memory of one of the data blocks within range.

Part Number: RM48L952

I am writing to report a critical issue regarding memory allocation and CRC check failure in the FEE RML48l952 device. 
Background : 

 

Normal before change : .In the FEE area we have defined two virtual sectors comprising of one flash sector each (so 0x4000 bytes) , and two Data blocks for two specific sets of data we need to store(copy of which is also going to be in the RAM). The data block sizes are defined based on the actual length of data that we need to store. 

2.The software then periodically runs a CRC comparison between the dataset in the RAM and the data stored in the FEE datablocks for both sets of data. If the CRC check fails then the dataset in the RAM is copied to the FEE to resolve the mismatch. 

 

After change : This logic has been working so far but recently we have had to increase the size of one of the datasets (from length 0x2B58 bytes to 0x34C0) and now the CRC mismatches keep occurring even when there is no change to the datasets in RAM.

The crc check is done first for dataset 1(between designated RAM area and Datablock 1 in FEE) and if found to be wrong then the dataset in RAM gets copied to the FEE datablock 1. Then the check is repeated for the second set of data (between designated RAM area and Datablock 2 in FEE) ) and the data gets copied to FEE Datablock 2 if there is mismatch. The issue we observe after the increase in size for second dataset is that during the next periodic check the CRC check for dataset 1 fails again resulting in another FEE write , and subsequent check for Dataset 2 also fails resulting in an FEE write, and this keeps on repeating. 

 

Observation:

The observations from our investigation seems to indicate that write/read to one Datablock is somehow affecting the other Datablock as well. We have also confirmed that the total size of both datasets is still with in the size of the virtual sector. We think that there might be a size incompatibility issue somewhere in the code, which we may have missed. We have reviewed our code and configurations to ensure that we are adhering to the memory and buffer size limitations and nothing has come up in our review so far.

We would really like some guidance on how to proceed further Slight smile

  • Hi Zubair,

    Is it possible to attach the both the codes (Before increasing size and after increasing size of data blocks), so that i can debug the issue at my end.

    Even you can do a private message to me.

    --
    Thanks & regards,
    Jagadish.

  • Hello Jagdish,
    I have already sent you the changes in private, but for larger audience I am posting it here as well. 
    Before : APPCALRAM  (RW) : origin=0x0801C010 length=0x00002FF0
    After    : APPCALRAM  (RW) : origin=0x0801C010 length=0x00003FF0.

    It works, if we make following changes , possible cause maybe overlapping of data causing wrong CRC check

    * @brief Virtual Sector Configuration */
    const Fee_VirtualSectorConfigType Fee_VirtualSectorConfiguration[TI_FEE_NUMBER_OF_VIRTUAL_SECTORS] =
    {
    
    /* Virtual Sector 1 */
    {
    /* Virtual sector number */ 1U,
    /* Bank */ 7U,
    /* Start Sector */ (Fapi_FlashSectorType)0U,
    /* End Sector */ (Fapi_FlashSectorType)1U                    // changed from 0
    },
    /* Virtual Sector 2 */
    {
    /* Virtual sector number */ 2U,
    /* Bank */ 7U,
    /* Start Sector */ (Fapi_FlashSectorType)2U,                 // changed from 1
    /* End Sector */ (Fapi_FlashSectorType)3U                   // chnaged from 1
    }
    ,
    
    };
    
    
    /* Block Configurations */
    /* SourceId : HL_Fee_SourceId_2 */
    /* DesignId : HL_FEE_DesignId_3, HL_FEE_DesignId_8 */
    /* Requirements : HL_FEE_SR2, HL_FEE_SR3, HL_FEE_SR4, HL_FEE_SR6, HL_FEE_SR85, HL_FEE_SR86
    HL_FEE_SR87, HL_FEE_SR88, HL_FEE_SR89, HL_FEE_SR90, HL_FEE_SR91 */
    const Fee_BlockConfigType Fee_BlockConfiguration[TI_FEE_NUMBER_OF_BLOCKS] =
    {
    /* Block 1 */
    {
    /* Block number */ 1U,
    #pragma diag_push
    #pragma diag_suppress 70 /* Justification: Cast needed to get section size from the linker */
    #pragma CHECK_MISRA("-11.3") /* Justification: Needed to access variables from Addresses.h */
    /* Block size */ (uint16_t)((uint32_t)16384U),         // changed from &__FIRMWARE_CAL_SIZE to  16384U                                                                                      
    #pragma CHECK_MISRA("11.3")
    #pragma diag_pop
    /* Block immediate data used */ TRUE,
    /* Number of write cycles */ 0x8U,
    /* Device Index */ 0x00000000U,
    /* Number of DataSets */ 1U,
    /* EEP number */ 0U
    }
    
    ,
    /* Block 2 */
    {
    /* Block number */ 2U,
    #pragma diag_push
    #pragma diag_suppress 70 /* Justification: Cast needed to get section size from the linker */
    #pragma CHECK_MISRA("-11.3") /* Justification: Needed to access variables from Addresses.h */
    /* Block size */ (uint16_t)((uint32_t)16384U),        // changed from &__FIRMWARE_CAL_SIZE to 16384U
    #pragma CHECK_MISRA("11.3")
    #pragma diag_pop
    /* Block immediate data used */ TRUE,
    /* Number of write cycles */ 0x8U,
    /* Device Index */ 0x00000000U,
    /* Number of DataSets */ 1U,
    /* EEP number */ 0U
    }

  • Hi Zubair,

    I have already sent you the changes in private, but for larger audience I am posting it here as well. 
    Before : APPCALRAM  (RW) : origin=0x0801C010 length=0x00002FF0
    After    : APPCALRAM  (RW) : origin=0x0801C010 length=0x00003FF0.

    On your RAM side you are just increasing the memory of 0x1000 only that is 4KB. So is it really necessary to change the huge changes on FEE side?

    I mean earlier you just configured each virtual sector to 16KB of one physical sector but now you increased that to the 32KB by combining two physical sectors into one virtual sector.

    So, it is just a 4KB block increasing on RAM side, so why don't you keep same settings on FEE side and do the test.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,
    Thanks for answering, we already did that, that was the first impression but it failed.

  • Hi Zubair,

    I need your complete project or any other simplest project to debug this issue at my end. Otherwise it would be very difficult to find out root cause from above information.

    --
    Thanks & regards,
    Jagadish.