This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PC Sample output via SWO pin in nrf52832

Hi, well the question says it all - I am trying to get the Program Counter samples sent out of the SWO pin on the nrf52832.

Use Case: I am trying to measure the power consumption of our custom board utilizing nrf52832 and synchronize it with the PC samples (code that is executing at that point in time and the power consumed). I know this approach is not highly accurate - well something is better than nothing.

What I already tried I configured the SWO pin for output - I can see the output from SWO (the printf style using ITM_SendChar)

Now I tried enabling the PC sample output on the DWT->CTRL register and its not giving any output.

DWT->CTRL = 0x400113FF;

Do I need to do anything more to get it working? Any pointers would be greatly appreciated.

Parents
  • Unfortunately no and I am still stuck on this one.

    In the meantime, I am just measuring the power consumption by modifying the software to just do 1 functionality at a time - which is proving to be too time consuming and also will take me only so far. The dynamic behavior when all the functionalities comes together is something I would need in the near future - for which I either need to figure out how to get the PC samples through SWO or move to the costlier option of trace probes (Jtrace, utrace etc..) and I hope it will not come to that.

Reply
  • Unfortunately no and I am still stuck on this one.

    In the meantime, I am just measuring the power consumption by modifying the software to just do 1 functionality at a time - which is proving to be too time consuming and also will take me only so far. The dynamic behavior when all the functionalities comes together is something I would need in the near future - for which I either need to figure out how to get the PC samples through SWO or move to the costlier option of trace probes (Jtrace, utrace etc..) and I hope it will not come to that.

Children
No Data
Related