EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Debugging: Am I a dreamer. . . ?

Started by Unknown April 29, 2008
On 2008-04-30, David Brown <david@westcontrol.removethisbit.com> wrote:

>> I wasn't going to mention that as it usually causes a bun fight bit >> since you have...
A bun fight sounds fun!
>> You should never debug using printf. >> >> This is why there are simulators, debuggers and Emulators. Even for >> PC's I can recall Borland had a system where you could debug one PC from >> another. For embedded using printf should have dies out over a decade ago. > > What's wrong with debugging using printf?
Nothing. It works fine for me. I'm also a fan of the "toggling port pins" method of debugging.
> I don't mean specifically "printf", which you should normally > avoid in a small embedded system, but the general idea of > putting out extra information while the program runs is a very > useful debugging technique. Simulators, debuggers, and > emulators are all important for development and debugging, but > sometimes it is easier to send out signals to show what is > happening. Of course such things involve changes to your > code, and changes to the run-time characteristics of your > system - but that's often perfectly acceptable during > development and debugging. It is not a good idea to rely on > printf-style debugging as your *only* method of debugging - > but equally it is a waste to arbitrarily exclude it from your > toolbox.
I agree 100%. Many of the embedded systems I've worked on have diagnostic headers which are connected to serial ports. Having status information being "printed" on those ports when significant events happen can be extremely useful. You do have to pay attention to the timing implications... -- Grant Edwards grante Yow! ... My pants just went at on a wild rampage through a visi.com Long Island Bowling Alley!!
On 2008-04-30, Chris H <chris@phaedsys.org> wrote:

> It is called a bond out chip. > > Used by Emulator manufacturers. Been around years
And it's been extinct for years (none of the processors I've used in the past decade have had bond out parts or real in-circuit-emulators available.
> There are also chips with Jtag and or BDM or Nuxus or ...
That's about as good as it gets these days.
> I am some what worried if you have been programming a decade > and don't know about any of this. > > BTW do NOT debug with printf
-- Grant Edwards grante Yow! My polyvinyl cowboy at wallet was made in Hong visi.com Kong by Montgomery Clift!
Chris H wrote:

