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/CC2642R: How to measure runtime RAM usage

Part Number: CC2642R
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

Hi,
we’re developing a product using CC2642 and need to measure RAM allocation in runtime, to evaluate max number of connected BLE devices.

Stack we use:
HW: CC2642/CC2652 Development board
IDE: CCS 8.3.0 or CCS 9.0.0
SDK: simplelink_cc13x2_26x2_sdk_2_40_00_81
XDC: xdctools_3_51_01_18_core

Use case: Run TI example app “simple central” on CC2642/52 DevelopmentKit and measure runtime RAM usage.


Tools we tried:

Memory allocation: This is just static analysis of project's code, no real time RAM usage...

 

RTOS Object View (ROS): While application runs, there's no data ("Target Running" message is shown). After debug pauses, we get this message, instead of detailed table.

 

Runtime Object View (ROS2): We had big bet on this one.. But it also doesn't work as expected. Not all charts are working as is obvious from the image. Stack Space also works just after application run, and then not anymore. We can't trust this statistic.

 

Memory Browser: Thanks God, this works. We can check manually RAM memory space (0x20000000 - 0x20013FFF). And manually estimate RAM usage (and hopefully not make any error). But really?? TI doesn’t have better tool?

 

Question: How to simply see RAM usage statistics in runtime, in order to evaluate MCUs resources? We went through all the forum posts and guidelines and this is actually outcome which we have. The only working solution is MemoryBrowser, any of other tools isn't working (not even a little bit).

Is it possible that is something set bad? We have completely clean installation of all packages and IDEs and experience was the same.

I hope you answer this question clear here. It will definitely help to all others facing the same issue in future!

Thanks

Kind Regards

  • ROV2 should be working. You need to have it read the data at some rate. Did you hit the continuous refresh button?

  • Thanks for reply.
    Of course I used continuous refresh.

    Btw, also in ROV2 when we wanna see e.g. "Task" widget, we get the same error message as in ROV1 ("Target memory read failed ..." as is seen on image)
  • Branislav,

    It looks like you're running into a known issue with ROV2, HeapCallback, and the simplelink_cc13x2_26x2_sdk.  The root of the issue is

    • ROV2 won't read memory that it believes is invalid (on some targets, reading memory mapped registers corrupts the target's state)
    • ROV2 gets memory map information from several sources:
      • the ELF sections of the executable that's currently loaded,
      • the runtime Heap managers except HeapCallback, and
      • special symbols typically defined in the application's linker command file (__ROV_VALID_RANGE<num>_start__ and __ROV_VALID_RANGE<num>_end__)
    • in some configurations, the BLE stack uses HeapCallback but does not (yet) define the special ROV symbols in the example projects

    You should be able to workaround this issue by adding the following lines  to your linker command file:

    __ROV_VALID_RANGE0_end__   = 0x20013FFF;
    __ROV_VALID_RANGE0_start__ = 0x20000000;

    dave

  • Thanks Dave! I've update on your reply.

    1. Can you give us link to the Known Issues of the SDK with workarounds? 
      1. SDK 2.40 CC13x2_26x2 claims no Known Issues here
      2. do you refer to some older SDKs? If so, can you provide links?

    2. Your workaround for ROV2 works! Not completely, but there's progress 
      1. We get the StackSpace chart, also Tasks widget can be used now, with some meaningful information. Thanks for the advice!



      2. Why do you think the CPU Load and Heap are still without information? I checked raw ROV data, and they have no data. How can this be resolved?
      3. ROV1 is still not working, but that's not a big deal, since we can use ROV2

  • Branislav Stupak said:

    2. Why do you think the CPU Load and Heap are still without information? I checked raw ROV data, and they have no data. How can this be resolved?

    ROV can't provide heap information from heaps managed via HeapCallback; HeapCallback simply delegates all heap allocs/frees to application specific code which ROV has no knowledge of.  As a result, stacks that use HeapCallback need to provide a separate ROV2 view of this part of the system.

    FWIW: Although you can't get heap usage from ROV2 for HeapCallback, you should be able to get this information from within the application via the Memory_getStats() API.  If you call this periodically within you application and save the usage information to a global variable, it's possible to create a plot of the variable using ROV2.

    As for CPU load, I'm not sure.  It's possible that your configuration simply hasn't configured SYS/BIOS to include the ti.sysbios.utils.Load module.  Check the left-pane module list for a "Load" module.  If it's not there, you need to change the application's .cfg script to use the ti.sysbios.utils.Load module.

    There are multiple ways of adding the Load module; perhaps the simplest is just adding the following line to the application's .cfg script:

    var Load = xdc.useModule('ti.sysbios.utils.Load');

  • Additionally regarding the CPU Load, do you have BIOS.logsEnabled set to true? You can check this in ROV by looking at the BIOS Raw view, under the Module Configuration Parameters.
  • Did this get resolved?

    Todd