This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to profile on ARM Core?

I am trying to use the "Profiler" to analyze the running time of a task function in my application. The application is developed in CCS v5.5 with the ARM core of F28M35H52. But I found the Run->Clock->Enable was grey and the “Profile Setup” gave a warning notice “Unable to enable activity”. I used two GP timers in the application. So what should I do to profile or is there something wrong in my configuration?
  • Is your hardware a TI development kit? Else, which emulator are you using? 

    Regards,

    Gautam

  • No, the hardware is designed by ourselves and the emulator is SEED-XDS560PLUS.
  • Unfortunately the profile clock is not supported Cortex Mx. You can use one of the timer peripherals for benchmarking.

  • { TimerInit(1000); unsigned long start = 0; unsigned long end = 0; int k = 0; start = TimerValueGet(TIMER1_BASE, TIMER_A); TimerEnable(TIMER1_BASE, TIMER_A); while(k < 300000) { k++; } end = TimerValueGet(TIMER1_BASE, TIMER_A); TimerDisable(TIMER1_BASE, TIMER_A); end = (end - start) / 60000; } void TimerIntHandler(void) { //Clear the timer interrupt. TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT); } void TimerInit(unsigned long timeInterval) { TimerCnt = 0; HWREG(SYSCTL_MWRALLOW) = 0xA5A5A5A5; SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1); IntMasterEnable(); TimerConfigure(TIMER1_BASE, TIMER_CFG_32_BIT_OS); TimerLoadSet(TIMER1_BASE, TIMER_A, SysCtlClockGet(SYSTEM_CLOCK_SPEED) / 1000 * timeInterval); IntEnable(INT_TIMER1A); TimerIntEnable(TIMER1_BASE, TIMER_TIMA_TIMEOUT); IntRegister(INT_TIMER1A, TimerIntHandler); } This is the code I try to get the time consume of the while loop. The breakpoint is set on the last line. I set the M3 core clock in 60MHz, and the ‘end’ finally was 480. It means the while loop takes about 480ms. The loop takes seven assemble instructions showed in disassembly windows. In theory it should only takes 7 * 300,000 / 60M ~= 0.035(in sec), which is nearly one tenth of actually. I increased the loop times from the 300,000 to 30,000,000, (set the parameters timeInterval larger in case entering into the interrupt when time out) the result is 48359ms, which is nearly the same as the actual time lapse of the computer system time. Based on above, I suppose the timer gave the right value. But I don’t know why the loop takes so long time? PS: Why there is no line feed after I post my question?

  • Why the format after post is wrong?
  • Do not use Internet Explorer. Firefox or Chrome do a better job.

    Martin