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.

TMS320F280039C: Erad Module Ref Register garbage value

Part Number: TMS320F280039C


Hello 

the erad module is configured to fire a NMI when the stack pointer reaches a certain address which is defined in the Ref register shown in the attacehed photo, the problem is that : the behavior of that register is not stable sometimes it got the configured value right and the stack overflow testing using recurssive function passes but sometimes that register is loaded with a garbage value that doesn't even fall between the stack boundaries.
so the question is :what is causing that unstable behavior in that register ? 

Mahmoud

  • Hello Mahmoud,

    This is hard to answer without seeing the code that configures the ERAD and your test sequence.

    Also, for clarity: Is the issue that you sometimes read the register and get a garbage result, or is the issue that the interrupt is being fired even though the stack overflow condition has not yet happened?

    Does your test function call any other external function (e.g. driverlib)?

    Best regards,
    Ibukun

  • Hello Ibukun,

    the configuration and testing used were the same as in the Erad Example in the driverlib "erad_ex3_stack_overflow_detect"

    Also, for clarity: Is the issue that you sometimes read the register and get a garbage result, or is the issue that the interrupt is being fired even though the stack overflow condition has not yet happened?

    i don't read the register value from the code i just view it in the registers tab, 
    when the reference address register is set with the right value the recursive function reaches that address in the stack and the NMI fires without any problems, the problem happens when the reference address register is set with a garbage value, that garbage value is there from the start of the code in the main function and doesn't change when calling the ERAD_enableinterruptOnaddressHit() but on the other hand when i flash the Microcontroller and the register value is zero that is when the ERAD_enableinterruptOnaddressHit()  is going to work properly. 


    Does your test function call any other external function (e.g. driverlib)?

    No, just used the same simple recursive function used in the example, didn't call any external functions.

    i saw some TI threads about a similar problem here 
    e2e.ti.com/.../ccs-tms320f28388d-erad-module-register-unable-to-write-with-eallow


     

    do you think it is a debugger problem ? if it is a debugger problem just like he says, how to handle it ? 

    thanks 

    Mahmoud, 

  • Hello Mahmoud,

    What version of CCS are you running? The bug you referenced was fixed in CCS 11.1.

    In any case, check that the GLBL_OWNER register is set to 0x0 to confirm that ownership is not locked to application or debugger. If it is set to 0x2 for instance, the application will be unable to configure the watchpoint because the debugger has grabbed ownership of the ERAD module.

    Best regards,
    Ibukun