Shop OBEX P1 Docs P2 Docs Learn Events
Debugging applications — Parallax Forums

Debugging applications

LeonLeon Posts: 7,620
edited 2011-05-10 22:41 in General Discussion
Neither the new Parallax Semiconductor web site or the Propeller Manual discuss debugging techniques. I feel that the lack of conventional debug hardware will puzzle many prospective professional users and that the matter should be addressed.

Comments

  • Dave HeinDave Hein Posts: 6,347
    edited 2011-05-08 16:04
    Some programmers can't function without a debugger and other programmers never used them. I fall in the latter group. I am much more comfortable debugging with printf's than I am with a debugger. I don't think a debugger is essential for a processor at the level of the Prop 1, or the even the Prop 2. However, it certainly helps to market a chip if the manufacturer provides some debugging tools. I do think that a Prop 2 simulator would be very useful as well.
  • LeonLeon Posts: 7,620
    edited 2011-05-08 16:10
    The point I'm making is that many prospective users will wonder why it isn't mentioned anywhere, and Parallax needs to be able to answer their questions about it.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-05-08 16:19
    Leon, I agree with your point. This point has been discussed in another thread that you have been participating in. It seems like you should have just PM'ed Parallax directly instead of creating yet another thread about it.
  • LeonLeon Posts: 7,620
    edited 2011-05-08 16:23
    I did ask Ken about it, in one of his threads about the new venture, but he didn't reply.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-05-08 16:32
    Leon, PM means Private Message, but I'm sure you knew that. I'm sure Ken will respond to a PM from you. Of course, you would probably get quicker response if you didn't mention the superiority of competitive processors in every other post. Maybe he's as tired of hearing it as the rest of us.
  • LeonLeon Posts: 7,620
    edited 2011-05-08 16:38
    You exaggerate! I have 4678 posts to my name, and the proportion of those which discuss other devices is minimal.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-05-08 16:54
    I think Parallax can address the debugging issue with software. There are several debugging techniques that have been developed by users, which Parallax could promote. The multi-cog architecture makes it possible for one of the cogs to monitor the activity of the other cogs. Of course, one of the problems is knowing what's going on inside a cog. This requires the cog's software to write information out to hub RAM.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-05-08 17:45
    I think Parallax can address the debugging issue with software. There are several debugging techniques that have been developed by users, which Parallax could promote. The multi-cog architecture makes it possible for one of the cogs to monitor the activity of the other cogs. Of course, one of the problems is knowing what's going on inside a cog. This requires the cog's software to write information out to hub RAM.

    Good point. I wrote exactly this in C/PASM last night to debug some code. Pick a location or group of locations in hub. Write a little pasm debug routine that stores values there at certain points in the program, and then print them out either from a higher level language, or via another cog (to a serial port, vga display, alphanumeric LCD display, or even to 32 leds, one on each pin).

    This can be all done in software. However, I had to invent all the above from scratch and it probably is reinventing the wheel, and I could not have done this without having played around with the prop for over a year, so maybe a discussion of such techniques could be added to any future versions of the manual?
  • JasonDorieJasonDorie Posts: 1,930
    edited 2011-05-09 18:05
    I've been using Ahle's debug cog / debugger lately and found it a little quirky, but very useful. My biggest issue so far has been flags being not written when I expect them to be (test instruction).

    It would be nice to have an official / supported debug option. There are times when there's just no substitute for a decent debugger. You can't easily put a printf in the middle of a high-speed I2C routine in a PASM cog. :-)
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-09 18:35
    Some PASM coding involves time critical routines and, unless you plan explicitly for debugging, you can't just insert it without messing up the timing. This is true of most hardware-assisted debugging as well. It would be useful to have a tutorial for PASM debugging techniques including this sort of time-critical stuff as well as more well-behaved debugging like having a hub-based log for debug events or having a short routine in a cog that edits hex data into fixed areas of a TV or VGA buffer whose driver is running in a spare cog.
  • LeonLeon Posts: 7,620
    edited 2011-05-10 04:05
    I'm surpised that Parallax hasn't responded. They are supposed to have FAEs etc. monitoring this forum. I seem to get up their collective noses sometimes, perhaps that's the reason. :)
  • RossHRossH Posts: 5,519
    edited 2011-05-10 04:17
    Leon wrote: »
    I'm surpised that Parallax hasn't responded. They are supposed to have FAEs etc. monitoring this forum.
    Why hasn't Parallax adopted the hardware debugging solution that some other chip manufacturers have found so necessary to debug their arcane designs?

    Could it be because no-one who uses the Propeller seems to have a need for them?

    Ross.
  • LeonLeon Posts: 7,620
    edited 2011-05-10 04:34
    That's not what I'm asking!

    Prospective users *are* going to ask about debugging; Parallax Semiconductor doesn't mention it, and it's hardly mentioned in the documentation. I feel that some official documentation on debugging techniques is required.

    You presumably debug your software using various techniques that you have found to work, as have we all. However, we have had to find them out for ourselves, or via the forum. Parallax themselves hasn't got any material on it, AFAIK.

    Perhaps there are several people slaving over hot keyboards at this very moment, preparing such documentation.
  • BeanBean Posts: 8,129
    edited 2011-05-10 04:53
    This thread reminds me of commercial.

    There is some trash on the sidewalk. A couple walks up to it and says "That is just terrible". A few more people walk up and they are all discussing how terrible it is that people litter.
    Finally there is a whole crowd of people talking about the litter and pointing.

    Finally someone walking by, just picks up the litter and puts it in a nearby trash can. The crowd of people just look at each other and go on about their way.

    Bean
  • LeonLeon Posts: 7,620
    edited 2011-05-10 04:57
    Is the "trash" in your analogy the concept of debugging, and you are arguing that it just isn't needed with the Propeller? If that is the case, Parallax needs to make it clear, because they are going to be asked about it.

    Or, do you think I shouldn't have raised the issue in the first place and the thread is trash? You are a moderator, just delete the thread if you consider it off-topic or objectionable in some way.
  • BeanBean Posts: 8,129
    edited 2011-05-10 07:26
    Leon, I'm actually in your camp on this one. I think there should be a debugger for the propeller.

    Some people may not need or want a debugger, but personally I might not NEED one, but I'd really like to have one. And I agree with Leon that newbies and pros expect a debugger for a 32-bit microcontroller.

    The point of my comment was, instead of all the discussion about if one is needed or not, we should be talking about how would be the best way to implement a debugger.

    Bean
  • LeonLeon Posts: 7,620
    edited 2011-05-10 07:38
    Thanks, Bean, I must be getting paranoid!

    I did think that it might be something like Churchill's view that "we are two nations divided by a common language", though!
  • Ken GraceyKen Gracey Posts: 7,401
    edited 2011-05-10 09:17
    Leon,

    In another thread I replied to you on this subject and indicated that we'll give this some thought and address it on the Parallax Semiconductor web site. The same intent still holds true - nothing has changed about our plan to address the point you have brought up. As you probably know there's quite a bit going on here and you know it from reading the forums (trade shows, launch of Parallax Semiconductor, scheduling of a GCC/GNU developer's meeting, UPEW, etc.). It would be considerate of you to give us an opportunity to reply by the end of this week knowing that we've already received this same comment from several threads.

    You mention that the FAEs have not replied to this thread. That's because all of them have been getting familiar with the new processes we've developed along with customer support responsibilities. The topic is on a list of discussion points for today's meeting.

    This isn't the right forum for the particular topic. It really belongs in the "Suggestions to Parallax" forum, where I will move this thread at some point today.

    Thanks,

    Ken Gracey
  • LeonLeon Posts: 7,620
    edited 2011-05-10 09:19
    Sorry, Ken.

    I don't think I saw your reply, and can't find it. I can't even remember which thread it was!

    Found it! It *was* in the Suggestions for Parallax Semiconductor thread, and I didn't get a reply, which is why I started a new thread.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2011-05-10 09:58
    There seems to be multiple threads on the debugger thing, I just had some thoughts. What would it take to implement a microchip real ice style debugger? I don't understand how they are doing it, but I seems to me they are doing most of the debugging in the module. Perhaps this could be implemented without special, or very special, propeller hardware?
  • Sal AmmoniacSal Ammoniac Posts: 213
    edited 2011-05-10 21:49
    Mike Green wrote: »
    Some PASM coding involves time critical routines and, unless you plan explicitly for debugging, you can't just insert it without messing up the timing.

    The best technique I've used for debugging time critical routines without messing up the timing is instruction trace, where the instruction stream is captured to a buffer on the debugger and later analyzed.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-05-10 22:41
    You can debug PASM routines in real time by using or outa,debug_mask and andn outa,debug_mask, and watching/measuring the signal(s) on a scope. In most cases the "debug" instructions won't even interfere with a waitvid. At least that's the way I do it.

    -Phil
Sign In or Register to comment.