Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 8 Replies) Atmel-ICE + MKRWiFi1000 - Debug Fails to Start (Read 2612 times)
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Feb 9th, 2021 at 5:46pm
Print Post  
Hi, I am here again.

Windows 10 Pro  and System Info:
(I put it here because I can only attach two files)
Quote:
Microsoft Visual Studio Community 2019
Version 16.8.4
VisualStudio.16.Release/16.8.4+30907.101
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Community

Visual C++ 2019   00435-60000-00000-AA020
Microsoft Visual C++ 2019

Arduino IDE for Visual Studio by Visual Micro   19.0
Visual Micro is an Arduino Compatible IDE for Visual Studio 2017-2019. For more information and forum please visit www.visualmicro.com.

ASP.NET and Web Tools 2019   16.8.557.25636
ASP.NET and Web Tools 2019

C# Tools   3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

NuGet Package Manager   5.8.1
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

Visual Basic Tools   3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake


Now that I can compile and upload with the USB port, I want to connect and use the Atmel-ICE.
The board, MKRWiFi1010, is connected at the PC with USB cable only for power, checked hardware,  only tho wires inside the cable, and software: Windows - Device Manager - No COM ports available.

I studied the page carefully: https://www.visualmicro.com/page/SAM-Debugging.aspx ;

My setting is: 

vMicro – General – Global Option – GDB and On Chip Debugging – Gdb Enable = true
(Otherwise no errors, but don’t stop at breakpoint).

vMicro – Debugger – Debug - Debug: Hardware
Hardware programmer = Atmel-ICE

Build – Configuration Manager – Configuration = Debug; Platform = Win32; Build = unchecked; Deploy = unchecked;

vMicro - Debugger - Compiler Optimization = Default Optimization (If I change I can't compile without errors).

Build - Clean Solution
Debug - Start Debugging

The code is uploaded and run, you can see in the picture attached the flashing led inside the waiting for serial, and the led FLASH as programmed.
You can see also a breakpoint at line 58, obviously ignored if I see led flashing.

Attached you can find the Output captured jus before the error, after the error the Output is:

Quote:
Starting: duino7\bin/openocd.exe" -d2 -s duino7/share/openocd/scripts/" -c "adapter driver cmsis-dap" -c "cmsis_dap_vid_pid 0x03eb 0x2141" -c "transport select swd" -f riants/mkrwifi1010/openocd_scripts/arduino_zero.cfg" -c "init; reset halt"
Starting: \7-2017q4/bin\arm-none-eabi-gdb.exe" --interpreter=mi
duino7\bin/openocd.exe" exited with code 1 (0x1).
« Last Edit: Feb 12th, 2021 at 5:15pm by Simon@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Atmel-ICE, it doesn't work for me.
Reply #1 - Feb 11th, 2021 at 1:49pm
Print Post  
No news?
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: Atmel-ICE, it doesn't work for me.
Reply #2 - Feb 11th, 2021 at 1:53pm
Print Post  
We are looking into this, and will try and provide a potential work around shortly, which will just use the packaged options from the board package, via the custom GDB Debugger JSON file.
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: Atmel-ICE, it doesn't work for me.
Reply #3 - Feb 11th, 2021 at 2:45pm
Print Post  
Workaround Option #1 - Specific to the project posted here
If you go to vMicro > Add Code > Add Custom GDB Debugger (Advanced), a new JSON File will be added to your project called "SAMD_MKRWIFI1010.Debug.debugger_launch.json"
Replace the contents of the file with the one attached here, and then try starting the debugging session again.

Workaround Option #2 - For any MKR1010Wifi project with Atmel ICE
Instead of the above, go to vMicro > Add Code > Add Local Board.txt, and add the below entries, and try debugging again:
Code
Select All
tools.atmelICE.server.boardCmd=
tools.atmelICE.server.scriptPath=
tools.atmelICE.server.targetCmd=-f "{runtime.platform.path}/variants/{build.variant}/{build.openocdscript}"
tools.atmelICE.program.boardCmd=
tools.atmelICE.program.scriptPath= 



We are still investigating the root cause of the pattern merging incorrectly for this board/debugger combination.
« Last Edit: Feb 11th, 2021 at 4:02pm by Simon@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Atmel-ICE, it doesn't work for me.
Reply #4 - Feb 11th, 2021 at 5:50pm
Print Post  
I thought it was my problem. 
I tried the two workarounds, but they don't work, but no problem, I'm waiting for the final solution.
Good job.
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: Atmel-ICE, it doesn't work for me.
Reply #5 - Feb 11th, 2021 at 7:00pm
Print Post  
Thanks for trying them.

Can you try the below command at the command prompt, and send us the output so we can understand further what is failing:
Code
Select All
duino7\bin/openocd.exe" -d2 -f
riants/mkrwifi1010/openocd_scripts/arduino_zero.cfg" -c "init; reset halt" 

  
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Atmel-ICE, it doesn't work for me.
Reply #6 - Feb 11th, 2021 at 7:46pm
Print Post  
Here attached the requested file.

Bye
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #7 - Feb 12th, 2021 at 5:17pm
Print Post  
Thanks, the log from the OpenOCD command in the previous post looks correct.

With Only Work Around #2 in place:-
1) Enable vMicro Upload > Verbose
2) Can you try build + attaching the Debugger, and send the full Micro Build Output?
  
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #8 - Feb 12th, 2021 at 5:36pm
Print Post  
Ok here there are the files.

  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #9 - Feb 12th, 2021 at 5:45pm
