Dear Team,
Good evening!!
i am working with simple peripheral code; current SDK version is simplelink_cc13x2_26x2_sdk_5_10_00_48.
i am configuring the switch for wakeup from shutdown.
if i try to put the controller into the sleep mode; it went to the sleep mode.
but after pressing the switch its not wakeup.
above image refer to the GPIO pin configuration.
please find attached pin schematic snap for your reference.
attached code snippet is called into the main function.
PIN_Config ButtonTableWakeUp[] = {
IGN_INPUT | PIN_INPUT_EN | PIN_PULLDOWN | PINCC26XX_WAKEUP_NEGEDGE,
PIN_TERMINATE /* Terminate list */
};
int main()
{
//spi
// pthread_t thread;
// pthread_attr_t attrs;
// struct sched_param priParam;
// int retc;
Sleep_WakeUpInit();
/* Register Application callback to trap asserts raised in the Stack */
RegisterAssertCback(AssertHandler);
Board_initGeneral();
// Enable iCache prefetching
VIMSConfigure(VIMS_BASE, TRUE, TRUE);
// Enable cache
VIMSModeSet(VIMS_BASE, VIMS_MODE_ENABLED);
#if !defined( POWER_SAVING )
/* Set constraints for Standby, powerdown and idle mode */
// PowerCC26XX_SB_DISALLOW may be redundant
Power_setConstraint(PowerCC26XX_SB_DISALLOW);
Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
#endif // POWER_SAVING
/* Update User Configuration of the stack */
user0Cfg.appServiceInfo->timerTickPeriod = Clock_tickPeriod;
user0Cfg.appServiceInfo->timerMaxMillisecond = ICall_getMaxMSecs();
GPIO_init();
//PinStatus = GPIO_read(IGN_INPUT);
//GPIO_write(CONFIG_LED_0_GPIO, 1);
/* Initialize ICall module */
ICall_init();
/* Start tasks of external images - Priority 5 */
ICall_createRemoteTasks();
#ifdef PTM_MODE
/* Start task for NPI task */
NPITask_createTask(ICALL_SERVICE_CLASS_BLE);
#endif // PTM_MODE
SimplePeripheral_createTask();
TmrOutInit();
/*PWM Added for Buzzer control */
PWM_Operation();
/* adding below function for checking the sleep current */
/*Power_shutdown(0, 0);*/
/*Initialise shutdown semaphore*/
ShutDown_Semaphore_Init();
/* enable interrupts and start SYS/BIOS */
BIOS_start();
return 0;
}
void Sleep_WakeUpInit(void)
{
/*Function is added for sleep wakeup statergy*/
/* Get the reason for reset.
* On CC26X2, SysCtrlResetSourceGet() must be called before
* PIN_init() because unlatching the IOs will clear the
* wakeup from shutdown bit.
*/
uint32_t rSrc = SysCtrlResetSourceGet();
/* Do pin init before starting BIOS */
/* If coming from shutdown, use special gpio table.*/
if (rSrc == RSTSRC_WAKEUP_FROM_SHUTDOWN) {
/* The shutdown table has LED1 on to ensure no glitch on the
* output.
*/
isWakingFromShutdown = true;
/* Open LED pins with shutdown table (LED1 on, LED0 off).
* A separate PIN_config table is used to keep LED1 on.
*/
//hPins = PIN_open(&LedPinState, LedPinTableSd);
} else {
/* When not waking from shutdown, use default init table. */
isWakingFromShutdown = false;
/* Open LED pins (LED1 off, LED0 on)*/
//hPins = PIN_open(&LedPinState, LedPinTable);
}
}
/****************************************************************************************
* Function Name : Sleep_BLE_Device
* Description : This function is shutdown the BLE system
* Arguments : None
* Return Value : None
* Modified By : Shrikant
*****************************************************************************************/
void Sleep_BLE_Device(void)
{
/* Pend on semaphore before going to shutdown */
//Semaphore_pend(Semaphore_handle(&shutdownSem), BIOS_WAIT_FOREVER);
Semaphore_pend(Semaphore_handle(&shutdownSem), BIOS_NO_WAIT);
/* Turn off LED0 */
//PIN_setOutputValue(hPins, CONFIG_PIN_LED_0, 0);
/* Configure DIO for wake up from shutdown */
PINCC26XX_setWakeup(ButtonTableWakeUp);
/* Go to shutdown */
Power_shutdown(0, 0);
/* Should never get here, since shutdown will reset. */
while (1);
}
/****************************************************************************************
* Function Name : ShutDown_Semaphore_Init
* Description : This function is initialise the shutdown semaphore
* Arguments : None
* Return Value : None
* Modified By : Shrikant
*****************************************************************************************/
void ShutDown_Semaphore_Init(void)
{
/* Configure shutdown semaphore. */
Semaphore_Params_init(&semParams);
semParams.mode = Semaphore_Mode_BINARY;
Semaphore_construct(&shutdownSem, 0, &semParams);
}
/*********************************************************************
*********************************************************************/
Regards,
Shrikant Koli