Go Down

Topic: The perfect debugging tool (Read 4 times) previous topic - next topic

Graynomad

If you could have a tool or tools for debugging Arduino hardware/software what would that tool or tools be?

Just to put this in context, I'm playing with some ideas for a simple debugging tool that plugs into an Arduino, think logic-analyser-slash-protocol-analyser-slash-monitor etc. We're not talking big $ here so as much as I think a 3GHz storage scope would useful that won't be in the design.

I've already included a lot of stuff but don't want to bias any opinions so won't reveal all just yet.

And before you ask, yes it will be open source, so your ideas won't become proprietary and make me a million at your expense :)

So, bright ideas anyone?

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

robtillaart


Sniffer for serial, i2C, SPI, onewire, ...
RAM usage monitoring ...



Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

frank26080115

Turn the Open Bench Logic Sniffer into a shield
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

CrossRoads

Ability to interpret commands to and responses from slaves.
A lot of the time, simple serial prints are all that is needed, but being able to see the hardware bits flipping is sure handy at times :)

Think a tri-state/input mode test would be handy? Maybe pull a pin high/low with something like 0.5mA load, if it can wiggle it is not active output?
How much can a pullup resistor source?


Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Graynomad

#4
Sep 12, 2011, 01:55 am Last Edit: Sep 12, 2011, 02:01 am by Graynomad Reason: 1
Quote
Sniffer for serial, i2C, SPI, onewire,

Already done, 4x serial signals, 1xi2c and 2xSPI, all in hardware. 1-wire not done because that's a software thing, therefore it can be done later.

Quote
RAM usage monitoring ...
Very intrusive, but could be done. I know this is a common issue. The monitor could fill blank RAM then test for the pattern later, finding the bottom of the stack is easy and AVRmon already does that, I just have to find out where the top of the heap is, maybe a quick 1-byte malloc.

Quote
Turn the Open Bench Logic Sniffer into a shield

Done, the plan is to make it a shield with all connections (except some user inputs) pre-wired.

Quote
Ability to interpret commands to and responses from slaves.

My AVRmon program already does that, I plan to incorporate it into this gadget.

Quote
A lot of the time, simple serial prints are all that is needed,

Handled in a couple of ways, you won't need the Arduino's hardware UART to print data to the screen.

Quote
being able to see the hardware bits flipping is sure handy at times

Done.

Quote
a tri-state/input mode test would be handy? Maybe pull a pin high/low with something like 0.5mA load, if it can wiggle it is not active output?

Hmm, I hadn't thought of that. I'll do so now :)

Thanks guys, it sounds like I'm on the right track so far.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Graynomad

Here's a block diagram, of course block diagrams are easy to draw :), getting a working circuit and code is a totally different thing.
Rob Gray aka the GRAYnomad www.robgray.com

frank26080115

How about a FT2232H based JTAG debugger?
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Graynomad

That FT2232H does look like one sweat chip.

I already have USB, but no JTAG for two reasons. The first is that I don't know much about JTAG, the second is that most Arduinos don't have JTAG.

The Mega does though and the pins are brought out to headers.

I'm happy to collaborate on this or any other feature.

_____
Rob
Rob Gray aka the GRAYnomad www.robgray.com

frank26080115

most Arduinos don't have JTAG.


oops, my bad, I assumed all AVR chips had JTAG, I guess not
I wonder if you can get DebugWIRE working somehow without official Atmel hardware
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Graynomad

Quote
I wonder if you can get DebugWIRE working somehow without official Atmel hardware

Now that would be nice, why it's a closed protocol I have no idea.

I suppose it could be broken but I've not heard of it being done yet, there's an opportunity for a bright young lad.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

Looks like you are only planning to support standard 168/328s with 20 IO?

324/644/1284's have JTAG too, and dual serial. I need to come up with neat project for my Bobuino.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Graynomad

That drawing is a little bit out of date (3-4 hours :)), at last count I had all 20 standard IO plus another 8 "user" inputs making a total of 28 that feed directly into the analyser. I think you have 32 IO on the Bobduino so that's close. So far that's all I can pack in (at least for high-speed sampling) as I only have 32 bits and some are needed for housekeeping. I can however add extra bits for low frequency (still maybe a few MHz) checking of logic levels.

All could be displayed at human-speeds, maybe a nice graphic with LEDs for each pin. Actually, although a GUI is a way down down the track maybe having a picture of an Arduino with "logic probes" and "volt meters" you attach to pins would be a fun exercise. 

As I said, if someone knows about JTAG I'm happy to collaborate, maybe the best thing to do is just allow a convenient way to connect a standard JTAG debugger. OTOH maybe it's not that hard to implement JTAG myself, I just don't know :(

I have 4 serial inputs, by "inputs" I mean single signals, therefore that's two full serial lines, 4 half lines or any combination. These go into hardware UARTs for protocol analysis but any of the 8 user inputs can to timing as well. If an analyser is written to decode timing waveforms like the Saleae et al then you can presumably have as many as you like.

The monitor program is table-driven and can easily be made to work with the 1284.

As the Bobduino has standard headers this should plug straight in. The extra 8 IOs on that expansion header could be cabled to my user inputs.

BTW, I've added your "pin test" idea.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

The four serial inputs could be 2 sets of Rx/Tx pins? Thats cool then.

The pin test, guess it could be handy.

I don't know anything about JTAG except the names of the signal lines - TDI, TDO, TMS, TCK - and what its supposed to allow you to do per some  Atmel website reading. I haven't done anything fancy enough in SW to need more then the occasional serial print tho.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Graynomad

Quote
The four serial inputs could be 2 sets of Rx/Tx pins?

That's right.

I'll build pin testing into the logic probe I think.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

floating test in a probe - that sounds good.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up