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.

MSP430 + Clock Tick Suppression

Other Parts Discussed in Thread: MSP430F5437A, SYSBIOS

Hi,

I am using the SYS/BIOS for MSP430F5437A and trying to utilized the dynamic clock tick (to reduce the power consumption).

There are three task running, one task goes to sleep for 1000 ms and other two tasks are blocked until an external interrupt (HWI) occurs.

The clock module is configured to use ACLK (32768 Hz) with Timer ID 0. The tick period is set to 1000 uS. The CPU is running at 4 MHz ( 3997696 Hz to be exact). The system goes to LPM4 when possible.

It appears that when Task_sleep() is called, it messes up the clock timing as a result for a 1000 ms wait, it take about 3000 mS.

I have read the SYS/BIOS documentation about the MSP430, which talks about the clock tick suppression and possible issues. But I don't have any SWI and the HWIs are also not doing anything long (completes in 10s microseconds).

I have tried to eliminate everything by just having the clock module running and only have one active task which sleeps for 1000 ms in a loop then toggle a LED and go back into the sleep. Even this simple code having the issue where the sleep takes around 3000 seconds (instead of 1000 seconds).

When I used the clock in periodic mode (instead of dynamic) mode the Task_sleep seems to be working OK, but obviously I loose the power savings.

Any help would be appreciated with resolving this issue.

Thanks.

  • projecta98,

    We just discovered and fixed a bug (ID = SDOCM00095450) in the computations to determine the next needed Clock tick in dynamic mode.  It did not manifest in the complicated timing test cases we have in our test suite, but did in some simple tests, if they were run long enough.  I’m not positive this is what you are seeing, but it probably is.

    The fix for this bug is available in the new SYS/BIOS 6.34 release available here: http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/6_34_00_12/index_FDS.html  The companion XDCtools release is available here: http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/3_24_01_29/index_FDS.html

    Can you please upgrade to these newer releases and see if this resolves the issue for you?

    Thanks,
    Scott

  • Scott,

    I updated the sys/bios & xdctools and I can confirm that the updated tools are being used in the console (during the build process). But my issue is still not resolved.

    I am going to setup a simpler project (with just couple of tasks) and if I can reproduce the problem, I'll post that here.

    BTW, after the update, I am unable to use the GUI to manage the .cfg file. When I double click on the cfg file, it its me the following error: "An error had occurred. See error log for more details."

    I don't know where that error log is located. Note that I am using CCSv4. I wonder if the sys/bios and xdctools updates are not compatible with CCSv4.

  • projecta98,

    OK, thanks for the update.  Yes, please post your app so I can look at it...  

    Yes, these new releases require CCS 5.2 or later.

    Scott

  • After some investigation, I found that the issue was due to earsing the flash sector. We use some of the flash to store data. Once the data memory is full, we start erasing the older data (i.e. flash sector of 512 bytes is erased). It turns out that the erase process take around 20ms to erase a sector of 512 bytes, which was causing the ticks to miss.

    Since, we require very precise 1 second tick, I have enabled the RTC timer (on MSPF5437A) to generate the necessary timing manually. And I have also removed the clock and timer objects from the SYSBIOS, because I'll be providing the timing function myself. But the compiled application still has the TimerA0 initialized and ticking. How can I disable the OS generating this timer object?

    I have tested the code to be working by simply disable the capture&compare interrupt, but I would like not even have the OS generate the timer object at all.

    Since, I have only one task and two long running SWIs I don't need the timer tick (I think).

  • If you don't need any of the Clock module's features, you can disable it altogether by adding the following to your config script:

        BIOS.clockEnabled = false;

    This will suppress the creation of the Timer instance used by the Clock module.

    Alan

  • projecta98,

    OK, thanks for reporting back.

    You can add the following text to the application .cfg file to disable use of the Clock module:

    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    BIOS.clockEnabled = false;

    Or if you are using the XGCONF graphical tool, you can click on “System Overview”, then the box for the “BIOS” module.  In those configuration parameters uncheck the box “Enable Clock Manager”.  

    This will result in the following:
    - Static Clock creation will result in a fatal build error.
    - No Clock Swi is created.
    - The Clock_tickSource is set to Clock_TickSource_NULL to prevent a Timer object from being created.
    - For APIs that take a timeout, values other than NO_WAIT will be equivalent to WAIT_FOREVER.

    This is described in the cdoc for BIOS.clockEnabled, in the file docs/cdoc/ti/sysbios/BIOS.html of the SYS/BIOS install.

    Thanks,
    Scott