How to wake up FX3/CX3 using UART_CTS pin?
You can make FX3/CX3 to enter suspend mode and wake up with UART_CTS source as follows:
- Configure UART CTS as a wakeup source and polarity as High or Low through the CyU3PSysCheckSuspendParams () API
- If wakeup polarity is HIGH, connect the UART CTS pin on the FX3/CX3 device to ground initially. If it is LOW, connect it to a 3.3-V source.
- Invoke the CyU3PSysEnterSuspendMode () API after checking the status from the previous step. This API is a non-returning call, which will push the device into suspend mode.
- Wait for some time.
- Toggle UART_CTS to HIGH by connecting it to a 3.3-V source or vice-versa for the alternate polarity case.
- Device should come out of suspend and should enumerate again.
As per the datasheet of FX3/CX3, GPIOs could be configured as 16- or 32-bit data bus with other interfaces enabled/disabled.
When the I/O matrix is configured to 32-bit data bus or 16-bit data+ UART, GPIO acts as UART_CTS. When the I/O matrix is configured to 16-bit data bus+UART+SPI+I2S, GPIO acts as UART_CTS. It will be OK to wake up FX3/CX3 with GPIO being the source.
However, when the I/O matrix is 16-bit data bus+UART+SPI+I2S, FX3/CX3 cannot be woken up using GPIO(UART_CTS) as the source. It is a known issue. If GPIO is expected to be the wakeup source, you should modify the gctlaon_regs.h file.
#define CY_U3P_GCTL_EN_UART_CTS (1u << 6)
#define CY_U3P_GCTL_EN_UART_CTS (1u << 4)
With the change above, FX3/CX3 could leave suspend mode with GIPO as source.