Why can’t I Re-open the UART when it closes when running AT Interface LPUART App?
The LPUART AT Interface app allows users to close down the UART port when entering low power Doze mode for additional power savings. The UART when it is open can consume as much as 350uA. The AT Interface LPUART app provides a cross-compile switch that allows the UART to close most of the time when there is no activity and the Tx/Rx buffers are empty. A “Keep UART Open” is implemented by using a GPIO that when low allows the UART to close after a low power operation timer has expired. When this Keep UART Open GPIO signal is high the UART will not close automatically.
The AT Interface Application sets the default GPIO used for this function to SIO_24. An application can chose any pin other than the default by writing the desired SIO port number to Sreg 109.
The BL65x EVK connects SIO_24 to Button 3. However, if running the AT Interface LPUART application on the EVK the UART will close automatically as soon as the low power timer expires (default set to 5 seconds). The UART can not be re-opened in the case. To reduce power the application configures the Keep UART Open GPIO to input pulldown. However, to operate properly Button 3 when pressed will pull the signal to ground which results in an Event interrupt. Since the GPIO uses an input pulldown it is already low and no Event occurs leaving the UART closed.
A simple change in $LIB$.AT.interface can be made to configure Keep UART Open GPIO to input pullup. This keeps the GPIO high at all times and the UART open. When Button 3 is pressed long enough for the low power time to expire the UART is closed. To re-open the UART Button 3 is pressed again which causes an Event which will re-open the UART.
Change the following line in InitGpio() function in $LIB$.AT.interface:
rc = GpioSetFunc(vspCmdModePin, SIOTYPE_DIN, INPUT_PULL_DOWN)
rc = GpioSetFunc(vspCmdModePin, SIOTYPE_DIN, INPUT_PULL_UP)
Also to change the functionality so once the UART is closed is remains closed until the next button press also change the next line in InitGpio().
rc = GpioAssignEvent(0, vspCmdModePin, 0)
rc = GpioAssignEvent(0, vspCmdModePin, 1)