I've been using Arduino for a while, but just recently purchased a programmer and want to upload using it.
I am attempting to program a SAMD21 MCU using an Atmel SAM-ICE programmer using the SWD port. I get the following error on upload:
Open On-Chip Debugger 0.10.0+dev-gf0767a31 (2018-06-11-13:36)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
none separate
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 01.00.0021
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 400 kHz
Info : SWD DPIDR 0x0bc11477
Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0xa1000000 pc: 0x00000878 msp: 0x200023a0
** Programming Started **
auto erase enabled
Error: couldn't open {C:\Users\franc\AppData\Local\Temp\arduino_build_291259/Ventilator_5.8.ino.elf}
Error: couldn't open {C:\Users\franc\AppData\Local\Temp\arduino_build_291259/Ventilator_5.8.ino.elf}
embedded:startup.tcl:477: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 536
at file "embedded:startup.tcl", line 477
Hi @FrancisH. Are you using the Arduino IDE to do this upload?
If so, please post the full output from an upload attempt when in verbose mode.
I'll provide instructions you can follow to do that:
Select File > Preferences from the Arduino IDE menus.
Uncheck the checkbox next to "Show verbose output during: ☑ compilation".
Check the checkbox next to "Show verbose output during: ☐ upload".
Click the OK button.
Attempt an upload, as you did before.
After the upload fails, you'll see a button on the right side of the orange bar in the Arduino IDE: Copy error messages. Click that button.
This copies the full output to the clipboard.
Open a forum reply here by clicking the Reply button.
Click the </> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press Ctrl+V.
This will paste the error output from the upload into the code block.
Move the cursor outside of the code tags before you add any additional text to your reply.
Arduino: 1.8.19 (Windows 10), Board: "SparkFun SAMD21 Mini Breakout"
C:\Users\franc\OneDrive\Documents-FrancisHane\CBI\Ventilator\Software\Ventilator_5.8\Ventilator_5.8.ino: In function 'void Display_Startup()':
C:\Users\franc\OneDrive\Documents-FrancisHane\CBI\Ventilator\Software\Ventilator_5.8\Ventilator_5.8.ino:1875:40: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
reader.drawBMP("/Logo.bmp", tft, 0, 0); //display logo
^
C:\Users\franc\OneDrive\Documents-FrancisHane\CBI\Ventilator\Software\Ventilator_5.8\Ventilator_5.8.ino: In function 'void Display_Home()':
C:\Users\franc\OneDrive\Documents-FrancisHane\CBI\Ventilator\Software\Ventilator_5.8\Ventilator_5.8.ino:1894:41: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
reader.drawBMP("/Sun.bmp", tft, 15, 58); //display sun
^
C:\Users\franc\OneDrive\Documents-FrancisHane\CBI\Ventilator\Software\Ventilator_5.8\Ventilator_5.8.ino: In function 'void Display_Running_Settings()':
C:\Users\franc\OneDrive\Documents-FrancisHane\CBI\Ventilator\Software\Ventilator_5.8\Ventilator_5.8.ino:1973:44: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
reader.drawBMP("/Home.bmp", tft, 290, 210); // home button
^
Sketch uses 95216 bytes (36%) of program storage space. Maximum is 262144 bytes.
C:\Users\franc\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7/bin/openocd.exe -d2 -s C:\Users\franc\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino7/share/openocd/scripts/ -f C:\Users\franc\AppData\Local\Arduino15\packages\SparkFun\hardware\samd\1.8.3/variants/SparkFun_SAMD_Mini/openocd_scripts/arduino_zero.cfg -c telnet_port disabled; program {{C:\Users\franc\AppData\Local\Temp\arduino_build_291259/Ventilator_5.8.ino.elf}} verify reset; shutdown
Open On-Chip Debugger 0.10.0+dev-gf0767a31 (2018-06-11-13:36)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
none separate
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 01.00.0021
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 400 kHz
Info : SWD DPIDR 0x0bc11477
Info : at91samd21g18.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000878 msp: 0x200023a0
** Programming Started **
auto erase enabled
Error: couldn't open {C:\Users\franc\AppData\Local\Temp\arduino_build_291259/Ventilator_5.8.ino.elf}
embedded:startup.tcl:477: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 536
at file "embedded:startup.tcl", line 477
the selected serial port at file "embedded:startup.tcl", line 477
does not exist or your board is not connected
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
OK, that is useful. I see that you are using a significantly outdated version of the "SparkFun SAMD Boards" platform. Probably it is because SparkFun changed the "Additional Boards Manager URL" and no longer maintain the old one, as they mention here.
You can update by following these instructions:
Select File > Preferences from the Arduino IDE menus.
Click the icon on the right side of the "Additional Boards Manager URLs" field.