Other Parts Discussed in Thread: CC1310
Tool/software:
I am a developer working with a CC1310.
I am using SimpleLink CC13x0 SDK -4.20.02.07.
I am currently developing with the SENSOR example of the CC1310.
I have written code that when I enter the command “sleep”, the do_sleep() function is called to enter deepsleep mode.
However, I am experiencing a problem that when I type command, deepsleep is executed only while the do_sleep() function is called and executed, causing the voltage to drop to 0.25mA and then rise back up to 0.5mA.
How can I make the do_sleep() function stay in deepsleep mode until I enter another command?
And once I enter deepsleep mode, I want the voltage to go down to at least 0.005mA, so what do I need to add to my code, and what documentation do I need to refer to?
main function
============================
int main(void)
{
Board_init();
Task_Params taskParams;
#ifdef ONE_TASK_CREATE
Task_Params testTaskParams;
#endif
#ifndef USE_DEFAULT_USER_CFG
macUser0Cfg[0].pAssertFP = macHalAssertHandler;
#endif
#if ((CONFIG_RANGE_EXT_MODE == APIMAC_HIGH_GAIN_MODE) && \
defined(DeviceFamily_CC13X0) && !defined(FREQ_2_4G))
macUser0Cfg[0].pSetRE = Board_Palna_initialize;
#endif
/*
Initialization for board related stuff such as LEDs
following TI-RTOS convention
*/
PIN_init(BoardGpioInitTable);
#ifdef FEATURE_BLE_OAD
/* If FEATURE_BLE_OAD is enabled, look for a left button
* press on reset. This indicates to revert to some
* factory image
*/
if(!PIN_getInputValue(Board_PIN_BUTTON0))
{
OAD_markSwitch();
}
#endif /* FEATURE_BLE_OAD */
#if defined(POWER_MEAS)
/* Disable external flash for power measurements */
Board_shutDownExtFlash();
#endif
#if defined(FEATURE_BLE_OAD) || defined(FEATURE_NATIVE_OAD)
SPI_init();
#endif
#if 1
char input;
const char echoPrompt[] = "AXM500 Device Starting \r\n";
UART_Handle uart;
#endif
/* Enable System_printf(..) UART output */
UART_init();
UART_Params_init(&uartParams);
#ifdef TASK_COMMAND
uartParams.writeDataMode = UART_DATA_BINARY;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readReturnMode = UART_RETURN_FULL;
uartParams.readEcho = UART_ECHO_OFF;
uartParams.baudRate = 115200;
hUart = UART_open(Board_UART0, &uartParams);
if (hUart == NULL)
{
System_abort("Error opening the UART");
}
#else
uartParams.readMode = UART_MODE_CALLBACK;
uartParams.readCallback = Uart_ReadCallback;
uartParams.writeMode = UART_MODE_CALLBACK;
uartParams.writeCallback = Uart_WriteCallback;
uartParams.writeDataMode = UART_DATA_BINARY;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readReturnMode = UART_RETURN_FULL;
uartParams.readEcho = UART_ECHO_OFF;
uartParams.baudRate = 115200;
UartPrintf_init(UART_open(Board_UART0, &uartParams));
UART_write(hUart, echoPrompt, sizeof(echoPrompt));
#endif
System_printf(" \r\n");
System_printf(" ===========================================\r\n");
System_printf(" AXM500 Device Starting \r\n");
System_printf(" SW Version : %d.%d \r\n", VER_MAJOR, VER_PATCH);
System_printf(" Release Date : %s /%s \r\n", __DATE__, __TIME__);
System_printf(" ===========================================\r\n");
//const char echoPrompt[] = "\n Reboot()\n";
//UART_write(hUart, echoPrompt, sizeof(echoPrompt));
#ifdef OSAL_PORT2TIRTOS
_macTaskId = macTaskInit(macUser0Cfg);
#endif
/* Configure task. */
Task_Params_init(&taskParams);
taskParams.stack = appTaskStack;
taskParams.stackSize = APP_TASK_STACK_SIZE;
taskParams.priority = APP_TASK_PRIORITY;
Task_construct(&appTask, appTaskFxn, &taskParams, NULL);
#ifdef DEBUG_SW_TRACE
IOCPortConfigureSet(IOID_8, IOC_PORT_RFC_TRC, IOC_STD_OUTPUT
| IOC_CURRENT_4MA | IOC_SLEW_ENABLE);
#endif /* DEBUG_SW_TRACE */
#ifdef ONE_TASK_CREATE
/* Configure task. */
Task_Params_init(&taskParams);
taskParams.stack = appTasktestStack;
taskParams.stackSize = APP_TASK_STACK_SIZE;
taskParams.priority = APP_TASK_PRIORITY;
Task_construct(&appTasktest, appTasktestFxn, &taskParams, NULL);
#endif
pthread_t thread;
pthread_attr_t attrs;
struct sched_param priParam;
int retc;
pthread_attr_init(&attrs);
priParam.sched_priority = 2;
retc = pthread_attr_setschedparam(&attrs, &priParam);
retc |= pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED);
retc |= pthread_attr_setstacksize(&attrs, THREADSTACKSIZE);
// Continue even if attribute setting fails
if (retc != 0) {
System_printf("fail thread\r\n: ");
while (1);
}
/* Create the thread for the main application logic */
retc = pthread_create(&thread, &attrs, mainThread, NULL);
/* failed to create thread */
if (retc != 0) {
System_printf("Failed to create thread\r\n: ");
while (1);
}
BIOS_start(); /* enable interrupts and start SYS/BIOS */
return (0);
}
============================