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.

CCS/PROCESSOR-SDK-AM335X: XDS200 slows down AM335x processor

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

I have a Beaglebone Black (BBB), connected via XDS200 USB.  I write a simple application that I can time using GPIO and an oscilloscope.  Basically, in pseudo-code:

while (1) {

  SetGPIO();

  ClearGPIO();

  someFunction();

}

I run the identical program on the BBB, once with XDS200 connected, and again without XDS200 (i.e. load program via u-boot).  When the program is loaded and started via the XDS200, it runs 192 times slower than when loaded and started via u-boot.  I've made sure there are no breakpoints or watchpoints set.  What could I be missing?

Thank you!

- Chuan Neng Lee

  Precise Automation, LLC

  • Chuan Lee said:
    When the program is loaded and started via the XDS200, it runs 192 times slower than when loaded and started via u-boot.

    It could be explained by the cache and MMU being enabled when the program is started by u-boot, but not being enabled when started by the XDS200.

    The previous measurements in The so many delta cycles are believable? where the hardware trace analyzer was used to measure the AM335x Cortex-A8 instructions on a program running from SRAM showed:

    - Up to 200 cycles per instruction when the MMU and cache were disabled

    - A few cycles per instruction when the MMU and cache were enabled

    i.e. running 192 times slower is a believable speed difference to be caused by if the MMU and cache are enabled / disabled.

    Does the program being tested take any steps to enable the MMU and cache?

  • The program does not touch the MMU and cache settings. I will attempt to have the program set up the MMU and cache and report back. Is there a way for the XDS200/CCS to do that automatically? Or is that not advisable?
    Thank you!
  • Chuan Lee said:
    Is there a way for the XDS200/CCS to do that automatically?

    In theory GEL scripts could be used to enable the MMU and cache, but existing GEL scripts supplied with CCS don't do that.

    Are you using SYS/BIOS or making use of StarterWare libraries for your program?

    For SYS/BIOS the example projects enable the MMU and cache.

    For StarterWare there are MMUInit(), MMUMemRegionMap() and MMUEnable() functions for enabling the MMU. And the CACHEEnable() function for enabling the cache.

  • I don't use SYSBIOS or StarterWare, but based on your tips and suggestions, that is the avenue I will investigate. Thank you very much!
  • Thank you Chester, by following your suggestion and also setting the MPU speed, the am335x is now running at full speed with the XDS200 connected.