Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User16819
Level 1
Level 1
Hi all,

Performance Counter Registers on TC297 board works only with connected usb cable on board (i suppose,it is debug mode).


_mtcr(CPU_M1CNT,0);
_mtcr(CPU_M2CNT,0);
_mtcr(CPU_M3CNT,0);
_mtcr(CPU_CCNT,0);

_mtcr(CPU_CCTRL,0|(1<<1)|(2<<2)|(2<<5)|(2<<8));

unsigned int value=_mfcr(CPU_CCNT);


but if i connect power supplier, value is null.

what other register i should configurete for connect without USB cable?

Thank you
0 Likes
2 Replies
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Hi Rombic. Try enabling the On-Chip Debug System with this sequence first:


#include "IfxCbs_reg.h"

// Unlock debug system if it's not already unlocked
if( !(__mfcr(CPU_DBGSR) & 0x1) )
{
CBS_OEC.U = 0xA1;
CBS_OEC.U = 0x5E;
CBS_OEC.U = 0xA1;
CBS_OEC.U = 0x5E;
}

_mtcr( CPU_DBGSR, 1 ); // enable the Core Debug Controller
0 Likes
User16819
Level 1
Level 1
Hi UC_wrangler,

It works! Thank you.
0 Likes