How can I see a variable changing it's value in real-time/ in running state?
How can I plot a variable graph based on time?
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.
How can I see a variable changing it's value in real-time/ in running state?
How can I plot a variable graph based on time?
The FAQ on how to -
Debug / Monitor a variable in running state (see visually if there is a change)
For the memory browser to access the variable, the variable must be global.
If the variable is present in RAM.
You can directly search for the address in Memory Browser.
Otherwise, a Cache write back invalidate needs to be done.
(Refer AM263x MCU+ SDK User Guide → Driver Porting Layer → Cache)/*
* Declare variable globally and get it's address and size
*/
uint32_t counter;
void * addr = &counter;
uint32_t size = sizeof(counter);
/*
* Declared the value of the variable in main function and decrementing it for this example.
*/
counter = 100;
while(counter)
{
counter--;
DebugP_log("Counter: %u\r\n", counter);
CacheP_wbInv(addr, size, CacheP_TYPE_ALL); /* Cache write back invalidate - flush contents of cache to memory so that a DMA or HW peripheral can see the data */
}
As memory access in TCM is pretty fast, add some delay in the code to monitor the variable.
/* Variable in TCM */ uint32_t counter __attribute__((__section__(".tcmVarSection"))); /* * Declared the value of the variable in main function and decrementing it for this example. */ counter = 100; while(counter) { counter--; DebugP_log("Counter: %u\r\n", counter); ClockP_sleep(1); } }
Plot a variable graph based on time
To plot a variable graph based on time.