Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Official v7.1.0 MSP430X Demos are Broken

Posted by incoherent on March 16, 2012
The unmodified CCS MSP430X demo was failing with "Err: COM test" on my EXP5438 board. After some investigation, I found that the code was attempting to set the clock to 25MHz without first setting the VCORE voltage to an appropriate value.

#define configCPU_CLOCK_HZ( 25000000UL )

Also, the Init_FLL_Settle function is called with a 'magic number' that is the incorrect for the desired clock rate:

unsigned long ulCPU_Clock_KHz = ( configCPU_CLOCK_HZ / 1000UL );
LFXT_Start( XT1DRIVE_0 );
Init_FLL_Settle( ( unsigned short ) ulCPU_Clock_KHz, 488 );

To fix this, I added a #define to FreeRTOSConfig.h:

#define configLFXT_CLOCK_HZ       ( 32768L )

Replaced the Init_FLL_Settle function call in main.c with this:

hal430SetSystemClock(configCPU_CLOCK_HZ, configLFXT_CLOCK_HZ);

Added HAL_PMM.C and HAL_PMM.H from TI's F5xx/6xx core library to the F5XX_6XX_Core_Lib folder.

And added this code to hal_board.c:

* @brief Set function for MCLK frequency.
* @return none
void hal430SetSystemClock(unsigned long req_clock_rate, unsigned long ref_clock_rate)
/* Convert a Hz value to a KHz value, as required
* by the Init_FLL_Settle() function. */
unsigned long ulCPU_Clock_KHz = req_clock_rate / 1000UL;

//Make sure we aren't overclocking
if(ulCPU_Clock_KHz > 25000L)
ulCPU_Clock_KHz = 25000L;

//Set VCore to a level sufficient for the requested clock speed.
if(ulCPU_Clock_KHz <= 8000L)
else if(ulCPU_Clock_KHz <= 12000L)
else if(ulCPU_Clock_KHz <= 20000L)

//Set the DCO
Init_FLL_Settle( ( unsigned short )ulCPU_Clock_KHz, req_clock_rate / ref_clock_rate );

RE: Official v7.1.0 MSP430X Demos are Broken

Posted by Richard on March 16, 2012
Thanks for the feedback. I have made the changes so they don't get lost, but have not yet tried compiling.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner