Propeller 2 Debug system

Hi All

Here's my Propeller 2 Debugger.
It's Python based and makes use of P2's debug interrupt mechanism.
It currently only supports debugging one cog a a time.

The cog ubnder test can be single stepped and monitored with a variety of commands
such as disassembly,wathlist,flag modification,stack manipulation and memory related
functions.

The code requires Python 3 and pyserial (see pyserial site).

The debuggers command line options can be found by
 python p2debug7_5.py -?

To load the sample denug code.
 python p2debug7_5.py sample1

The debugger will search for a P2 on all available com ports.
If a P2 is detected the object file will be loaded into the P2.
If available a .lst file is scanned for symbol information.
The debugger recognizes pnut , fastspin and p2asm format list files.

When you are presented with the debug prompt ">" type "help" or "help1" for a list
of commands and examples.
For an interactive demo type "intro". A log of the 'intro' session can be found in the 'oz.txt' file.

For pnut users make sure you use "Ctrl-M" "Ctrl-S" to generate a .lst file.
For p2asm users use the -o option to generate a .bin object file.

See the sample1.spin2 source file to see how the debugger attaches to your code.

This is still a work in progress, code needs tidying up. I need to expand on the documentation and build
some more interactive demos first!

:)


Melbourne, Australia

Comments

  • Ozpropdev, would it be possible to make a little video of it operating. That would convey the idea pretty well.
  • Thanks for posting this Brian! I haven't had a chance to really use it yet, but did get the sample to work on my Linux machine. A few notes for Linux users:

    (1) If your machine has both python2 and python3 installed, make sure to use python3 to run P2Debug7_5.py.

    (2) I had to increase the timeouts in find_p2() from "sleep(0.01)" to "sleep(0.1)" (with 0.01 the P2 wasn't being detected).

    (3) Running the sample1 program worked fine, but when I tried to load my own program (compiled with fastspin) I got a "Loading failed!,no response from P2" message. My program is a bit larger than sample1.obj (6528 bytes), I'm not sure if that's the problem or not.

  • ersmithersmith Posts: 3,311
    edited 2019-08-20 - 11:02:55
    ersmith wrote: »
    (3) Running the sample1 program worked fine, but when I tried to load my own program (compiled with fastspin) I got a "Loading failed!,no response from P2" message. My program is a bit larger than sample1.obj (6528 bytes), I'm not sure if that's the problem or not.

    Never mind, I see the problem now, I don't have the debug code linked in to my program.
Sign In or Register to comment.