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.

TMS320F280049: Triggering NMI interrupt when calling Fapi_setupFlashStateMachine

Part Number: TMS320F280049

Hi expert,

My cutomer find NMI interrupt is triggered when calling flash API Fapi_setupFlashStateMachine in RAM. When this error happens, RESC register shows value of 0xC0000004 while not NMI event is logged in register:

R NmiIntruptRegs_NMICFG 0x0000000F 0x0001
R NmiIntruptRegs_NMIFLG 0x0000000F 0x0000
R NmiIntruptRegs_NMIFLGCLR 0x0000000F 0x0000
R NmiIntruptRegs_NMIFLGFRC 0x0000000F 0x0000
R NmiIntruptRegs_NMIWDCNT 0x0000000F 0x0000
R NmiIntruptRegs_NMIWDPRD 0x0000000F 0xFFFF
R NmiIntruptRegs_NMISHDFLG 0x0000000F 0x0000

The assembly code they are stopping at shows:

Could you provide us with further steps to debug this issue?

PS: Based on current findings, by adding some random code, this issue will not occur. This issue is also dedicated to happen when boot code load the app code to flash. 

Thanks

Sheldon

  • Sheldon,

    Based on the note at the end, you mean to say that the issue will not occur if the code is loaded by CCS.  And will occur only if their custom boot code loads the app code to flash - Correct?

    If yes, could you ask them to check whether ECC is programmed correctly or not.  

    After loading app code in to flash, they can load a simple code in to RAM that reads the entire flash with ECC enabled.  This will tell whether there are any ECC errors or not (errors get captured in the flash ECC registers and NMI will occur for double bit errors).

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    Some additional information from custoemer:

    1. This issue is hardly seen but once happened, it can be 100% reproduced. Adding or deleting unrelated code randomly can make it not happen. But this issue can be seen in future development. (This is the second time they met this)

     

    We are checking:

    1. If it is related to compiler version.

    2. Does program always fail here or have success with this function call once before the failure.

    Quick question for you:

    Could they check if it is ECC error by clear ECC_ENABLE?

    Thanks

    Sheldon

  • Hi Vamsi,

    This issue happens on compiler 18.12.3 LTS while same code will not have issue (or reproduce this issue with same source) on compiler version 18.1.4 LTS.

    Their APP code wait for CAN frame to wirte calibration data in blank flash sector. This operation can be done with success for the first time while fail for the second time. (get the error or phenomenon I mentioned in the first post)

    Thanks

    Sheldon

  • Sheldon,

    Regarding your question "Could they check if it is ECC error by clear ECC_ENABLE?": ECC should be enabled by writing 0xA to this register before they read the flash with ECC enabled. 

    Couple of things to check:

    1. If watchdog is enabled, is it serviced regularly in their application as needed?

    2. Did they map the flash API library and the functions that call flash API library to RAM for execution or not?  They must be executed from RAM.

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    May I kindly know if NMI caused by ECC error will not be flagged in registers? Is there any other possibilities could cause a NMI without any evidence in registers?

    Thanks

    Sheldon

  • Sheldon,

    It should be flagged in the registers.  I will assign this to our system expert to help you further.

    Thanks and regards,

    Vamsi

  • Sheldon,

    If you are halting the CPU execution in NMI handler then RESC value should not matter because in that case reset did not happen because of NMI and you should see some flag getting set in NMIFLG register. I am assuming customer has NMI handler as part of their application code. Right ?

    Regards,

    Vivek Singh

  • Hi Sheldon,

    Let is know if there any further queries on this topic.

    Regards,

    Vivek Singh

  • Hi Vivek,

    This issue has been closed. My customer didn't put flash API library itself in the RAM, though it not always causes a problem.

    Thanks

    Sheldon

  • Sheldon,

    Thank you for the confirmation.  That is the reason I asked whether it is mapped to RAM or not.  It does not cause problem all the time - issue will appear in corner cases.

    Thanks and regards,
    Vamsi