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.

Grace on MSP430FR5969 causes CS3 Error: PMM overload and perpetual reset

Other Parts Discussed in Thread: MSP430FR5969

Using latest Grace, and just trying to set the SMCLK/MCLK frequency to 16 MHz on an MSP430FR5969.

Grace_init() uses CS_A_graceInit AND several calls CS_clockSignalInit, doing MCLK first, which would appear to avoid the problem. But it does not because within CS_clockSignalInit, several sequential writes  are made to CSCTL2  which appear to cause the  CS3: PMM overload in the errata:  slaz473j.pdf

In CS_S_init.c

    CS_clockSignalInit(CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);
    CS_clockSignalInit(CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);
    CS_clockSignalInit(CS_ACLK, CS_VLOCLK_SELECT, CS_CLOCK_DIVIDER_1);

Then in cs.c

   switch(selectedClockSignal)
    {
    case CS_ACLK:
        assert(
            (CS_LFXTCLK_SELECT == clockSource)  ||
            (CS_VLOCLK_SELECT == clockSource)   ||
            (CS_LFMODOSC_SELECT == clockSource)
            );

        clockSourceDivider = clockSourceDivider << 8;
        clockSource = clockSource << 8;

        HWREG16(CS_BASE + OFS_CSCTL2) &= ~(SELA_7);
        HWREG16(CS_BASE + OFS_CSCTL2) |= (clockSource);
        HWREG16(CS_BASE + OFS_CSCTL3) &= ~(DIVA0 + DIVA1 + DIVA2);
        HWREG16(CS_BASE + OFS_CSCTL3) |= clockSourceDivider;
        break;
    case CS_SMCLK:
        assert(
            (CS_LFXTCLK_SELECT == clockSource) ||
            (CS_VLOCLK_SELECT == clockSource) ||
            (CS_DCOCLK_SELECT == clockSource) ||
            (CS_HFXTCLK_SELECT == clockSource) ||
            (CS_LFMODOSC_SELECT == clockSource)||
            (CS_MODOSC_SELECT == clockSource)
            );

        clockSource = clockSource << 4;
        clockSourceDivider = clockSourceDivider << 4;

        HWREG16(CS_BASE + OFS_CSCTL2) &= ~(SELS_7);
        HWREG16(CS_BASE + OFS_CSCTL2) |= clockSource;
        HWREG16(CS_BASE + OFS_CSCTL3) &= ~(DIVS0 + DIVS1 + DIVS2);
        HWREG16(CS_BASE + OFS_CSCTL3) |= clockSourceDivider;
        break;
    case CS_MCLK:
        assert(
            (CS_LFXTCLK_SELECT == clockSource) ||
            (CS_VLOCLK_SELECT == clockSource) ||
            (CS_DCOCLK_SELECT == clockSource) ||
            (CS_HFXTCLK_SELECT == clockSource) ||
            (CS_LFMODOSC_SELECT == clockSource)||
            (CS_MODOSC_SELECT == clockSource)
            );

        HWREG16(CS_BASE + OFS_CSCTL2) &= ~(SELM_7);
        HWREG16(CS_BASE + OFS_CSCTL2) |= clockSource;
        HWREG16(CS_BASE + OFS_CSCTL3) &= ~(DIVM0 + DIVM1 + DIVM2);
        HWREG16(CS_BASE + OFS_CSCTL3) |= clockSourceDivider;
        break;
    }

So when I use Grace_init() and set the freq to 16 MHz, the board just goes into perpetual restart.  Leaving it at the default 1 MHz works OK. 

  • Mike,

    Can you please post your .cfg file so we can look into the generated init code in more detail?

    Thanks,
    Joe
  • So I mis-diagnosed this problem but there is a related problem with Grace nonetheless.

    For the FR5969, setting the MCLK to 16 MHz fails because the FR5969 requires FRAM wait states. 

    Workaround for the problem is:

       /* USER CODE START (section: CS_A_graceInit_prologue) */
    	FRAMCtl_configureWaitStateControl(NWAITS_1);
       /* USER CODE END (section: CS_A_graceInit_prologue) */

    But Grace should do this automatically since setting the MCLK to 16 MHz without it is illegal and generates interrupts. 

    See SLAS704D Section 5.3. Page 17

    See SLAU367F Section 6.3 Page 280