[riot-notifications] [RIOT-OS/RIOT] cpu/esp32: WDT reset in example/lorawan (#11443)

Gunar Schorcht notifications at github.com
Sat Apr 27 12:53:54 CEST 2019


I could figure out the cause of the problem. With commit 28d9599d52cf07d7282da1931cb240c027fea1f6, I introduced the following "fix", at least I thought it would be a fix.
```diff
--- a/cpu/esp32/thread_arch.c
+++ b/cpu/esp32/thread_arch.c
@@ -186,1 +186,1 @@ char* thread_stack_init(thread_task_func_t task_func, void *arg, void *stack_sta
-    p = (uint32_t *)(((uint32_t) top_of_stack+1 - XT_CP_SIZE));
+    p = (uint32_t *)(((uint32_t)(top_of_stack + 1) - XT_CP_SIZE) & ~0xf);
```
But in fact, it was a bug :dark_sunglasses: Since `top_of_stack` isn't aligned to 16 byte address and `top_of_stack` as well ass `XT_CP_SIZE` are used unaligned in `cpu/esp_common/vendor/xtensa/portasm.S`, this alignment down to the next 16 byte address stores a wrong pointer to the coprocessor save area in the initial thread context :grimacing:

Reverting the change seems to work. Even though I have no working LoRaWAN gateway, I could see the following outputs with my Heltec WiFi LoRa 32 V2.
```
Starting RIOT kernel on PRO cpu
I (247) [main_trampoline]: main(): This is RIOT! (Version: 2019.07-devel-141-g203c-boards/esp32-heltec-lora32)
LoRaWAN Class A low-power application
=====================================
[semtech-loramac] initializing loramac
Starting join procedure
[semtech-loramac] Starting join procedure: 0
[semtech-loramac] loramac cmd msg
[semtech-loramac] starting OTAA join
[semtech-loramac] Transmission completed
[semtech-loramac] MAC timer timeout
[semtech-loramac] MAC timer timeout
[semtech-loramac] MAC timer timeout
[semtech-loramac] MAC timer timeout
[semtech-loramac] MAC timer timeout
[semtech-loramac] MAC timer timeout
[semtech-loramac] MAC timer timeout
[semtech-loramac] MAC timer timeout
[semtech-loramac] MAC timer timeout
[semtech-loramac] MAC timer timeout
[semtech-loramac] RX timer timeout
[semtech-loramac] MAC timer timeout
[semtech-loramac] MLME confirm event
[semtech-loramac] join not successful
[semtech-loramac] loramac join notification msg
Join procedure failed
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/11443#issuecomment-487275887
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190427/e723f7c0/attachment.html>


More information about the notifications mailing list