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.

TMS320F280037C: Enabling coditional watchpoints with specific memory location

Part Number: TMS320F280037C

Tool/software:

Hello,

I've been debugging our CAN application for a while because we encountered the following problem. In the communication loop, there is a bug that appears very rarely and totally random. It seems that one of our messages is sent with an identifier of 0x00 instear of the corresponding identifier. I am quite positive that the message is being wiritten to the MCAN Message RAM with the desired identifier but at some point it changes its value. I would like to discard that anyone is writting in the memory another value and I thought of using conditional watchpoints to point to that specific addres and see if it is written with a value of 0x00.

The problem I encountered is that I am not able to trigger watchpoint if they are pointing to microcontroller registers. I tried with the GPIO DAT registers and tryiying to enable a GPIO in a controlled way, but I was not able to catch it. If the watchpoint points to any variable in our code I can catch the trgger without problems. However, when I try to use the watchpoint for memory locations or registers or RAM I am not able to catch the trigger.

I've been looking for some more information but I have not found anything that could help me. Can you please provide me some help? Also, I would like to try GEL scripts for that watchpoint but I have not found either any tutorial on that matter with examples.

Regards,

David

  • Hi David,

    Which exact version of CCS are you using?

    Thanks

    ki

  • Hello Ki,

    I am currently using CCS 12.2.

    Regards,

    David

  • David,

    You mentioned that it works for variables ok.  I would not expect there to be any difference between setting on the address of a global variable vs setting on another memory address.  For me I am setting the watchpoint directly on the address of one of my variables in this case 0xA80A.  that triggers fine when I write.  I then update the watchpoint to look for a specific value and that also triggers fine. I tried both CCSv20.0.1 and 12.2.0.

    I do see additional properties for data size, maybe that matters?

    What address are you setting the watchpoint on? I am not familiar with how the CAN memory works on this device.  I suspect that we will have to send this back to the device team to comment.

    Regards,

    John

  • Hello John,

    Thank you for your response. It is totally possible that I am not using correctly the mask and value when a specific memory addres is written to specific value. I will try again and will add some pictures of my configuration if I am not succesful. I will try to watch the GPIO SET registers because it will be much easier to undestand.

    In the meantime, regarding the GEL expresion that can be added to the watchpoint, where can I see some examples of usages to undestand better its sintaxis?

    Regards,

    David

  • Regarding your last question, I am trying to set up watchpoints at the RAM message, any direction that is written is valid for me, It is where the messages are stored before being sent. It is configurable so the exact memory location is different for each device. However, it is possible to point to any ram message location with the start address 0x00058000U.

    David

  • David,

    It has been quite a few years since I have tried setting up a GEL condition on a watchpoint (or breakpoint).  One thing to keep in mind is that the evaluation here is happening on the host vs in the device.  i.e. the address and value comparisons of a watchpoint happen on the device, but with the GEL expression the watchpoint trigger a halt, then the GEL expression would be evaluated on the host and depending on if it was true or false we would run the target again.  So it is pretty intrusive on exection. I have use this in the past for poor mans data trace.  Setup a watchpoint with a GEL expression, halt, print the value and then run again.

    Here I have a watchpoint that I put a condition on.  I have a john.gel file that defines a function condition().  For the purposes of the demo I have it take a parameter that I use for the return value which basically determines if the target stays halted or not.

    In this first case I have the condition call with 0.  You can see that it just keeps printing out over and over.

    I then replaced the condition with condition(1). I ran again and you can see that it just output hello 1 once and then halted.

    The screen shots are from CCSv20 but the same functionality is there in 12.2.

    Regards,

    John