Print Post  
Looking inside the file attached before, I see at line 40:
Quote:
openocd: undefined debug reason 7 - target needs reset


So I press the reset on the board and again Attach to process.
Here this output.
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #10 - Feb 12th, 2021 at 6:37pm
Print Post  
Thanks,  Is there any additional output in the Micro Build Log after you have Attached?

There should be something similar to the below:
Code
Select All
# MI Debugger Properties
{
  "serverLaunchTimeout": 5000,
  "filterStdout": false,
  "filterStderr": true,
  "targetArchitecture": "arm",
  "stopAtEntry": false,
  "externalConsole": false,
  "MIMode": "gdb",
  "MIDebuggerServerAddress": "localhost:3333",
  "cwd": \\Debug",
  "MIDebuggerPath": -eabi-gcc\\7-2017q4/bin\\arm-none-eabi-gdb.exe",
  "MIDebuggerArgs": "-ex \"flushregs\"",
  "debugServerPath": "C:\\ProgramData\\vmicro\\tools\\openocd-0.10.0.20200213\\bin/openocd.exe",
  "debugServerArgs": "-d2 -l le\\Debug/MKR1010Wifi_ICEGDB.ino_DebugOpenOCD.log}\" -s \" -f \"interface/ftdi/minimodule.cfg\" -c \"transport select swd\" -c \"ftdi_layout_signal SWD_EN -data 0\" -f \"target/nrf52.cfg\" -c \"init\"",
  "program": KR1010Wifi_ICEGDB.ino.bin",
  "logging": {
    "moduleLoad": false,
    "trace": false,
    "engineLogging": false,
    "programOutput": false,
    "exceptions": false,
    "traceResponse": false
  },
  "visualizerFile": \\Debug\\debugger_tmp.natvis",
  "showDisplayString": true
} 

« Last Edit: Feb 12th, 2021 at 6:39pm by Simon@Visual Micro »  
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #11 - Feb 12th, 2021 at 7:58pm
Print Post  
I have loaded the board with the sketch, then I close VS.
I have resetted the board.
Open VS, Build, Debug - Attach to process.
This is the Output and the screen shot.

As you can see from the screenshot there is a breakpoit at line 58, but the program don't stop and I see the flashing led waiting for Serial, so the program is running.
If I open TeraTerm the program proceed.

if I press the PAUSE icon [||] the program stops somewhere and I can go step by step. 
If I put a breakpoint inside the loop, and press CONTINUE, don't stop.
Seem to works but ignores breakpoint.
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #12 - Feb 12th, 2021 at 9:38pm
Print Post  
Thanks for the detail and persistence, we will continue to investigate and we will update this thread when this has been completed.
  
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #13 - Feb 12th, 2021 at 11:16pm
Print Post  
There are strange behaviors.

