Go Down

Topic: ARM On-Chip Debugging: What do I need to use it? (Read 1 time) previous topic - next topic

Darkwing

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! :)
Darkwing

pico

#1
Jun 08, 2014, 03:30 pm Last Edit: Jun 08, 2014, 03:44 pm by pico Reason: 1

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! :)
Darkwing


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.
WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

Darkwing

Thanks for your answer!

Atmel -ICE Basic indeed looks good. Can you tell me what's the difference to Atmel SAM-ICE?? The description says that it is a 'JTAG emulator', instead of 'debugger' or 'programmer' as is -ICE Basic -- which is confusing to me because 'emulator' is in 'ICE' itself?…

So if -ICE Basic ist for ARM and AVR, and SAM-ICE is just for ARM, then why is it double the price?
(Because it supports other ARMs along Cortex-M too?)

pico


So if -ICE Basic ist for ARM and AVR, and SAM-ICE is just for ARM, then why is it double the price?


Mostly a marketing artifact. Atmel have decided to bring the price down aggressively with their new line of debuggers, realizing its probably not good business to try to make money out their tools. The older debuggers reflect their older pricing strategy.

Just have a careful read of the specs of the various devices to understand their different features, and don't pay too much attention to the price tag.

WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

MicroNut

The supported devices for the AVR Dragon does NOT show any SAM devices. The AVR -ICE does show it. So does this mean you cannot use the Dragon but you can use the ICE?

pico

#5
Jun 10, 2014, 04:44 am Last Edit: Jun 10, 2014, 04:51 am by pico Reason: 1

The supported devices for the AVR Dragon does NOT show any SAM devices. The AVR -ICE does show it. So does this mean you cannot use the Dragon but you can use the ICE?


Yes, that's right. Up until these latest -ICE debuggers, I don't believe there was a debugger that did both Atmel ARM  and AVR... you needed a separate debugger/programmer for each architecture.

For AVR devices, the AVR Dragon has advantage of allowing you to do HVPP (high voltage parallel programming), which the newer combo AVR/ARM devices can't do -- just JTAG progamming AFAICT. So if you just wanted to do AVR, the dragon might be the better choice. But if you want to do Atmel ARM as well, then the newer -ICE debuggers are probably a no-brainer.


WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

Darkwing

Ok, thanks for your guidance!
The new -ICE debuggers sound good in deed!

Mentioning HVPP:
Does the ARM Cortex-M have such a thing like 'fuses' too and are they accessible through high voltage programming? Or does ARM work in a totally different way here than the ATmegas? In other words: do I need to be able to set 'fuses' in case something weird goes wrong while developing?

pico

#7
Jun 11, 2014, 02:30 pm Last Edit: Jun 11, 2014, 02:35 pm by pico Reason: 1
HVPP isn't relevant for the Atmel ARM chips, it's only useful for the AVR chips when you get locked out of chip by corrupted fuse settings that won't allow you to reset via serial (ISP or JTAG) programming. It's also only useable for AVR chips that are out of the circuit.

So it's a useful feature to have if you are also working with AVR chips, but definitely nothing to miss if you are only working with SAM ARM on a Due.

Edit: One additional thing you might want to double check is whether the Atmel -ICE Basic comes with a cable that you can plug into the "mini" JTAG header on the Due, or whether you need to get an adapter. I think Olimex, for example, make an adapter for not too much money. I know you needed one these to work with some of the JTAG debuggers.
WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

Darkwing


Go Up