<p><b>@fjmolinas</b> commented on this pull request.</p>

<p>I tested on nucleo-l073rz + sx1272 mbed shield. I like the latest version where the pins mode is defined per driver and not per board.</p>
<p>I applied this diff to <code>examples/lorawan</code> and was getting 12uA consumption when in stop mode mode (I also added <code>CFLAGS=-DDISABLE_LORAMAC_DUTYCYCLE</code> since the timers are not running in sleep mode):</p>
<pre><code>diff --git a/examples/lorawan/Makefile b/examples/lorawan/Makefile
index 8265c73ee..23d40c6a9 100644
--- a/examples/lorawan/Makefile
+++ b/examples/lorawan/Makefile
@@ -25,6 +25,7 @@ USEPKG += semtech-loramac
 USEMODULE += $(DRIVER)
 USEMODULE += fmt
 FEATURES_REQUIRED += periph_rtc
+FEATURES_OPTIONAL += periph_eeprom
 
 CFLAGS += -DDEVEUI=\"$(DEVEUI)\" -DAPPEUI=\"$(APPEUI)\" -DAPPKEY=\"$(APPKEY)\"
 
diff --git a/examples/lorawan/main.c b/examples/lorawan/main.c
index 20cc066f3..a73ecaceb 100644
--- a/examples/lorawan/main.c
+++ b/examples/lorawan/main.c
@@ -26,6 +26,7 @@
 #include "msg.h"
 #include "thread.h"
 #include "fmt.h"
+#include "periph/pm.h"
 
 #include "periph/rtc.h"
 
@@ -52,6 +53,7 @@ static void rtc_cb(void *arg)
     (void) arg;
     msg_t msg;
     msg_send(&msg, sender_pid);
+    pm_block(1);
 }
 
 static void _prepare_next_alarm(void)
@@ -62,6 +64,8 @@ static void _prepare_next_alarm(void)
     time.tm_sec += PERIOD;
     mktime(&time);
     rtc_set_alarm(&time, rtc_cb, NULL);
+    semtech_loramac_save_config(&loramac);
+    pm_unblock(1);
 }
 
 static void _send_message(void)
@@ -122,7 +126,8 @@ int main(void)
      * keys.
      */
     puts("Starting join procedure");
-    if (semtech_loramac_join(&loramac, LORAMAC_JOIN_OTAA) != SEMTECH_LORAMAC_JOIN_SUCCEEDED) {
+    uint8_t ret = semtech_loramac_join(&loramac, LORAMAC_JOIN_OTAA);
+    if ((ret != SEMTECH_LORAMAC_JOIN_SUCCEEDED) && (ret != SEMTECH_LORAMAC_ALREADY_JOINED)) {
         puts("Join procedure failed");
         return 1;
     }

</code></pre>
<p>IMO this is a good change and although I would like more feedback on the api change this has been going for a while so lets not stall this any longer. I think something like this is necessary for proper low-power.</p>
<p>I would move for now the definition of <code>spi_init_with_gpio_mode</code> to <code>stm32_common/include/periph_cpu_common</code>, and make sure it shows up in doxygen. Once this is done please squash, there are some commits that override each other.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11542?email_source=notifications&email_token=ABE7WYEYS6UC27NDIKBG6F3QAW44NA5CNFSM4HNVEII2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB7ERM6A#pullrequestreview-264836728">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYHMR5GU7QM7G75CYCDQAW44NANCNFSM4HNVEIIQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYFTQ3W6WQTBSOCPV7DQAW44NA5CNFSM4HNVEII2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB7ERM6A.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11542?email_source=notifications\u0026email_token=ABE7WYEYS6UC27NDIKBG6F3QAW44NA5CNFSM4HNVEII2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB7ERM6A#pullrequestreview-264836728",
"url": "https://github.com/RIOT-OS/RIOT/pull/11542?email_source=notifications\u0026email_token=ABE7WYEYS6UC27NDIKBG6F3QAW44NA5CNFSM4HNVEII2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB7ERM6A#pullrequestreview-264836728",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>