Does anything need to be done diffently to configure a wakeup pin in a C project using SDK 2.3.1?
No, it should be the same. Can you get it work with an earlier version and you cannot with 2.3.1?
I have not tried with an earlier SDK.
There is a discrepancy between this arcticle and AN1042. AN1042 says that the call below is needed. Is this true?
/* configure wakeup pin (PF6) */
GPIO_PinModeSet(gpioPortF, 6, gpioModeInput, 0);
Also, I'm working with the WSTK. As I understand it, after configuring the wakeup pin as shown in this article, pressing and releasing PB0 should trigger gecko_evt_system_awake. Is this understanding correct?
I see your problem. Indeed, wake up pin has to be configured as input (GPIO_PinModeSet(gpioPortF, 6, gpioModeInput, 0)). This article dealt only with the stack configuration and not with pin modes. But I can add it.
Yes, pressing and releasing PB0 will trigger a gecko_evt_system_awake event.
So I am using this to develop a simple low energy alternating advertisement, where it advertises, then enters sleep, and wakes up again (EM0 to EM2). I am trying to attempt this using a soft timer; I have used SLEEP_SleepBlockEnd(sleepEM2), and explicity called SLEEP_Sleep() to make sure it enters sleep state when hitting that part of the state. I check that the returned state is EM2 (as it is enabled in the config), and it shows it is. My energy usage is still around 3mA rather than uA when in that mode. Are there any other aspects of configuration that could be affecting this? (note I am newer to this type of development). I am using a 250 ms on/off interval and a BGM121 with the WSTK dev kit
Do you want to wake up the device only while it sends out advertisement or for a longer period?
In the former case you can simply allow deep sleep mode (see Enabling EM2 Deep Sleep in the Stack), and it will automatically switch between EM0 and EM2. It puts the device in EM2 and wake up only for the time while it sends out advertisement.
In the latter case you should also enable deep sleep mode in the config first. Then you can temporarily disable EM2. But it does not work in the other way: disabling deep sleep by default, then enabling EM2 temporarily is not the right way to do.
I am trying to use this example on a BGM111 in C mode, but starting with the empty_soc project, a lot of the configuration fields are missing in
the gecko_configuration_t struct - I am probably missing something obvious ?
Question: how can I configure a wake-up pin as described in this article with the C SDK on the BGM111 ?
Following up on my previous post: it looks like this example only work on SDK 2.3, not 2.4 . Is there a way to enable wake up pins on 2.4 like on 2.3 ?
Hi, you are right this was written for v2.3.x
To migrate it to 2.4.x you can use these instructions: http://community.silabs.com/t5/Bluetooth-Wi-Fi-Knowledge-Base/Migrating-Simplicity-Studio-projects-from-Bluetooth-SDK-2-3-x-to/ta-p/201125
The wake-up pin configuration also changed. It's not configurable any more via the gecko configuration structure. You have to define an external interrupt on the wake up pin, and use SLEEP_SleepBlockBegin(sleepEM2) and SLEEP_SleepBlockEnd(sleepEM2) to wake up the device.
Take a look at the "NCP target - Empty" example of SDK v2.4.x where this is implemented.
Thank you @arkalvac, this is the info I needed!