0

Is using circuitpython on rPi the only way to use a debugger
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Is using circuitpython on rPi the only way to use a debugger

by geekguy on Wed Aug 14, 2019 2:42 am

Hi,

I am at a point where I would really like to be able to get "inside" a circuitpython script while it is running. I would like to be able to set breakpoints and examine and change at variables inside the running script., then continue. Print statements are just not giving me the information I need.

I expect there is no way to do this on a microcontroller, but would it work if I were running circuitpython on a Raspberry Pi?

8-Dale

geekguy
 
Posts: 224
Joined: Tue Sep 10, 2013 2:43 pm
Location: Beaverton, OR

Re: Is using circuitpython on rPi the only way to use a debu

by jerryn on Wed Aug 14, 2019 2:54 am

You can use a J-Link with gdb to debug an Atmel (SAMD21/51) or Nordic (nRF52840) running circuitpython. https://learn.adafruit.com/debugging-the-samd21-with-gdb

While you can run the python scripts on a Raspberry Pi, you are not actually running CircuitPython, so your results may not be as meaningful.

jerryn
 
Posts: 972
Joined: Sat Sep 14, 2013 9:05 am

Re: Is using circuitpython on rPi the only way to use a debu

by geekguy on Wed Aug 14, 2019 3:18 am

jerryn wrote:You can use a J-Link with gdb to debug an Atmel (SAMD21/51) or Nordic (nRF52840) running circuitpython. https://learn.adafruit.com/debugging-the-samd21-with-gdb

Is all this complexity really necessary if all I want to do is set source breakpoints, examine/change variables, and step through code at the source level?

jerryn wrote:While you can run the python scripts on a Raspberry Pi, you are not actually running CircuitPython, so your results may not be as meaningful.

How would the results of doing this not be meaningful?

8-Dale

geekguy
 
Posts: 224
Joined: Tue Sep 10, 2013 2:43 pm
Location: Beaverton, OR

Re: Is using circuitpython on rPi the only way to use a debu

by jerryn on Wed Aug 14, 2019 3:42 am

The python script executes code from the circuitpython core. The “core” is not actually running on the Raspberry Pi so your source code is not the same as on a micro controller. It all depends on what you are debugging.

I’m certainly not telling you there is only one way to approach it. I was just pointing out that you can indeed run a debugger on the micro controller.

Perhaps I am not understanding what you want to do.

Hopefully someone else can help. Good luck.

jerryn
 
Posts: 972
Joined: Sat Sep 14, 2013 9:05 am

Re: Is using circuitpython on rPi the only way to use a debu

by jerryn on Wed Aug 14, 2019 3:50 am

On review of your initial post, I do think I misunderstood your request. I was thinking of much lower level debugging. Sorry for my confusion.

jerryn
 
Posts: 972
Joined: Sat Sep 14, 2013 9:05 am

Re: Is using circuitpython on rPi the only way to use a debu

by jerryn on Wed Aug 14, 2019 6:38 am

FYI - there was discussion of something relevant awhile ago - I don't know if there is active development at tis time. See this issue discussion: https://github.com/adafruit/circuitpython/issues/298

jerryn
 
Posts: 972
Joined: Sat Sep 14, 2013 9:05 am

Re: Is using circuitpython on rPi the only way to use a debu

by geekguy on Wed Aug 14, 2019 12:08 pm

jerryn wrote:FYI - there was discussion of something relevant awhile ago - I don't know if there is active development at tis time. See this issue discussion: https://github.com/adafruit/circuitpython/issues/298

Thank you for this pointer! I read the discussion and added my quarter's worth. :)

8-Dale

geekguy
 
Posts: 224
Joined: Tue Sep 10, 2013 2:43 pm
Location: Beaverton, OR

Please be positive and constructive with your questions and comments.