0

ITSY BITSY M4: using with Atmel-ICE
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ITSY BITSY M4: using with Atmel-ICE

by DanaK6JQ on Thu Aug 09, 2018 3:23 pm

I have both a Metro M4 Express BETA and an Itsy Bitsy M4, and I am using Atmel Studio 7 + Atmel-ICE for development. Other than discovering so many jagged edges in Atmel START, using the Metro M4 has been pretty painless.

[My application is a DSP packet radio modem that uses CMSIS-DSP, and USB. It's working well on the Metro M4 Express and should easily slide into the Itsy Bitsy M4]

However, the Itsy Bitsy M4 is a little challenging. I can do a Chip Erase, read/write the flags and even program memory with the Atmel-ICE, but Atmel Studio 7 barfs when I attempt to start debugging; the error text is not in front of me, but it's something about "found a DAP, can't talk to it, maybe your chip needs to be reset or erased".

My suspicion is the the RC reset network on the Itsy Bitsy M4 is 10k / 1uF and holds reset low too long and the Atmel-ICE loses patience. The RC reset network on the Metro M4 Express BETA is 10k / 0.1uF, which is much shorter. It otherwise looks like the SWD connection is the same on the boards; I am using the 10-pin mini-squid on the Itsy Bitsy; I believe I am connected correctly because program/verify of flash and flags works.

Is this a known problem? Am I barking up the right tree? I'm mildly tempted to go ahead and switch out the 1uF cap for a 0.1uF cap but wanted some advice before I subject the poor little critter to such excitement.

Thanks -
Dana

DanaK6JQ
 
Posts: 18
Joined: Thu Jun 15, 2017 2:38 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by danhalbert on Thu Aug 09, 2018 5:55 pm

I tried an ItsyBitsy M4 with a J-Link, and it worked fine for gdb debugging. Note that the chip is a SAMD51G19, not J19, though the J-Link does not seem to care. I don't know if Atmel Studio and the ICE would.

Besides SWDIO, SWCLK, RST, and GND, I also have Vref on the the SWD breakout connected to 3.3V on the Itsy, so five connections in all. The J-Link would not connect without the Vref connection.

So I'm not sure if it's the reset timing you're thinking of or not. If you have a J-Link try that. It seems fishy you can do the other things like programming, since I'd think they would use the RST line as well.

(Yes, we're not fond of Atmel START and ASF4 either. We used raw CMSIS for the Arduino port, and may gradually move away from ASF4 for CircuitPython.)

danhalbert
 
Posts: 1214
Joined: Tue Aug 08, 2017 12:37 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by DanaK6JQ on Thu Aug 09, 2018 6:18 pm

danhalbert wrote:I tried an ItsyBitsy M4 with a J-Link, and it worked fine for gdb debugging. Note that the chip is a SAMD51G19, not J19, though the J-Link does not seem to care. I don't know if Atmel Studio and the ICE would.


Atmel Studio cares about the device type; so I did 'Change Device'. Otherwise, the Atmel tools refuse to touch the device until the device ID matches.


danhalbert wrote:Besides SWDIO, SWCLK, RST, and GND, I also have Vref on the the SWD breakout connected to 3.3V on the Itsy, so five connections in all. The J-Link would not connect without the Vref connection.


Yeah - I've got SWDIO, SWCLK, nRST, GND and Vtarg connected. Atmel-ICE talks to the chip; I can read/write/verify the flags and flash - it just doesn't want to debug.

danhalbert wrote:So I'm not sure if it's the reset timing you're thinking of or not. If you have a J-Link try that. It seems fishy you can do the other things like programming, since I'd think they would use the RST line as well.


If I had a J-Link, I would have tried it already :-). I have a hard time believing the dice inside the packages are different with respect to SWD. I'll get the iron out and replace the 1uF cap with a 0.1uF cap link on the Metro M4 Express.

danhalbert wrote:(Yes, we're not fond of Atmel START and ASF4 either. We used raw CMSIS for the Arduino port, and may gradually move away from ASF4 for CircuitPython.)


Oh, just try doing something semi-clever like using FreeRTOS xTaskNotifyFromISR() in the USB CDC ACM callbacks. START/ASF4 doesn't change the USB interrupt priority, and it defaults to 0, which is much higher than the highest priority the FreeRTOS port allows for (4). Setting the USB interrupts to what FreeRTOS wants breaks USB. Or, something else slightly semi-clever like using ADC DMA - the START tools doesn't offer the option. OK, ADC_Sync will work... except you have to patch the interrupt ringbuffer size and ...

I really like the idea of letting vendor library code do magic with USB and such (particularly given the chance of poorly/un-documented chip issues being fixed there). But, whew, they make you work for it (in this case, I think I'm using the D51 in a way they hadn't really anticipated).

Thanks!

DanaK6JQ
 
Posts: 18
Joined: Thu Jun 15, 2017 2:38 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by DanaK6JQ on Thu Aug 09, 2018 6:54 pm

DanaK6JQ wrote:I have a hard time believing the dice inside the packages are different with respect to SWD. I'll get the iron out and replace the 1uF cap with a 0.1uF cap link on the Metro M4 Express.


After looking at the D51 datasheet, I suspect the capacitor on nRST is not actually required (or could be arbitrarily small), see section 7.4. So I figured-out which cap it was (right next to the reset button), lifted one end, and... now Atmel-ICE is happy. I'd suggest changing the 1uF cap to 100n on future production runs, since that's good enough for the Metro M4... unless there's some reason the Itsy Bitsy is different.

Thanks -
Dana K6JQ

DanaK6JQ
 
Posts: 18
Joined: Thu Jun 15, 2017 2:38 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by danhalbert on Thu Aug 09, 2018 7:24 pm

I'll pass on the suggestion -- thanks for doing the experiment!

Dan, KB1RT (also on EMRFD, and we are both on this very old list: https://groups.google.com/forum/#!topic ... bZlI_nsaq8)

danhalbert
 
Posts: 1214
Joined: Tue Aug 08, 2017 12:37 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by DanaK6JQ on Thu Aug 09, 2018 7:38 pm

danhalbert wrote:I'll pass on the suggestion -- thanks for doing the experiment!

Dan, KB1RT (also on EMRFD, and we are both on this very old list: https://groups.google.com/forum/#!topic ... bZlI_nsaq8)


Oh my, that's a blast from the past! Thanks for the help. BTW, the DSP project is a 1200-baud KISS TNC; I'm seeing decode performance essentially as good as Direwolf's E+ modem, without the overhead of a PC or even an SBC :-) Started out as a bit of a "hold my beer a minute" experiments to see how useful the Cortex-M DSP was. Also have a very good RTTY demodulator built around the same bones.

73,
Dana K6JQ

DanaK6JQ
 
Posts: 18
Joined: Thu Jun 15, 2017 2:38 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by adafruit2 on Fri Aug 10, 2018 12:26 am

ok we dont have an exactl plan for when we're going to revise the itsy build, so for now please remove the cap yourself - its only an 0603 ;)

adafruit2
Site Admin
 
Posts: 17493
Joined: Fri Mar 11, 2005 7:36 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by DanaK6JQ on Fri Aug 10, 2018 12:52 am

adafruit2 wrote:ok we dont have an exactl plan for when we're going to revise the itsy build, so for now please remove the cap yourself - its only an 0603 ;)


I removed it (lifted one end) but, for production, you might want to swap a 100n cap in so it's functionally identical to the Metro M4 (which is known to work, at least for me, with the Atmel-ICE). Less risk of surprise that way, right?

Thanks - love the hardware.

Dana K6JQ

DanaK6JQ
 
Posts: 18
Joined: Thu Jun 15, 2017 2:38 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by adafruit2 on Fri Aug 10, 2018 12:55 am

yep! we just dont have an exact ETA for the ECO

adafruit2
Site Admin
 
Posts: 17493
Joined: Fri Mar 11, 2005 7:36 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by DanaK6JQ on Fri Aug 10, 2018 1:09 am

adafruit2 wrote:yep! we just dont have an exact ETA for the ECO


I expect the vast majority of customers won't ever attach an Atmel-ICE to an IBM4, so I don't really see a sense of urgency here :-)

Thanks again,
Dana K6JQ

DanaK6JQ
 
Posts: 18
Joined: Thu Jun 15, 2017 2:38 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by sigi on Fri Aug 24, 2018 12:47 pm

I bought an itsybitsy as well and a few days ago an atmel ice and now I have the same problem only I'm a beginner and have the experience nor the tools to 'lift' this capacitor that, as i understand it, shouldn't be there. It would be much appreciated if you could show me which capacitor exactly we're talking about so i can try fix it since upgrades and bug fixes are not a thing with hardware.

sigi
 
Posts: 3
Joined: Fri Aug 24, 2018 12:40 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by adafruit2 on Fri Aug 24, 2018 12:54 pm

cap.png
cap.png (548.75 KiB) Viewed 102 times

adafruit2
Site Admin
 
Posts: 17493
Joined: Fri Mar 11, 2005 7:36 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by sigi on Fri Aug 24, 2018 1:00 pm

Thanks!

sigi
 
Posts: 3
Joined: Fri Aug 24, 2018 12:40 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by DanaK6JQ on Fri Aug 24, 2018 1:25 pm

sigi wrote:Thanks!


I used a very fine-point soldering iron to heat one end of the cap, then heat the other end and gently lifted it so it's not in contact with the pad. Be gentle. I added a 0.1uF leaded capacitor externally to the nRST line; this may not be necessary if everything works for you.

Dana K6JQ

DanaK6JQ
 
Posts: 18
Joined: Thu Jun 15, 2017 2:38 pm

Re: ITSY BITSY M4: using with Atmel-ICE

by sigi on Sun Aug 26, 2018 1:24 pm

Thanks Dana, for the advice and getting to the bottom of this. I would've attributed it to my own incompetence if you hadn't posted this. Adequate tools will be arriving tomorrow. It was an excellent excuse to invest in a decent station.

sigi
 
Posts: 3
Joined: Fri Aug 24, 2018 12:40 pm

Please be positive and constructive with your questions and comments.