LoPy4 Crash with NanoGateway
-
@daniel I tried setting the stack size and it feels like it ran for a longer period of time but it did crash the same way. Is there a way to monitor the remaining stack size for a thread?
-
@daniel I tried setting the stack size up to 16K and no determinable difference is how long it takes to crash. This still feels like some sort of memory leak. We've tried monitoring mem_free() and mem_info() and can't detect anything. We do have a lot of things running in our system, WiFi, Bluetooth, LoRaWAN. We have not seen this type of crash running raw LoRa though. Still trying to narrow it down to the most basic items that make it crash.
-
A bit more digging into this. Modified the UDP_THREAD_CYCLE_MS constant in lorawan_nanogateway.py from 10 to 1000 and the LoPy ran overnight without issue. Seems like something is getting backed up and crashing. I've looked for memory leaks and stack overflows but haven';t been able to find anything.
I think it's time to try and debug at the firmware level. Anyone have any instructions on setting up eclipse and a jtag probe to be able to debug the firmware?
-
@ssmith I have configured Eclipse IDE following this guide, although it is not complete because you also have to add all the include paths of the project.
I don't know anything about JTAG although I am looking for a solution too. It seems the JTAG pins are not available on the Lopy datasheet, so it is gonna be difficult. -
@juanma Thanks. The JTAG pins are pinned out on the LoPy. You just have to cross reference to the ESP32 datasheet to decipher them. When I get to that point I'll send them to you if you want.
-
JTAG TDO =
P4
JTAG TDI =P9
JTAG TMS =P23
JTAG TCK =P10
JTAG TRST_N =RST -
-
@seb Do you recommend any JTAG adapter for Lopy debugging?
Thanks -
@juanma
Please see this chapter https://esp-idf.readthedocs.io/en/latest/api-guides/jtag-debugging/index.html#jtag-debugging-how-it-worksI've used both FTDI FT2232H adapter (must disable the FTDI VCP driver on Mac/Linux) and Segger J-Link
That said in practice debugging the MicroPython task over JTAG is difficult
-
@jmarcelino Thanks. I was thinking on something like the FT2232H. I would also say it is difficult but it is for an academic research, so I think it is worthy. :)
I have just read that page, but today the OpenOCD page with the compatible JTAG adapters seems to have fallen.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login