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

    Debugging on the LoPy

    Scheduled Pinned Locked Moved LoPy
    7 Posts 4 Posters 2.8k Views 4 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.
    • B Offline
      betabrain
      last edited by

      I have an issue here with some code and would like to debug it.
      Is there a way to debug on the LoPy?

      OSError('Network card not available',)
      Guru Meditation Error of type LoadProhibited occurred on core   0. Exception was unhandled.
      Register dump:
      PC      :  400d79cb  PS      :  00060330  A0      :  800ea3f8  A1      :  3ffdd380
      A2      :  3ffb6370  A3      :  00000000  A4      :  00000001  A5      :  00000001
      A6      :  00000000  A7      :  3ffd8828  A8      :  00000000  A9      :  00000000
      A10     :  3ffb6370  A11     :  00060f23  A12     :  00060f20  A13     :  b33f0000
      A14     :  0000000a  A15     :  3ffec1a0  SAR     :  00000006  EXCCAUSE:  0000001c
      EXCVADDR:  00000044  LBEG    :  4000c46c  LEND    :  4000c477  LCOUNT  :  00000000
      CPU halted.
      
      1 Reply Last reply Reply Quote 0
      • D Offline
        daniel
        last edited by

        @betabrain there's a way to connect a JTAG debugger and launch GDB, but it's not for the faint of heart ;-)

        Can you share the steps to reproduce it? Thanks.

        B 2 Replies Last reply Reply Quote 0
        • B Offline
          betabrain @daniel
          last edited by

          @daniel Looks like I have got a steep learning curve ahead of me. :-( Can a JTAG debugger then be queried by the Python debugger, or are we strictly in C mode?

          Feature Request: Good debugging story!

          I will try. Have to use logging then to track it down. Might take a few days. I will file my results on GH and cross-link forum and issue for your reference.

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

            Feature Request: Good debugging story!

            This is already on our wish list, to add a MicroPython debugger to Pymakr :-)

            But anyway, for the kind of crash that you are experiencing, the only way to find the root cause is to debug it at C level.

            1 Reply Last reply Reply Quote 1
            • B Offline
              betabrain @daniel
              last edited by

              @daniel Here you go, courtesy of print-based debugging and tenacity:

              https://github.com/pycom/pycom-micropython/issues/31

              https://github.com/pycom/pycom-micropython/issues/32

              While I have your attention, please reopen...

              https://github.com/pycom/pycom-micropython/issues/12

              1 Reply Last reply Reply Quote 0
              • L Offline
                larabrian
                last edited by

                Python has a debugger , which is available as a module called pdb . It supports setting conditional breakpoints , stepping through the source code one line at a time, stack inspection, and more.

                import pdb
                msg = "this is a test"
                pdb.set_trace()
                print(msg)
                

                Insert pdb.set_trace() anywhere and it will function as a breakpoint . When you execute the script by python test.py, you will in the debug mode.

                A 1 Reply Last reply Reply Quote -1
                • A Offline
                  Amir Farhadi @larabrian
                  last edited by

                  This post is deleted!
                  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