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.

RTOS/MSP432P401R: When using Timestamp_get32(), what is the default clock source and how do you modify it?

Part Number: MSP432P401R

Tool/software: TI-RTOS

As of now, using the P401R LP and adding Timestamp module to the .cfg file, I get an 85% (or higher) CPU load where it should be less than 1%. I saw this on the CC2650 earlier and it was due to Timestamp defaulting to RTC (ACLK) at 32KHz.

For MSP432P401R, when you add Timestamp to the .cfg file, which clock is it using by default and how to you modify the clock source if needed? I suspect it is using ACLK (32KHz) because it is showing 85%+ CPU usage and I need to use SMCLK running at CPU Frequency.

For the CC2650, adding THIS line to the .cfg file fixed the problem:

Timestamp.SupportProxy = xdc.useModule('ti.sysbios.family.arm.m3.TimestampProvider');

I tried this...but it didn't work like it did for the CC2650. I do see the "Clock Freqs" module the reports ACLK=32768, SMCLK=3MHz, HSMLCK = 3MHz, while the BIOS Runtime clock freq reports the default as 48MHz. This is a bit confusing as well.

This project was derived from the SDK, TI driver, empty project along with its dependent BIOS project. So this is what the release.cfg file was reporting to me with no modifications.

Thanks,

  • Eric,
    I would expect the default to be RTC as you suggested. I will forward your question on to our RTOS team and get back to you.
    Regards,
    Bob L.
  • The MSP432P default timestampProvider delegate is ti.sysbios.family.arm.m3.TimestampProvider module. By default it brings in the ti.sysbios.family.arm.m3.Timer (SysTick Timer). This is different from the CC2650. Adding that extra line didn't do anything for the MSP432P since that is already the default.

    Now the default Timer delegate is the 32Khz Timer (which is different from what the TimestampProvider is using). So I'm not exactly sure why you are seeing the 85%+ CPU usage. I will need to investigate this further. If you look at the MSP432P401R launchpad documentation it does list the default clocks for ACLK, SMCLK, and HSMLCK just as you listed above and the crystal as 48 Mhz.
  • I had problems posting this response below. So I just typed "test" and it worked. Another mystery. ;-)

    I tried the mailbox SYS/BIOS example which is 99% IDLE and I got 97% CPU usage. The execution graph shows IDLE dominating. Do you see the same thing on your end? Something is wrong.

    Let me know if you see the same thing on your end. If not, then it is a problem with my CCS/setup.

    Thanks,
  • Eric,

    I think we know what's causing the high CPU load.  Its because the chip is going into low power.
    CPU load calculation uses the number of times the idle loop ran within a given period.
    When the chip goes into low power, the the idle loop is not executed very often causing the CPU load to appear very high.
    Its not recommend to use CPU load with power enabled.  You can disable the Power policy by modifying the following config in your board.c file:

    const PowerMSP432_ConfigV1 PowerMSP432_config = {

        .policyInitFxn = &PowerMSP432_initPolicy,

        .policyFxn = &PowerMSP432_sleepPolicy,

        .initialPerfLevel = 2,

        .enablePolicy = false,

        .enablePerf = true,

        .enableParking = true

    };

    Hope that helps.

    Judah

  • Yes. That is it. Thanks Judah. I had to turn power policy off in the past for different reasons...and this one makes perfect sense. I turned it off and re-ran the code. It shows less than 1% CPU usage. Perfect. Is there something in a readme or a doc that could tell users to not mix CPU load and power policy = "true" ? I would think many users may end up seeing the same thing I did and get confused. Or even a pop-up (or one sentence blurb on the CPU load graph...or in the UIA setting for CPU Load) - to warn users.
  • Eric,

    The following paragraph was taken from the ti.sysbios.utils.Load module's cdoc:

    Power Management Enabled outside of SYS/BIOS
    Some targets have Power management support outside of SYS/BIOS. For example, CC3200 and CC26XX devices have Power management in TI-RTOS. In these cases, the best way to get CPU load is to make sure that taskEnabled is set to true. Then the CPU load will be calculated as 100 - the idle task load. However, for BIOS in ROM builds, this method will not work, as Task hooks are not allowed. So to use Load for any devices that support BIOS in ROM builds, make sure the ROM build is disabled.

    You should try it with the Power policy enabled to see if that works for you.

    Judah

**Attention** This is a public forum