🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Maximum recursion depth?

    Scheduled Pinned Locked Moved Micropython
    11 Posts 6 Posters 18.0k Views 1 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.
    • D Offline
      dclaar
      last edited by

      I am getting:

        File "flowlib/hw/mpu6050.py", line 145, in acceleration
      RuntimeError: maximum recursion depth exceeded
      

      I'm using the timer and button events, and that may contribute, but how do I debug this? What is the maximum recursion depth, and can I display the current depth?

      1 Reply Last reply Reply Quote 0
      • D Offline
        dclaar
        last edited by

        Sometimes I get a stack dump almost immediately on starting the network, so maybe I'm skating close to the edge.

        Connected. Network config: ('192.168.6.109', '255.255.255.0', '192.168.6.1', '192.168.6.1')
        ***ERROR*** A stack overflow in task mp_thread has been detected.
        abort() was called at PC 0x400899a8 on core 1
        
        ELF file SHA256: 0000000000000000000000000000000000000000000000000000000000000000
        
        Backtrace: 0x400896a7:0x3ffb9160 0x40089991:0x3ffb9180 0x400899a8:0x3ffb91a0 0x4009220a:0x3ffb91c0 0x40093f98:0x3ffb91e0 0x40093f4e:0x3ffb91cc
        1 Reply Last reply Reply Quote 0
        • m5stackM Online
          m5stack
          last edited by

          could you provide your code?

          1 Reply Last reply Reply Quote 0
          • D Offline
            dclaar
            last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • D Offline
              dclaar
              last edited by

              I decided to go to a polling loop instead and it seems to work a lot better.

              1 Reply Last reply Reply Quote 0
              • C Offline
                crami25
                last edited by

                @dclaar
                See https://www.geeksforgeeks.org/python-handling-recursion-limit/ :
                by default, the value normally is 10^4.

                1 Reply Last reply Reply Quote 0
                • D Offline
                  dclaar
                  last edited by

                  As I'm not doing recursion explicitly, there must be something going on behind the scenes. Or I've got an error! Or maybe event-driven isn't clean and somehow keeps calling itself.

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

                    Since I'm not expressly using recursion, something else must be happening. Or I made a mistake! Or perhaps event-driven isn't clean and keeps naming itself in some way[url=https://mybankinginformation.com/citibank-routing-number/].[/url]

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

                      Instead, I choose to switch to a polling loop, and it seems to function much better.

                      1 Reply Last reply Reply Quote 0
                      • K Offline
                        KirkSutton23
                        last edited by

                        Instead, I switched to a polling loop, which seemed to work much better.

                        teastainT 1 Reply Last reply Reply Quote 0
                        • teastainT Offline
                          teastain @KirkSutton23
                          last edited by

                          Rather, I chose to switch to polling, which worked much better, so it seems.

                          Cheers, Terry!

                          100% M5Stack addict with several drawers full of product!

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