I am new to Arduinos and I have a beginner question about programming the things.
It seems very difficult to program these things over the USB port. I have to time the turning on of the power switch as the IDE churns out the upload function with very little room for error. I am guessing that is because there is a narrow window to catch the bootloader before it transitions to the demo application you have on there.
Is this normal? We have to program 150 of these and I am dreading the thought of this. I have tried to find help on using AVRDUDE so that I could use a batch script to program our target .bin file but have had no success so far. Is using an in-circuit emulator the only choice here? I don’t see a programming header on the board so that would mean having to solder one in for every board, right?
Any guidance is appreciated.
Regards,
Mark
BTW I have a 9dof Razor with an ATSAMD21 CPU
Hi Mark.
You shouldn’t need to turn the power on and off to enter bootloader on these, the IDE will do that for you when it goes to upload code.
We’re not able to help you with a script to program the board with avrdude but if you turn on all the debugging options in Arduino you should be able to see how the IDE uses avrdude and that might be helpful in creating a script to speed up programming.
As far as a programming header goes, the board does have a 2x5 connector with 1.27mm spaced pins. You might be able to rig up some tiny pogo pins that you can press between the header and a hardware programmer like the [Atmel ICE and program the boards that way. If you stick them in at the right angle, a 2x5 header like [one of these might work too. That would save you from having to solder a header to each board. Might be tricky to get all the contacts to make a connection though.](Header - 2x5 Pin (Male, 1.27mm) - PRT-15362 - SparkFun Electronics)](https://www.sparkfun.com/products/14950)
Hi Chris,
Thank you for the response. I get that you are catering to hobbyists and I am used to a more professionally-targeted company. I guess I am am surprised that there is no convenient solution to program these boards for anything other then a prototype and no thought given to any type of production.
My question about the 2x5 header is that it doesn’t look like the pinouts match any of the programmer/emulators I have seen (including yours). That seems very odd to me - why wouldn’t the pinouts match? It seems I must be missing something. Is the customer expected to make special cables (for no apparent reason)? If I needed thousands I would make my own boards, but for medium production (<1000) it is easier to buy off the shelf.
Regards,
Mark
Hi Mark.
I guess I am am surprised that there is no convenient solution to program these boards for anything other then a prototype and no thought given to any type of production.
These boards were never intended to be used in a production environment, but we do include the programming header for the SAMD21 if you wanted to program them outside using the USB connector. That would be the fastest way to reprogram many of them at a time but unless you want to solder a header to each board, you will want to find a pogo connector that fits the header.
My question about the 2x5 header is that it doesn’t look like the pinouts match any of the programmer/emulators I have seen (including yours).
The connector matches the standard [ARM Cortex debug connector and most programmers including the Atmel ICE should be able to plug right into it. The picture below shows how the pins are numbered and what they connect to on the programmer. It’s possible you may need to make a cable to adapt the pinout to your specific programmer, but you could use the same cable to program thousands of boards.
](Documentation – Arm Developer)