Good morning everyone,
I'm facing problems with the low power management of CC2538 since a long while and would like to see if anyone can give me tips on the topic. Essentially I'm not able to control the way the module exit low power modes. I'd like to wake it up with a GPIO but it keeps caring only about the sleep timer.
So, the setup is a custom hardware based on CC2538 with both 32 MHz and 32 KHz quartz integrated on board and TIMAC 1.5 firmware.
The modifications I did on the TIMAC 1.5 are the following:
- disabled key module
- disabled LED module
- initialized the GPIO I'd like to use to wake the chip up, using the following code in HAL_BOARD_COMMON_INIT():
GPIOPinTypeGPIOInput(GPIO_A_BASE, GPIO_PIN_5); IOCPadConfigSet(GPIO_A_BASE, GPIO_PIN_5, IOC_OVERRIDE_PUE);
- modified in hal_sys_ctrl.c every function involving the POW interrupt for the keys to my gpio (GPIO_A_BASE, GPIO_PIN_5). Something like this:
GPIOPowIntTypeSet(GPIO_A_BASE, GPIO_PIN_5, GPIO_POW_FALLING_EDGE);
- ensured that GPIOIntWakeupEnable(GPIO_IWE_PORT_A); is there
- inserted MSA_PowerMgr(TRUE); before OSAL_START_SYSTEM(); in order to trigger sleep modes
Now, while debugging, all the registers associated to the port and wake up system are correctly set (PORT_A_PI_IEN, SYS_CTRL_IWE and port settings). I can read the pin correctly in a variable, etc. Moving the GPIO still can't wake the device up, though. Pausing the debugger make the mcu exit the sleep condition and I can see that PORT_A_IRQ_DETECT_ACK has seen the edge also but for some reason still didn't wake the device up.
Am I missing something big here? Is there something particular in the closed source bsp key library that make the key work properly?
I even tryed enabling also the normal interrupt for the gpio in addition to the wake up one but without success.
Thanks in advance