Hello,
I need to put the (BW16) RTL8720DN to deep sleep. I am using the PowerSave Arduino library. Everything works fine. But I want to configure the wake-up condition. Let’s say I want to wake up the MCU at the falling edge or LOW level. How can I configure this thing for a specified GPIO?
Thanks, you @M-ichae-l
I have seen this tutorial. And did not find out how to configure the wake-up condition. I want to wake up BW16 when the signal goes from HIGH to LOW. How can we configure this thing?
This link is broken ![]()
Hi @boatbodger
You can refer to Power Save — Ameba Arduino AIoT Documentation v1.1 documentation
I’m using the SDK for my main development on the BW61 module - my aim being to wake up from deepsleep on a timer (about once every three hours to check battery level), and immediately on one of the AON GPIO pins. I find the wakeup on timer works fine, but can’t get the GPIO to work.
So I’m now trying Arduino to test the GPIO wakeup function. using a BW61 module
Thankyou for this link. Rather bizarrely, when I click the link in the email, I am taken to
whereas if I click it from the post when logged in to the forum, I arrive at
And they are very different!
The first reference gives a lot of additional information - including reference to a flag:
#define RETENTION
and the ability to ‘OR’ the wakeup sources.
The RETENTION flag may be my problem - using the Arduino examples, I’m finding that when in deepsleep, my chosen wake-up pin appears to be outputting a hard zero - not just a weak pulldown
However, I notice that the screenshots are from Arduino 1.8.13 (first link) and 1.8.16 (second link), whereas I’m using Arduino 2.3.8
Hi @boatbodger ,
Sorry for the confusion. Please refer to the second reference only as it is the official documentation source. We would like to ask if you are intending to implement dual wake-up sources, i.e. timer + AON GPIO? If yes, currently, this feature is only available on AmebaPro2 SDK PowerMode examples. You may want to refer to the implementation there for this feature. The Arduino IDE versions should not affect the compilation or outcome of the example code.
Thank you for this additional information.
Yes, I do need timer+AON GPIO.
Can I use the Pro2 SDK to build images for the BW16 board (which has the RTL8720DN chip), and if so, how should I set it up? The list of chips it supports does not appear to include the BW16.
When I tried that before, the chip appeared to reject the flashloader. For this reason, I’ve been working with the ameba-rtos-d SDK.
Hi @boatbodger ,
The AmebaPro2 SDK can only be used for AMB82-mini board (RTL8735B). You are right, BW16 board should be used with the Ameba D SDK. Currently, we have just added the dual wake-up sources to AmebaPro2 SDK and not yet support for Ameba D boards. If you wish to implement this feature for your project, you may refer to the AmebaPro2 SDK PowerMode examples and port them over to the Ameba D SDK.
Thankyou for confirming the need to use Ameba D SDK for the BW16
I’m pleased to say I’ve been able to get this dual wake-up requirement to work successfully.
I made changes to
component\soc\realtek\amebad\fwlib\usrcfg\rtl8721dlp_sleepcfg.c which is well-commented.
I also found I needed to make changes to
component/soc/realtek/amebad/fwlib/usercfg\rtl8721dlp_pinmapcfg.c
to set the correct pin conditions for the wake-up pins.
And finally, I had to remember to re-build the km0 part of the package using ‘make’ in ameba-rtos-d/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp
I greatly appreciate your help.
Chris
One of the pins I am trying to use to wake the BW16 from deep sleep is PA15 - which should be possible.
However I am finding that this pin (called ‘9’ in the Arduino world, and pin 4 on the BW16) is not working properly.
I’ve written a more extensive post under the Freetos Peripherals forum,
but the summary is as follows:
When set up as an input with the pull-up enabled, the pin voltage measures 1.6V rather than the expected 3.3v.
If I attempt to force an external pullup with 4.7k to the 3v3 rail, it rises to 2.2V and I can use it as a wake-up signal, but the current consumption rises to over 0.2mA which for my battery powered device is not acceptable.
This behaviour is the same whether using Arduino or the SDK.
The device datasheet implies that this pin has dual-use - it can be part of an external 32kHz oscillator, and I suspect it is this circuit element which is preventing the correct GPIO behaviour.
There must surely be a way of managing the pinmux to avoid this, but I can’t find it.
I have tried setting the pinmux to PINMUX_FUNCTION_GPIO (0), and to PINMUX_FUNCTION_WAKEUP (31), but that 1.6v just persists.
Can anyone help me work out how to get pure GPIO functionality from this pin?