Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

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)
{
SetVCore(PMMCOREV_0);
}
else if(ulCPU_Clock_KHz <= 12000L)
{
SetVCore(PMMCOREV_1);
}
else if(ulCPU_Clock_KHz <= 20000L)
{
SetVCore(PMMCOREV_2);
}
else
{
SetVCore(PMMCOREV_3);
}

//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.

Regards.


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists