Need to be able to see cycle counts in KDS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need to be able to see cycle counts in KDS

922 Views
ve3id
Contributor III

Hi,

 

I am teaching a third-year college computer engineering course in micro controllers.  I have just migrated from the 9S12 using Codewarrior to KDS 3.2.0 using the FRDM-K64F and SDK 2.1.

 

Part of the course discusses cycle times for each assembly instruction, and with codewarrior I could demonstrate this in action by using the simulator.

 

I cannot find any similar tool in KDS.  Can anybody point me to a way to do this?

 

cheers,

Nigel Johnson

Labels (1)
0 Kudos
3 Replies

586 Views
BlackNight
NXP Employee
NXP Employee

Hi Nigel,

there is the QEMU simulator which supports the ARM Cortex, see The GNU ARM Eclipse QEMU. I have not really used it (yet), that was definitely I was looking for using in my own course.

As an additional pointer: the M3/M4 core has a hardware cycle count register you could use (see ARM Information Center  as reference). It is used eg. it in the Segger SystemView (see ) as time base to measure the time between API calls and events (see Segger SystemView: Realtime Analysis and Visualization for FreeRTOS | MCU on Eclipse ). If you are using it in software, make sure you have turned on the debug block on the device.

I hope this helps,

Erich

0 Kudos

586 Views
ve3id
Contributor III

Eric, I have Embedded Systems register View installed, I am not sure if I followed your instructions or if it is now standard (I am getting punch drunk after working on this for so long :-)  but I cannot see the DWT_CYCCNT register.  I have expanded all the groups in EmbSys Reg view and nothing.  Any ideas?  I am getting desparate since i have to have a lab converted to the K64F by Tuesday and I had no idea it was going to be so difficult to find cycle counts!

I also downloaded the simulator but it only works for ST micro implementations!

cheer,

Nigel

0 Kudos

586 Views
BlackNight
NXP Employee
NXP Employee

Hi Nigel,

the CMSIS-SVT files delivered with the EmbSysReg do not include most of the ARM core registers, mostly the vendor specific ones.

I have an article posted (link below) how you could do cycle counting and inspect the value in the debugger:

Cycle Counting on ARM Cortex-M with DWT | MCU on Eclipse 

I hope this helps,

Erich

0 Kudos