I can't find information about EVENT configuration in PMC for e200z4 mpc. I want activate number of clocks. Can you help me.
I try use this code for read processor cycles according this information about event https://www.nxp.com/docs/en/reference-manual/e200z760RM.pdf and examples https://www.nxp.com/docs/en/application-note/AN4341.pdf
But it is not working getPMC16 got r3=0, Can you help me.
.global getPMC16UserMode.globl getPMC16.global disableCounters.global enableCounters.global enableCpuCounter.global testPM.align 4getPMC16: mfpmr r3,16 se_blrgetPMC16UserMode: mfpmr r3,0 se_blrdisableCounters: e_lis r3,0x8000 e_or2i r3,0x0000 mtpmr 400, r3 se_blrenableCounters: e_lis r3,0x0000 e_or2i r3,0x0000 mtpmr 400, r3 se_blrenableCpuCounter: e_lis r3,0x0000 e_or2i r3,0x0100 mtpmr 144, r3 se_blrtestPM: e_bl disableCounters e_bl enableCpuCounter e_bl enableCounters e_bl getPMC16 e_nop e_nop e_bl getPMC16 e_bl disableCounters se_blr
which device do you have exactly?
It looks like this is wrong:
enableCpuCounter: e_lis r3,0x0000 e_or2i r3,0x0100 mtpmr 144, r3 se_blr
EVENT must be set to '1' if you want to count Processor Cycles. So, the value should be 0x00010000:
enableCpuCounter: e_lis r3,0x0001 e_or2i r3,0x0000 mtpmr 144, r3 se_blr
If I do this modification in my debugger, I can see that the counter is working when I step some code.
By the way, what kind of debugger do you use? It may be necessary to change default settings. From Lauterbach debugger:
It's not working. The problem stills, Unfortunately, i don't have Lauterbach debugger. i use OpenSDA. what i should write to EDBRAC0 register for activate performance monitor?
I checked it using OpenSDA. The problem is that EDBRAC0 can't be changed in this debugger. Or I didn't find such option, at least.
The only way is to test this feature without debugger - send the results out using serial interface or something like that. It works as expected in normal mode when debugger is not attached.
It's work without debugger with UART.
I found description for EDBRAC0, but other architecture https://www.nxp.com/docs/en/reference-manual/E6500RM.pdf
initDbg: e_lis r3,0x4000 e_or2i r3,0x0108 mtspr 638,r3 se_blr
but have exception on mtspr, i suppose number of register is wrong 638. Do you have specification for e200z4?
it's not possible to write this register by software:
Only debugger can do that. But such option must be implemented in the debugger - and this seems to be unavailable in S32DS debugger.
Retrieving data ...