> Amen :-) > > Btw who is Theresa? The only one I knew had nothing to do with god... > more the other side :-)
Several of them: Theresa of Avila is most famous. Freud would have been interested in her case. But I looked on the other siide of your email, expecting some hot totty, and all it said was something in Russian ending with H sirhC. JS
In message <L9-dnZFHX8O064XVnZ2dnUVZ_o_inZ2d@visi>, Grant Edwards 
<grante@visi.com> writes
>On 2008-04-30, Chris H <chris@phaedsys.org> wrote: > >> It is called a bond out chip. >> >> Used by Emulator manufacturers. Been around years > >And it's been extinct for years (none of the processors I've >used in the past decade have had bond out parts or real >in-circuit-emulators available.
Then you are looking an a small market. Many parts still have ICE.
>> There are also chips with Jtag and or BDM or Nuxus or ... > >That's about as good as it gets these days.
Not exactly that is about to change. If you like a Second generation JTAG+ Trace that is closer to ICe functionality. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In message <fv9u68$cf$1@aioe.org>, sprocket <jas@spam.cop.uk> writes
>Chris H wrote: > >> Amen :-) >> Btw who is Theresa? The only one I knew had nothing to do with >>god... more the other side :-) > >Several of them: Theresa of Avila is most famous. Freud would have been >interested in her case. But I looked on the other siide of your email, >expecting some hot totty, and all it said was something in Russian >ending with H sirhC.
I meant the Theresa I knew was more sinful :-)))) -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In message 
<5f41866b-bbb8-4a5a-96c3-35394420e26a@i76g2000hsf.googlegroups.com>, 
Tom&#4294967295;s &#4294967295; h&#4294967295;ilidhe <toe@lavabit.com> writes
>On Apr 30, 1:00&#4294967295;pm, Chris H <ch...@phaedsys.org> wrote: > >> >So can anyone recommend a way of debugging a program on a PIC16F684? >> >Please use full words instead of using initialisms; for instance I >> >haven't got a clue what an ICE is or what it stands for. >> >> Then you probably should not be doing embedded programming. Trey google >> with "ICE" and "embedded" > > >You really are very unbright. You're saying that if someone doesn't >know about something then they shouldn't try to learn about it. Quite >the scholar there. > >Thanks for the links.
I said if you don't know about the basic tools you shouldn't be programming embedded systems. You do need to learn. To many get a couple of MCU and a small tool set and stay on that for years. The rest of the world passes them by. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
On 2008-04-30, Chris H <chris@phaedsys.org> wrote:
> In message <L9-dnZFHX8O064XVnZ2dnUVZ_o_inZ2d@visi>, Grant Edwards ><grante@visi.com> writes >>On 2008-04-30, Chris H <chris@phaedsys.org> wrote: >> >>> It is called a bond out chip. >>> >>> Used by Emulator manufacturers. Been around years >> >>And it's been extinct for years (none of the processors I've >>used in the past decade have had bond out parts or real >>in-circuit-emulators available. > > Then you are looking an a small market.
Obviously, since I doubt it's possible for anybody to use a significant portion of the parts on the market.
> Many parts still have ICE.
Right, but it sure seems to be getting pretty rare.
>>> There are also chips with Jtag and or BDM or Nuxus or ... >> >>That's about as good as it gets these days. > > Not exactly that is about to change. > > If you like a Second generation JTAG+ Trace that is closer to > ICe functionality.
At the last embedded systems conference I went to, a lot of vendors were flogging the JTAG-based trace stuff, and it sure would be nice. I've got a real-time state-machine problem I'm trying to fix right now and if I could get a timestamped trace of writes to a couple addresses, it probably would have been fixed a week ago. :/ But, none of the parts I've ever used supported anything other than the basic "halt the processor and examine the state" JTAG interfaces. Maybe I'm just not spending enough money on processors. -- Grant Edwards grante Yow! Everybody is going at somewhere!! It's probably visi.com a garage sale or a disaster Movie!!
In message <j5KdnS2px-CYE4XVnZ2dnUVZ_o6knZ2d@visi>, Grant Edwards 
<grante@visi.com> writes
>On 2008-04-30, Chris H <chris@phaedsys.org> wrote: >> In message <L9-dnZFHX8O064XVnZ2dnUVZ_o_inZ2d@visi>, Grant Edwards >><grante@visi.com> writes >>>On 2008-04-30, Chris H <chris@phaedsys.org> wrote: >>> >>>> It is called a bond out chip. >>>> >>>> Used by Emulator manufacturers. Been around years >>> >>>And it's been extinct for years (none of the processors I've >>>used in the past decade have had bond out parts or real >>>in-circuit-emulators available. >> >> Then you are looking an a small market. > >Obviously, since I doubt it's possible for anybody to use a >significant portion of the parts on the market. > >> Many parts still have ICE. > >Right, but it sure seems to be getting pretty rare. > >>>> There are also chips with Jtag and or BDM or Nuxus or ... >>> >>>That's about as good as it gets these days. >> >> Not exactly that is about to change. >> >> If you like a Second generation JTAG+ Trace that is closer to >> ICe functionality. > >At the last embedded systems conference I went to, a lot of >vendors were flogging the JTAG-based trace stuff, and it sure >would be nice.
Lot of it about.
> I've got a real-time state-machine problem I'm >trying to fix right now and if I could get a timestamped trace >of writes to a couple addresses, it probably would have been >fixed a week ago. :/
You need an ICE :-) What is the MCU?
>But, none of the parts I've ever used supported anything other >than the basic "halt the processor and examine the state" JTAG >interfaces. Maybe I'm just not spending enough money on >processors.
What is the processor. AFAIK there are Ice for PIC, and 51 up. It is the bigger parts that don't have ICE. -- \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
In article <WAQDW9SO4GGIFA4D@phaedsys.demon.co.uk>, Chris H <chris@phaedsys.org> writes:
> In message <JYp7F0WlGlHP@eisner.encompasserve.org>, Simon Clubley > <clubley@remove_me.eisner.decus.org-Earth.UFP> writes >> >>Are you objecting to the use of the C function printf() within a embedded >>environment for debugging or are you objecting to the use of serial port >>output as a debugging tool ? > > Printf mainly. >
In which case, you are not going to get much argument from me when the embedded devices that we are talking about are at about the AVR level.
> The serial port is used by various debug systems. Monitors and some > RTOS. > >>In AVR land, I don't use printf as it's bloated (by embedded standards), > Exactly. > >>but I do have my own interrupt based UART I/O routines that I use for >>normal communication with other serial devices as well as debugging. > >>The routines implement a tty for the hardware UART as well as a Tx-only >>software UART for debugging output. As both UART's are interrupt based, >>and the output can be optionally buffered in an application specified >>buffer, I see very little overhead in using the software UART for >>outputting debug information. > > Fair enough. I assume this code is shipped in the release? >
This is in an hobbyist environment, but yes the UART driver code is included as part of a finished project. As for the debug code, it's added and removed as required during debugging, but I do find it useful to output high level statistical data on the debug port in some projects, which I can then look at if needed. In that case, I still need to be able to output the statistical data without causing the rest of the code, including any I/O on the hardware UART, to stall, so I still need the current low overhead approach which works just fine for me.
> Where you need to ship release, not debug, code you can't beat an ICE > for full speed non intrusive debugging. They have many features you just > can't do with a serial port. >
Once again, no argument here about the extra ICE functionality, but I've not yet encountered a situation here where I _absolutely needed_ those extra capabilities, which given that I'm in an hobbyist environment is probably not a great surprise, especially when the time versus cost tradeoffs are different in that environment. Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980's technology to a 21st century world
On 2008-04-30, Chris H <chris@phaedsys.org> wrote:

>>I've got a real-time state-machine problem I'm trying to fix >>right now and if I could get a timestamped trace of writes to a >>couple addresses, it probably would have been fixed a week ago. >>:/ > > You need an ICE :-)
I know. :)
> What is the MCU?
Texas Instruments MSP430F2330
>>But, none of the parts I've ever used supported anything other >>than the basic "halt the processor and examine the state" JTAG >>interfaces. Maybe I'm just not spending enough money on >>processors. > > What is the processor. AFAIK there are Ice for PIC, and 51 up. > It is the bigger parts that don't have ICE.
The parts I've used recently are ARM (Samsung), H8, AVR, and MSP430. All are plain JTAG except the H8 which I don't remember having any debugging support (except for a GDB stub that I ported to it). I think there might be real ICE for some AVR parts, but I haven't spent much time on that one yet. -- Grant Edwards grante Yow! Should I get locked at in the PRINCICAL'S visi.com OFFICE today -- or have a VASECTOMY??

Memfault Beyond the Launch