I heard that all ARM cores (processors?) feature on-chip debugging and stuff. I already read some threads here about some SAM-ICE and so on, but I still can’t wrap my head around the actual ‘how then do I do it now’?
So the simple question is: What do I need to make use of all the interesting ARM On-Chip Debugging feature(s) ?
By asking this, I assume that the Due using an ARM has
such a thing, doesn’t it? (I’m kind of confused, because here
it is said, that the upcomming Arduino Zero will be the first board with ‘integrated debugging something’. So what’s the deal with the Due? It has an ARM …)
To refine the main question more:
1. What hardware do I need for interfacing?
2. What software do I need to actually work with all these things?
3. What’s the cheapest possible solution I can purchase?
4. What’s the ‘best’ (= most reliable) solution a hobbyist should use?
Thanks so much!
You'll need an ICE or similar debugger to interface your board with an the Atmel Studio 6.1 IDE (Atmel Studio is a free download from Atmel.)
For a suitable ICE, try one of the new inexpensive -ICE models: http://store.atmel.com/CBC.aspx?q=c:100112
They work for AVR chips as well, which is nice. The $49 -ICE Basic looks like a good deal. I'd probably get one myself except I've got an AVR Dragon for AVR JTAG debugging, and I have no interest in Atmel ARM on-chip debugging at the moment.
To debug, you'll have to port your program to run in Atmel Studio, which means translating Arduino C++ to "real" C++. You can find tutorials on how to do this.
What the Arduino team have in mind with Zero, who knows, but a) I wouldn't bet on seeing any of it any time soon, and b) it almost certainly won't be running in the Arduino IDE, at least not initially (which probably means it will be running debug sessions in Atmel Studio anyway.)
From what I've read, the on-board debugging chip on the Zero supports debugWire, which is an Atmel proprietary debugging protocol. The Due supports JTAG, which is an open standard, so you don't need the magic chip.
So if you want to do on-chip debugging, just get your code running on a platform that supports JTAG (doesn't have to be ARM, some of the larger AVR chips such as the 1284p also support JTAG), get Atmel Studio and the -ICE Basic or similar , and then you're away. Well, after you've learnt to drive the thing. But you knew you were going to be up for that, anyway, I would assume.