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/MSP430FR5994: Invalid CIO command when Setting Clock

Part Number: MSP430FR5994
Other Parts Discussed in Thread: MSPDRIVERLIB

Tool/software: Code Composer Studio

I get the following output (as expected) when I set the clocks using the attached code.

Configuring clocks ... 
Verifying clocks ... 
MCLK_Frequency: 8000000 
SMCLK_Frequency: 8000000

If I use the commented "CS_initClockSignal" line instead of the one following it I get the following output.

Configuring clocks ...
Invalid CIO command (24) in the CIO buffer at address (0x4000) was not recognized. Please check the device and program memory maps.
Invalid CIO command (24) in the CIO buffer at address (0x4000) was not recognized. Please check the device and program memory maps.
Invalid CIO command (24) in the CIO buffer at address (0x4000) was not recognized. Please check the device and program memory maps.

I expected to get the following output.

Configuring clocks ... 
Verifying clocks ... 
MCLK_Frequency: 16000000 
SMCLK_Frequency: 8000000

The code works properly when I run it in a different program but does not work properly in this program.  Any help would be appreciated.

#include <msp430.h>
#include "driverlib.h"
#include "gpio.h"
#include "stdio.h"
#include "string.h"

int main(void)
{

    WDT_A_hold(WDT_A_BASE);        // Stop watchdog timer 

// Configure and verify clocks.

// ********** Cannot use CS_CLOCK_DIVIDER_1 for some reason for MCLK - works in another program though ********

    printf("Configuring clocks ... \n");

    CS_setDCOFreq(CS_DCORSEL_1,CS_DCOFSEL_4);                                 // 16 MHz
    CS_initClockSignal(CS_SMCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_2);         // 8 MHz
//    CS_initClockSignal(CS_MCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_1);          // 16 MHz
    CS_initClockSignal(CS_MCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_2);          // 8 MHz

    CS_turnOnSMCLK();

    printf("Verifying clocks ... \n");

    uint32_t MCLK_Frequency;
    uint32_t SMCLK_Frequency;

    MCLK_Frequency = CS_getMCLK();
    SMCLK_Frequency = CS_getSMCLK();

    printf("MCLK_Frequency:  %ld \n",MCLK_Frequency);
    printf("SMCLK_Frequency: %ld \n",SMCLK_Frequency);


    while(1) {;}

}

  • I am unable to reproduce the issue, either with TI's example or your own. What version of MSPDRIVERLIB are you using and have you considered upgrading to the latest? Can you identify the differences between the programs that causes the issue?

    Regards,
    Ryan
  • To create this program I just created a new project and copied the clock code from a program that works. I also copied the driverlib file to the new project folder so they are using the same version. The driverlib file comes from msp430_driverlib_2_91_00_20 and was downloaded a couple months ago so it is almost up-to-date. I will update it when I get a chance to see if it helps. The working program has a lot of code after configuring the clocks but the only thing before that is configuring the FRAM and declaring a lot of variables for later use.

    The real question seems to be why is there an error in such a simple program that has nothing unusual in it?
  • Found the problem.  The FRAM was not being configured prior to setting the clocks.  I just added the following line before the clock setup.

       FRAMCtl_A_configureWaitStateControl(FRAMCTL_A_ACCESS_TIME_CYCLES_1);   // for 16MHz sys clock

    The answer was suggested in the forum here:

    MSP430FR5859 ResetsWhen MCLK references DCO @ 16MHz - MSP low-power microcontroller forum - MSP low-power...

    e2e.ti.com
    I am trying to run a project from the ti driverlib examples (Code provided below). The code sets the DCOCLK to 16Mhz, then sets the MCLK and SMCLK to reference

**Attention** This is a public forum