Hi, I am trying to use an Atmel-ICE programmer to program a SAM4S Xplained Pro board using the SWD interface, but I keep getting a "No device detected. Error 4109". I think I have connected everything up as explained in the datasheets. Below is how I have done this.
I have connected the "50-mil 10-pin mini squid cable" of the SAM connector on the Atmel programmer, this is connected to the SAM4S board using the test points on the back of the board, the pins I have connected are as follows,
SAM Squid Cable | SAM4S Board |
Pin 1 VTG | VCC |
Pin 2 SWDIO | TMS |
Pin 4 SWCLK | TCK |
Pin 6 SWO | TDO |
Pin 10 NotRST | RST |
Pin 3, 5, 9 GND |
GND |
I am powering the board using a USB cable plugged into the SAM4S USB port. I have tried the Microchip Studio GUI programmer and the command line programmer and I get the same error for both.
This is how the GUI is set up and it finds the programmer and reads the boards voltage as you can see,
Below is the error message I am seeing,
I have read I may need to force the MCU into SW-DP mode (as it starts up in JTAG-DP mode), but I am unsure if this is the cause of the error and if so how I go about doing this. Do I need to write some code to manually do this, or does the programmer automatically do this when I select SWD mode?
I have also seen there is a JTAGSEL pin on the board, my understanding is this is active high so if it is low then SWJ-DP should not be selected so I can program using the SW-DP, is this correct, or do I need to pull this high to connect using the SWD?
Thanks for any help, and I am happy to give any more information or clarify anything that is not clear.