I am trying to configure the DA14531 to use extended sleep mode, but am running into a problem where upon wakeup, if data was received over UART, the code gets stuck in a loop waiting for uart_is_busy_getf() to return false when UART is re-initialized, and the watchdog timer times out. I am trying to get it to wake up when the CTS line is enabled to prevent this. Currently I have done the following:
定义d CFG_EXTERNAL_WAKEUP in da1458x_config_advanced.h so EXT_WAKEUP is defined as 1
定义d EXTERNAL_WAKEUP_GPIO_PORT as the UART1 CTS port, EXTERNAL_WAKEUP_GPIO_PIN as the UART1 CTS pin, and EXTERNAL_WAKEUP_GPIO_POLARITY as 0 in user_periph_setup.h
configured the wakeup pins in set_pad_functions() in user_periph_setup.c with: GPIO_ConfigurePin(EXTERNAL_WAKEUP_GPIO_PORT, EXTERNAL_WAKEUP_GPIO_PIN, INPUT_PULLUP, PID_GPIO, false);
Is there anything I am missing? Is there a different way to solve this issue?
嗨mark.palomer,
Thanks for your question online and for your interrest in DA14531 solution. Could you please share more inputs on that? Do you want to wake up from the CTS or from Rx? Do you configure the UART immediately after the wake up and before the call of periph_init() ? The uart_is_busy_getf() is called only in uart_baudrate_setf() function. Additionally, can you please check it the Tx at zero for long time? Would it be possible to probe the UART signals and share a UART trace? Which project are you using? Any other input which will help us to replicate the issue and find the route cause would be very helpful.
Thanks, PM_Dialog
I just need it to wakeup when data is received. UART is configured in the app_on_ble_powered callback, which is called after periph_init().
The project I am working on is based on the ble_app_profile project from the SDK, however I am trying to add the changes from the DSPS project into it. To my knowledge, you need RTS/CTS for UART to correctly work with sleep mode. However enabling RTS/CTS does not seem to work. Would you be able to describe how the DSPS project handles the case where data is received over UART while it is asleep?
Hi Mark,
The DSPS for DA14531 is now available! You can use it instead of implementing this functionality in the ble_app_profile of the SDK. If you need to wake up the device via CTS, you should configure the wake-up controller for this scope. Please check ble_app_sleepmode example for how to configure the wake-up controller.
However, my suggestion would be to use the DSPS. Please check the source code for the product page:
//www.wsdof.com/products/dialog-serial-port-service-dsps
In the user manual, you will find how the DSPS works and how it handles the incoming data.
Thanks, PM_Dialog