Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    LoPy4 Crash with NanoGateway

    Scheduled Pinned Locked Moved LoPy
    lopy4crash
    15 Posts 5 Posters 2.7k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sebS Offline
      seb
      last edited by

      Hi,
      Have you updated your device to the latest firmware? What is the output when you run:

      import os
      os.uname()
      
      1 Reply Last reply Reply Quote 0
      • S Offline
        ssmith
        last edited by

        Yes, I'm running 1.15.0.b1

        (sysname='LoPy', nodename='LoPy', release='1.15.0.b1', version='v1.8.6-849-baa8c33 on 2018-01-29', machine='LoPy with ESP32', lorawan='1.0.0')
        
        1 Reply Last reply Reply Quote 0
        • D Offline
          daniel
          last edited by daniel

          @ssmith thanks for reporting this. What happens if you do:

          _thread.stack_size(8192)

          In the constructor of the NanoGateway class?

          I suspect that this is a stack overflow issue...

          S 2 Replies Last reply Reply Quote 0
          • S Offline
            ssmith @daniel
            last edited by

            @daniel I'll try that right now.

            1 Reply Last reply Reply Quote 0
            • S Offline
              ssmith @daniel
              last edited by

              @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?

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                ssmith @ssmith
                last edited by

                @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.

                1 Reply Last reply Reply Quote 0
                • S Offline
                  ssmith
                  last edited by

                  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?

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    JuanMa
                    last edited by

                    @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.

                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      ssmith @JuanMa
                      last edited by

                      @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.

                      1 Reply Last reply Reply Quote 0
                      • sebS Offline
                        seb
                        last edited by

                        JTAG TDO = P4
                        JTAG TDI = P9
                        JTAG TMS = P23
                        JTAG TCK = P10
                        JTAG TRST_N = RST

                        1 Reply Last reply Reply Quote 1
                        • J Offline
                          JuanMa
                          last edited by

                          @ssmith @seb Thanks!!

                          1 Reply Last reply Reply Quote 0
                          • J Offline
                            JuanMa
                            last edited by

                            @seb Do you recommend any JTAG adapter for Lopy debugging?
                            Thanks

                            J 1 Reply Last reply Reply Quote 0
                            • J Offline
                              jmarcelino @JuanMa
                              last edited by jmarcelino

                              @juanma
                              Please see this chapter https://esp-idf.readthedocs.io/en/latest/api-guides/jtag-debugging/index.html#jtag-debugging-how-it-works

                              I'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

                              1 Reply Last reply Reply Quote 0
                              • J Offline
                                JuanMa
                                last edited by JuanMa

                                @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.

                                1 Reply Last reply Reply Quote 0

                                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
                                • 1 / 1
                                • First post
                                  Last post

                                Pycom on Twitter

                                Pycom