I decide to put a break point in main.cpp, line 37.
I press START and all works, the program stops at line 37, I can go step by step, If I press CONTINUE the program stops at line 58, at the second breakpoint.
Here the first Output (break_init.txt).

I remove the all the breakpoints (Debug - Delete All Breakpoint) close VS.
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #14 - Feb 12th, 2021 at 11:27pm
Print Post  
Again
Reopen VS and set a breakpoint at line 58 and press START the program starts and stop at line 58, but look the screenshot: the program is stopped at line 58, in the output you can see that there are two breakpoint, but if I press the Breakpoint icon I see only one, at line 58.


Debug - Attach to process don't stop at breakpoint.
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #15 - Feb 12th, 2021 at 11:29pm
Print Post  

Making this series of test I have also see, after press START, the led fade-in fade-out as when the bootstrap is started pressing two times the reset button, but I don't touch the reset. see output attached.

I hope it will be useful.
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #16 - Feb 13th, 2021 at 6:47am
Print Post  
Good morning.
Today just turned on the PC I tried.
Open VS and the usual example EthernetHTTPS2.
The breakpoint at line 58 is still there.
I press |>START
The sketch is compiled, uploaded and stop at breakpoint at line 58, every thing seems ok.
In the Output window, bottom right, i see again 2 breakpoint, but in breakpoint list ther is only 1, as yesterday.
There are also some errors not displayed during compile after the start button.
Then I try to arrange the windows to take a screenshot of all together and detach the window of output from the bottom corner, but the window output-breakpoint are all together, so I decide to put the window in the original position and I drag the window to the bottom, when I release the window in the original position the system CRASH.

I open again, again |>Start
Now an error say: No valid JTAG ... see attached file.
It all seems very unstable.

  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #17 - Feb 13th, 2021 at 8:10am
Print Post  
It's repetitive.
Open VS with EthernetHTTPS2 - Start, after uploading the screen is as in window1.jpg
I move the output window as in window2.jpg
If I move the window back in its original position VS crash.
« Last Edit: Feb 13th, 2021 at 8:11am by Livio »  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Livio
Junior Member
**
Offline


Posts: 55
Location: Italy
Joined: Jan 10th, 2018
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #18 - Feb 13th, 2021 at 8:18am
Print Post  
Now I want to investigate about the two breakpoint listed in the output.
Open VS - open EthernetHTTPS2 - Debug - Delete all breakpoint - ( I want to see if they will be still in the output) - Start  -> I can't see the output window on bottom right because there is an error.

Attached is the Output.
« Last Edit: Feb 13th, 2021 at 8:20am by Livio »  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2704
Joined: Feb 13th, 2019
Re: Atmel-ICE + MKRWiFi1000 - Debug Fails to Start
Reply #19 - Feb 13th, 2021 at 9:55am
Print Post  
To try and answer all of these points:

Debug Start Hits Breakpoint, Debug Attach Does Not
Debug Start resets the board so you can hit a breakpoint as early as setup(), the Attach to Process will join the program where it is running currently (no reset).  With the breakpoint where it is on line 58, running Attach to Process will join the program after this line of code has been passed.

Two Breakpoints
The break on init() I believe from the reset command being sent to the board at the start of the debugging session, and it sending back the message as it hits its first line of code (init()).  This can be ignored as it is not a real breakpoint, which is why it is not in the breakpoint list in VS.

Upload / Debug Errors After VS Crash
It is possible the crash is leaving orphaned OpenOCD / GDB processes still connected to the board.  In this scenario, if you check in taskmgr that "openocd.exe" and "arm-none-eabi-gdb.exe" are both not running before restarting VS.  It may also be necessary to reset your board and debugger.
(The error "Error: unable to open CMSIS-DAP device 0x3eb:0x2141" can be either the device is not connected, or the device is already connected to a separate process).

VS Crash Moving Output Window During Debug Break Pause
We will investigate this further, and advise once this has been completed.
  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint