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

    Maximum recursion depth?

    Micropython
    6
    11
    14.4k
    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
      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
        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
          m5stack
          last edited by

          could you provide your code?

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

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • D
              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
                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
                  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
                    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
                      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
                        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
                          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
                          • First post
                            Last post