UPDATED: Propeller On-chip Debugger
Kaio
Posts: 266
Hi all,
since I did develop assembly code for the Propeller I have missed an easy way to debug my code. Debugging using toggle such LED is very difficult and to use a terminal via serial line is also not very practical in my opinion. Who has developed assembly code does know what I mean.
What you need is a possibility to debug your code on the chip so that your code can run at real speed until a breakpoint occur or you execute only a single instruction and you could see what's up.
So I had the idea to build a debugging tool that runs on the Propeller itself. I could connect my tv and keyboard to the Propeller, load my program and then I could debug it on the Propeller.
After some days of hard work I will present you the first version of POD - the Propeller On-chip Debugger. It is currently not finished but you can use it to debug your code in a easy manner of course.
Thomas
Here you will find always the latest version of POD.
Post Edited (Kaio) : 5/16/2007 11:33:31 PM GMT
since I did develop assembly code for the Propeller I have missed an easy way to debug my code. Debugging using toggle such LED is very difficult and to use a terminal via serial line is also not very practical in my opinion. Who has developed assembly code does know what I mean.
What you need is a possibility to debug your code on the chip so that your code can run at real speed until a breakpoint occur or you execute only a single instruction and you could see what's up.
So I had the idea to build a debugging tool that runs on the Propeller itself. I could connect my tv and keyboard to the Propeller, load my program and then I could debug it on the Propeller.
After some days of hard work I will present you the first version of POD - the Propeller On-chip Debugger. It is currently not finished but you can use it to debug your code in a easy manner of course.
Thomas
Here you will find always the latest version of POD.
Post Edited (Kaio) : 5/16/2007 11:33:31 PM GMT
zip
190K
Comments
One of the best learning tools I have used for the propellor...
fred2
Hi fred2,
I'm glad to hear that.
@all
I have some ideas that I want to implement in the next version. But before I will start the development of the next release I want to invite you to say any kind of disadvantage that you have found as you "played" with POD.
I'm also interested to hear what kind of feature you want to see in a further release. Please feel free to help me to make POD a valuable developer tool and/or a learning tool for assembly beginners.
Thomas
i spent hours poring over assembly listings, loading patches to try things out, sometimes writing completely in
machine code, etc.
My LCD screen is not the best quality and does get a lot of peripheral lignt, so I changed the background color
to white which helped tremendously. Very easy to do with your extensive documentation on the listings.
I will be utilizing your program extensively in the next few days when I have a replacement computer coming
to rescue my current non-operable monster.
Great work!!!
Fred2
thank you for your advice. I have it only tested on my tube, because it can also show NTSC norm.
My first programming language was assembly for the Z80, but at the begin I had not a development system to create and test my programs. So I have used machine code tables to pick up the required codes corresponding to my assembly listing, which I had written on a typewriter. Later then I have used an assembler and a debugger running on a pc.
Now the time came back with the Propeller on which a byte have importance.
I look forward to your assistance.
Very, very good effort. I am using your debugger to analyse Chip's VGA.spin routine.
So far, so good. I use your program everyday. You write excellent code. Keep up the good work.
Jim
I'm really happy that you cannot work without POD anymore.
Help...I can not get the "jmpret" instruction to work properly. POD will not step into the
destination of the "jmpret" instruction with F5, it returns immediately to the instruction above the
"jmpret". It might be a good idea to include "jmpret" in your demo progran so we can see
how this instruction works with POD.
Jim
you has found the first bug, thank you.
@all
I have updated the ZIP archive on top of this thread with the fixed version.
Go ahead
Thomas
Post Edited (Kaio) : 3/23/2007 12:32:41 PM GMT
Thanks for the software correction.
I have a special favor to ask of you. Would it be possible for you to create a version of POD that
uses PC_Debug/FullDuplex to be used with the Stamp v2.2 Debug window instead of a TV set.
I have experimented with converting your software and I can produce some proper output using
this new arrangement so I know it is possible. There are two good reasons why this would be
very helpful. I enjoy developing prop software in many different locations and it is not possible
to have a TV monitor available. Also, I can not experiment with developing VGA software because
the output conflicts with the TV monitor. If you should agree to do this, please do not use Hyper
Terminal, I hate that program.
Thanks in advance.
Jim
I'm not familiar with the Stamp and Debug window. So I have searched in the BASIC Stamp forum but I have not found useful informations about that.
Can you provide me with some informations about the Debug window?
Is this a terminal program running on the pc?
Parallax Home Page
Downloads
Basic Stamp Software
Assuming your running windows……Basic Stamp Windows Editor version 2.2.6 (~6.0 MB)
Download Basic Stamp Windows Editor
Install Basic Stamp Windows Editor
Plug Prop Demo Board into your computer
It does not have to be powered up with a power supply at this time, only connected
Run Basic Stamp Windows Editor
Depress “Identify” icon
Depress "refresh" icon
Editor should find your demo board and indicate a COM Port. My computer says COM 10
Depress “New Debug” icon
Enlarge Debug Terminal #1
Select Com Port = COM 10 (This may be different on your computer)
Baud Rate = 9600
We are now ready to load software into the demo board
When everything is working properly you will be running BOTH the prop editor and the stamp editor
Switching back and forth between the two
Let me know who this works, I will send more later
Jim
I have the Basic Stamp Software installed and running. I can send data from the Propeller via serial connection to the Debug window.
This is a nice idea to use the Debug window instead a tv. It should be possible to use it as output device for the POD, but I must made some modifications because the Debug window can not show colors. I will try to make a version using the Debug window as output.
Thomas
Very good progress. I think this will result in a better product. I found another of Chip’s
instructions with the dira register which blew away the TV set and I am sure the waitvid
command would also be messy. I think it would be a better idea to enter (or remove) the
breakpoints by keyboard entry, rather then an F9 toggle. It is much faster by keyboard,
then stepping through the listing and toggling the current line. Another important
improvement idea: Do away with the keyboard connected to the demo board. Use
keyboard entry with Stamp DebugIn command which utilizes your computer keyboard.
This will mean that all that is needed is a demo board and a computer and we are in
business.
Jim
PS: I realize this is a lot of new work for you: but remember, this baby was your creation.
firstly many thanks for pointing out such improvements.
This should be only occur if you debug a code which use the same pins as the TV or keyboard driver you use for the POD. Then you must modify the code you want to debug, so that it's using other pins.
How you want do that? By enter an address? I think it could be an additional way which I did plan to implement later.
Why do you think it's a faster way? I do set a breakpoint, when I has stepped in a region of code where I think I need a breakpoint now. I can also look forward some lines of code and then set a breakpoint. For this I must of course make the line I want to have a breakpoint to the current line.
You know that you must not then scroll back to the pc related line? If you want to do that you can hit HOME (POS1) key, but you can also hit any debug key to perform the next instruction (F5 or F6) or to start code execution at realtime (F8). After that POD will automatically scroll to the right position.
This is possible but you would have to type in a command because hot keys does not work while they will received from the BASIC Stamp program. The handling on debugging would be not so fast as it is currently.
This could be an argument to do debugging only via two serial connections as you have mentioned.
I'm very happy about your advises and I know that I have to spend some more weeks of my spare time for this project. But I like to do that in order that other Propeller guys which are not familiar with assembler programming can have an easier entry to learn this.
Thomas
I can sense we are reaching our final exchange for your first submission of POD. I think it is important to realize that I am speaking as the potential customer and you as the developer. Naturally, I would like to get as much of what I want as possible. My experience with debugger’s goes back to the Heathkit Microprocessor Trainer using the Moto 6800 and has been continuous every since with many different devices. The years I have spent with BUFFALO…….(for those of you who understand).
All of these debugger programs used a keyboard to enter breakpoints. One reason this is handy depends on your style of debugging. As I explore new software, I tend to constantly experiment by running in real-time as well as single stepping. For this reason, I am constantly losing control of the program. This happened with your program as well. I have to reset it, to get it back, which means I must reenter the breakpoints again. After a section of code is debugged, I always move the initial breakpoint to a new a new location and run in realtime to that first location and do single stepping thereafter. As you can see, entering breakpoints is a big deal to me.
Regarding the extra keyboard, keep this in mind: I like to study computer code in varied locations from campgrounds to truck-stops. If I can reduce, my hardware I will try. As it is now when I am in a restaurant using my computer, battery operated demo board and computer printouts, the waitress cannot find any space on the table for the food. Why would I work in a truck-stop: I love to watch the Big-Rigs and eat steak and beans.
Think about this: if I knew enough to modify Chip’s code so it does not interfere with your program then I would not need your program to start with. For this reason I would like all pins to be clear and not used except 28..31, i.e. Debug, DebugIn should be used.
Finally, I realize that there are many others who will enjoy exactly what you have developed so far and for this reason POD is fine effort as it stands, so please do not become depressed by my comments.
Over and Out for now
Jim
How can I send you a donation?
You are right in thinking of that. I have not said that I will not implement improvements which you have mentioned. But it takes some time to collect all informations what the customers are dreaming.
When I have you understood right, you mean with 'losing control' that your debugged code is running in realtime and the debugger is waiting to catch the next breakpoint. If this occur you can hit the ESC key to stop the debugged Cog and restart it again without losing your breakpoints.
You are right, this is the easiest way. I have it on my mind.
Thomas
I'm glad to hear that. I have sent you a PM.
Thomas
You are back, good for you. I was not certain you would recover after our last exchange. What I mean about losing control of the program has to do with debugging code that is either not complete or contains an error in some way or another. These programs will not travel nicely to the next breakpoint and stop. They either hang up or hide in some continuous loop. For this reason, I just hit reset and start over which means I must enter the breakpoints again. I often want to change the breakpoints any way because the point I selected was beyond some error in the code and I must back up and precede the error with a new breakpoint so I can slowly single step into the error. Then I will be able to detect the exact location where the problem occurs. Thomas, I want your effort to succeed because writing assembly code without a debugger is definitely not a fun thing.
I am trying to get to get you to remove all extraneous hardware, and free up the pins so that there will be no conflicts with the code being debugged. This will elevate your POD from a good effort to a great one. Please keep trying. Remember you have the rest of your life to complete this, so I think you have time.
Jim
Waiting patiently, Jim
the new version should be well tested, before I make it public. And the documentation must be also updated. But I'm sure that I can it publish shortly.
Please hang in there!
Good news from you. When I saw you spreading your expertise throughout the form, I was afraid you were losing interest in POD.
NEW BUSINESS: I will use (Andre’[noparse];)[/noparse]’s text as a reference [noparse][[/noparse]181.183]. I have verified this problem throughout the listings and will use one example from AsmDebugDemo.spin, namely the instruction
if_nc jmp #wait which you convert to NZ&C jmp #$007 using POD based on a listing of $5C4C0007 or |0101|1100|0100|1100|0000|0000|0000|0111| which in turn converts to |010111|0001|0011|000000000|000000111|
|cccc| and from Table 13.4 page 182, stands for IF_NC or IF_AE which
in turn should have produced only NC jmp #$007. Please check and see if this might be a problem.
Jim
you are right, thank you for pointing out this problem. I have it also found yesterday (or was it last night? ) while testing the new version.
I have release a new version of POD. You can find this on top of this thread.
Please have a look at the readme.txt about the new features, which is contained in the ZIP archive.
@Jim
Sorry, this version requires also a tv and keyboard connected at your Prop board. I will try to change this with the next version.
Have fun, Thomas
I'm wondering that here is no response since I have published the latest version a few days ago. I'm thinking, there could be 2 reasons for that.
1. It could be that you has expected more functionality to have working.
2. All works fine and you have no any questions or requests for a next version.
If statement two is true then I could be starting the next project. Otherwise it would be helpfully if I would have feedback from you.
I'm pleased to hear from somebody.
I haven't had a chance to try it out because·I've been working on another project.· I'll see if I can try it out today.
-Chip
If you could put in the serial port interface in, I would be using this program already. I am using the proto board and need to modify it for the kbd, and video inputs and the hardedst part, find a monitor to bring to the office.
The proto board hasthe vga plug (arrived today) if I change TV_text to VGA_text would there be a problem?
Martin
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
I'm currently working on the next version of POD, which will also provide debugging via serial connection. I know that many guys are using a proto board and this supports keyboard and VGA only with an additional kit.
Sorry, you can not use any VGA driver as replacement for the TV driver. Either they have not the required methods to print out the debugger informations like on the TV driver or the supported screen size is to small.
Please keep up! I'm still testing the new version.