Hi
I'm looking for some assistance with regards to the operation of the PMU on my TMS570LS1227.
I'm using the PMU Code generated by Halcogen version 4.05.01, I have no MPU regions enabled and all my code is running in privileged mode (I haven't set user mode at all after the Halcogen generated startup routine).
I'm doing the following in the HW Initialisation Routine:
_pmuInit_();
_pmuEnableCountersGlobal_();
_pmuSetCountEvent_(pmuCOUNTER0, PMU_CYCLE_COUNT);
Then around code that I wish to profile I'm using the following macros:
#define START_PMU_COUNTER(var_prefix) \
{\
_pmuResetCounters_();\
_pmuStartCounters_(pmuCOUNTER0);\
var_prefix##_cycles_start = _pmuGetEventCount_(pmuCOUNTER0);\
}\
#define END_PMU_COUNTER(var_prefix) \
{\
uint32 temp;\
_pmuStopCounters_(pmuCOUNTER0);\
var_prefix##_cycles_end = _pmuGetEventCount_(pmuCOUNTER0);\
temp = var_prefix##_cycles_end - var_prefix##_cycles_start;\
if(var_prefix##_total_cycles < temp)\
var_prefix##_total_cycles = temp;\
}\
The variables that come out of this are always zero. Further I have attempted to use the _pmuGetCycleCount_() routine but this also always returns zero.
I should mentioned that I have based all of this off the application note for Hercules uCs found on the tms570ls1227 page.
Any assistance would be greatly appreciated.