VS Arduino
>> >> Help with Feather M0 and ATMEL ICE with GDB debugging
https://www.visualmicro.com/forums/YaBB.pl?num=1582432814

Message started by chriso on Feb 23rd, 2020 at 4:40am

Title: Help with Feather M0 and ATMEL ICE with GDB debugging
Post by chriso on Feb 23rd, 2020 at 4:40am
When I try to use the ATMEL ICE debugger with VM and VS2019 I get this error:

Uploading 'PoolAlarmMaster' to 'Adafruit Feather M0' using 'Atmel-ICE'
Open On-Chip Debugger 0.9.0-g932ec70 (2017-02-15-12:34)
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
debug_level: 0
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x91000000 pc: 0xfffffffe msp: 0xfffffffc
** Programming Started **
auto erase enabled
Error: SAMD: NVM lock error
Error during upload using programmer
The uploader process failed

The uploader process failed
The uploader returned an error
Error: Failed to erase row containing 00000000
Error: error writing to flash at address 0x00000000 at offset 0x00000000
Runtime Error: embedded:startup.tcl:454: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 510
at file "embedded:startup.tcl", line 454

Not sure what is going on. I know the debugger works because I can connect to my M0 using Atmel Studio 7 and can load a program, etc.

OK, I realize what the problem is. VM on VS is trying to write to the protected bootloader area on the M0, so my question is now: why is VM trying to write to this area if I am compiling an Arduino sketch? 

Thanks for any help you might be able to give.

Title: Re: Help with Feather M0 and ATMEL ICE with GDB debugging
Post by Visual Micro on Feb 25th, 2020 at 1:05pm
There are various ways to upload however in atmel studio I suggest you use the programmer called "atmel studio device programming". Then visual micro will hand over to the atmel project properties to handle the upload.

Otherwise switch off the programmer and use the standard serial/usb upload which requires less knowledge.

More info in the red tips of this page

https://www.visualmicro.com/page/Arduino-for-Atmel-Studio-7.aspx

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.