Programmer Arduino Due with St-Link V2

Hi Friends

I've always programmed arduino in the classic way, the way we all know and from the arduino IDE, but right now I'm doing a project that requires programming through ICSP pins, in order to save the delay time generated by the BootLoader Of Arduino. After a few days of reading, I decided to buy a ST-LINK V2 programmer to be able to directly program the ARDUINO DUE microcontroller. At this point, I already have everything I need to start programming this way, but I have several questions that I would appreciate if I could collaborate to get out of all the doubts I have.

  1. The same sketch that I had to program the classic Arduino, I use it to program it through icsp?

  2. Why software can I upload .ino files? Or is it necessary to make .hex files and how?

  3. I do not know if I am connecting the ST-LINK v2 well, since the pins it brings are swdio and swclk, and when checking the Arduino Due datasheet, the pins it brings in ICSP are MISO and MOSI, so I do not know how or where the ST-LINK V2 should really be connected to the arduino so it can be programmed directly into the microcontroller.

  4. I would like you to advise me how to turn on and off a led with the ARDUINO DUE, but through ICSP programming.

Excuse my ignorance, so far I'm going deep into this arduino world.

Many thanks friends!!

Hi all, I also have this version of the ST-Link V2 and am trying to connect to an arduino ATMega2560. I know the pinout of the ICSP on the arduino board but am not sure which pins to connect to on the ST-Link V2 in order to flash the boot rom on it. Any help would be much appreciated. Thanks!

On the 2560, the JTAG pins are in port F, not the ISP connector.

Which software is the bigger question. I would expect it would have to come from ST but I’m sorry, I cannot be of any help with the details.

Thanks for your reply... I've been trying to use the software that works with this programmer (the device I have is actually a smaller clone of that device), "STM32 ST-Link Utility" (here, the download link is at the bottom of the page) and the Arduino IDE (v 1.8.5 with a bunch of different 3rd party boards downloaded and installed through the board manager). So far I have had no luck actually connecting to the microprocessor in order to flash the boot rom to whatever is typically shipped with these Arduino dev boards.

I am not sure which pins on the ST-Link V2 have to be connected to the Arduino's ICSP pins... I mean, some are pretty obvious like +5V, ground, clock and reset, but among the ICSP pins, there are also MISO and MOSI.... I don't know what those correspond to on the ST-Link V2 device though. I've read through documentation for the ST-Link V2 but that wasn't any help... it may be due to the fact that I don't have much experience in this field and the answer was right in front of me, lol.

I super appreciate any and all assistance, have a good one!

Why are trying to program an Atmel processor with a programmer and software made for ST processors? Then you describe how you're trying to connect connect a JTAG programmer to the ISP pins of the ATmega2560. I hope you understand how pointless your effort is.

If you're trying to burn a bootloader onto an ATmega2560, buy the right tool for the job. A $2 USBASP from eBay is all that you need, it's directly supported in the Arduino IDE.

Is the ATmega2560 on a board of your own design or is a commercial product?