Other Parts Discussed in Thread: MSP430WARE, EVM430-F6779,
We have two issues in the ucs.c lib function within MSP430Ware 3.80.05.04. Specifically under /driverlib/driverlib/MSP430F5xx6xx but probably under other family variants as well.
Issue #1
ucs.c ... line 479
HWREG16(UCS_BASE + OFS_UCSCTL6) |= xcap;
Should be ...
HWREG16(UCS_BASE + OFS_UCSCTL6) |= xcap<<2;
This disables XT1 if a cap value of 0x01 or 0x03 (6 or 12pF) is selected, as well as not setting the desired XCAP value.
Issue #2
ucs.c ... begin line 834
if (mode == 1){
//fsystem > 16000
//Select DCOCLK
HWREG16(UCS_BASE + OFS_UCSCTL4) &= ~(SELM_7 + SELS_7);
HWREG16(UCS_BASE + OFS_UCSCTL4) |= SELM__DCOCLK + SELS__DCOCLK;
Line 837 clears the MCLK and SMCLK field before the second line sets the desired value. That clear on the MCLK sets the clock source to XT1. This in turn locks up the debug session, presumably due to the core clock being switched to a non-running oscillator (assumes XT1 is not used).