FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [March 2012 Threads]
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 );
}
Thanks for the feedback. I have made the changes so they don't get lost, but have not yet tried compiling.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.