Part Number: CC2640R2F
Tool/software: TI-RTOS
Hi,
I would like to create a small project using only the internal crystals. I have a functional project using the internal 32Khz RCOSC but I also would like to use the internal 48Mhz. No BLE is needed or Advertising, only a LED blinking every second. I created a clock and through the main loop I blink the LED
The CC2640R2F is starting,blink the LED for 2-3 seconds, and then crash. I doesn't go into low power mode (current drawn stay at 2-3mA). I tried to change some options into the configuration file but the behavior is always the same. Maybe there is a register to set to prevent clock switching or something like this ?
Here's what I'm planning to do :
// Test clock only
static Clock_Struct Clock_TestClock;
// LED management
static const PIN_Config aPinListHui[] =
{
LED1 | PIN_GPIO_OUTPUT_EN | PIN_PULLDOWN | PIN_PUSHPULL | PIN_DRVSTR_MIN, // ON / OFF LED1
PIN_TERMINATE
};
static PIN_State hStateHui;
// Main function
static void SimplePeripheral_taskFxn(UArg a0, UArg a1)
{
// Register to Icall events
ICall_registerApp(&selfEntity, &syncEvent);
// Create an RTOS queue for message from profile to be sent to app.
appMsgQueue = Util_constructQueue(&appMsg);
// Create Clock
const unsigned int CLOCK_LENGTH = 300;
Util_constructClock(&Clock_TestClock, SimplePeripheral_clockHandler, CLOCK_LENGTH, CLOCK_LENGTH, true, EVENT_PERIODIC);
// Application main loop
for (;;)
{
uint32 events;
// Waits for an event to be posted associated with the calling thread.
// Note that an event associated with a thread is posted when a
// message is queued to the message receive queue of the thread
events = Event_pend(syncEvent, Event_Id_NONE, SBP_ALL_EVENTS, ICALL_TIMEOUT_FOREVER);
if (events)
{
ICall_EntityID dest;
ICall_ServiceEnum src;
ICall_HciExtEvt *pMsg = NULL;
// Fetch any available messages that might have been sent from the stack
if (ICall_fetchServiceMsg(&src, &dest, (void **)&pMsg) == ICALL_ERRNO_SUCCESS)
{
//...
}
//...
}
// --------------------------------------------------------------------
// Periodic event, test only
// --------------------------------------------------------------------
if (events & EVENT_PERIODIC)
{
events &= ~EVENT_PERIODIC; // Remove event
if(PIN_open(&hStateHui, aPinListHui))
{
PIN_setPortOutputValue(&hStateHui, (1<<LED1));
Task_sleep(25000);
PIN_close(&hStateHui);
Task_sleep(25000);
}
}
}
}
Thanks in advance