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]  Send TopicPrint
Very Hot Topic (More than 25 Replies) Linker error on first build for visual micro (Read 18803 times)
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Linker error on first build for visual micro
Feb 2nd, 2020 at 9:41pm
Print Post  
Atmel studio 7

Code
Select All
Compiling 'vmicro_test_1' for 'Arduino M0 Pro (Programming Port)'
Build Folder: bg/Release"
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines:
Architecture Tools: eabi-gcc/7-2017q4/bin/"
Api: 1.1911.23-0
Sketch Book: "file:///C:/Users/chris/OneDrive/Documents/Arduino"
Sketch Include Paths
Core Include Paths
Include Path .8.3/cores/arduino"
Include Path .8.3/variants/arduino_mzero"

Deep search for libraries ...
\7-2017q4\bin\arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC  -g -DVM_DEBUG_GDB   -DF_CPU=48000000L -DARDUINO=108011 -DARDUINO_SAM_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -mthumb -DUSB_VID=0x2a03 -DUSB_PID=0x804f -DUSBCON -DUSB_MANUFACTURER="\"Unknown\"" -DUSB_PRODUCT="\"Arduino M0 Pro\"" IS/Include/" .0/CMSIS/Device/ATMEL/" ores\arduino" ariants\arduino_mzero" se\vmicro_test_1.cpp" -o "nul"

Building variant ...

  Using previously compiled variant

Building core ...

Building project code ...
  Using previously compiled file: e\vmicro_test_1.cpp.o

Linking it all together ...
# Coping cached core 2a27b\core.a to e\core.a

\7-2017q4/bin/arm-none-eabi-g++" ease" -Os -Wl,--gc-sections -save-temps ariants\arduino_mzero/linker_scripts/gcc/flash_with_bootloader.ld" dbg\Release/vmicro_test_1.ino.map" --specs=nano.specs --specs=nosys.specs -mcpu=cortex-m0plus -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -o se/vmicro_test_1.ino.elf" "vmicro_test_1.cpp.o" 12a27b\variant\variant.cpp.o" -Wl,--start-group IS/Lib/GCC/" -larm_cortexM0l_math -lm se/core.a" -Wl,--end-group

core.a(Uart.cpp.o)*: In function HardwareSerial::HardwareSerial()
HardwareSerial.h:67: undefined reference to vtable for HardwareSerial

Error linking for board Arduino M0 Pro (Programming Port)
Build failed for project 'vmicro_test_1'
  

« Last Edit: Feb 2nd, 2020 at 10:17pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #1 - Feb 2nd, 2020 at 10:20pm
Print Post  
That's a cache output. Please follow the guide in yellow above and also click Rebuild not Build when you create the verbose output.

Please also confirm that you have not altered the optimization setting? It is on "default optimization"?
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #2 - Feb 2nd, 2020 at 10:45pm
Print Post  
It is on default optimization
It only happens on M0 (programming)  not M0 or uno

« Last Edit: Feb 2nd, 2020 at 11:56pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #3 - Feb 2nd, 2020 at 11:57pm
Print Post  
Please click the reply button and attach the output as a text file or email as stated above. When you paste into a post the text is truncated after a short time so only the first part of the output can be viewed. You can't attach a file in the quick reply on this page, you have to click the Reply button. Email is also fine along with link to this post.

The only way I can reproduce the error is to switch off optimization. That's expected.  Therefore the output should shed more light on the issue.
« Last Edit: Feb 3rd, 2020 at 12:02am by Tim@Visual Micro »  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #4 - Feb 3rd, 2020 at 1:53am
Print Post  
Things seem to keep changing.
here is where i am now.
Ihave attached two files
first is compiler output when set as M0 board.
it compiles fine, but wont download.
the second is set as M0 (programming port), shich is howit is connected.  It fails for a Hardware Serial fault.
Thoughts?
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #5 - Feb 3rd, 2020 at 6:12pm
Print Post  
Thanks, it looks like you have switch off optimization in the project properties?

The attached image shows the defaults.
  

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


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #6 - Feb 3rd, 2020 at 8:51pm
Print Post  
my settings are the same. see attached
  

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


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #7 - Feb 3rd, 2020 at 9:00pm
Print Post  
now I get an uploading error
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #8 - Feb 3rd, 2020 at 9:14pm
Print Post  
This is because you have set the programmer to Atmel EDBG. Please unckeck vMicro>Upload>Always User programmer"

You are also in Debug mode, I suggest you set the tool bar to Release instead of Debug.

Another point is that the vMicro > Debugger and Optimization settings are set per configuration. Release is one configuration and Debug is another configuration. In this  last example core optimization is set to "No Project and Libraries". In your previous example optimization was set to "None or No Optimization". Optimization should always be On which is the default unless you are debugging. Most arduino boards do not allow "No Optimization" because of the HardwareSerial library.
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #9 - Feb 4th, 2020 at 1:55pm
Print Post  
it compiles and downloads, but then i get backend agent is not running no tools message
  

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


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #10 - Feb 4th, 2020 at 1:57pm
Print Post  
yes i am in debug, because that is the reason I am using m0 board and atmel studio
« Last Edit: Feb 4th, 2020 at 2:09pm by Chris Molloy »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #11 - Feb 4th, 2020 at 4:27pm
Print Post  
Admin: Moved Bootloader disussion
« Last Edit: Feb 4th, 2020 at 4:32pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #12 - Feb 4th, 2020 at 4:39pm
Print Post  
Upload in Atmel Studo

If you do not want to use the default serial upload you can use Atmel device programming...

Atmel studio uses different usb drivers to the arduino ide. This means that most programmers fail therefore you wills ee that we recommend setting the "vMicro>Uploader>Progammer>Use Atmel Studio Device Programming"

Debugging in Amel Studio

Regardless of upload method, if you want to use the Atmel studio hardware debugger instead of Visual Micro serial debugger...

Check "vMicro>Debugger>Atmel Studio Debugging"



In Atmel studio, both options can apply only to atmel hardware which you have. I guess you have also set no optimization for project and libraries which is often preferred however some libraries have been written in a way that means they will not compile or link with librray optimization set. A future enhancement to visual micro will provide more granular control of which libraries remain optimized. To test things I suggest you leave optimization on which is the default.


  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #13 - Feb 4th, 2020 at 6:03pm
Print Post  
with settings as you suggested, stillo get no tools available   backend not running
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #14 - Feb 4th, 2020 at 7:33pm
Print Post  
Please post verbose output for the build so that we can see your settings now.

That message you see will only appear if you use one of the other programmers. You need to stay in release mode until you prove the upload tool you want to use. 

Out of interest what are you clicking in the arduino ide to upload? If you are not clicking the special "Upload using programmer" menu item in arduino then you are using the standard upload which will be serial/COM.

Let's get past the upload issues which is unrelated to debugging then look at debugging.
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #15 - Feb 4th, 2020 at 10:27pm
Print Post  
i just ran in arduino ide "Upload using programmer" menu item.   

it failed to download, attached is output
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #16 - Feb 4th, 2020 at 11:31pm
Print Post  
Okay so that shows that you just need to use the standard serial upload in visual micro. The arduino ide has confused things for you because it always shows a programmer is selected but it is not used.

In Visual Micro please switch off the "use programmer" in the upload settings and confirm that the upload is then using your COM port.

Thanks
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #17 - Feb 5th, 2020 at 3:32pm
Print Post  
I downgraded the boards manager file to 1.6.21 based on some googling.
now the arduino ide works fine, downloads and runs sketch as expected.
also able to download and run in atmel studio.
however debugging not working.    backend agent not running  no tools available
cant get output file as it dissapears when closing backend not running dialog.

backend agent output is as follows
10:22:32: [WARNING] The back end process exited with code -1073741819
  
Back to top
 
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #18 - Feb 5th, 2020 at 3:35pm
Print Post  
found output in micro build output

  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #19 - Feb 5th, 2020 at 3:55pm
Print Post  
Good, pleased to hear your uplod is working.

Is vMicro>Debugger>Atmel Studio Debugger enabled?
What happens when you click "Debug>Attach to Target"?
What board is shown in the atmel studio project properties? (right click proj name)

Thanks
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #20 - Feb 5th, 2020 at 3:56pm
Print Post  
this is the page that I got the boards file change from   https://forum.arduino.cc/index.php?topic=622372.0
  
Back to top
 
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #21 - Feb 5th, 2020 at 4:33pm
Print Post  
thanks for the help so far!

I now have serial debugging working with vmicro.

if i set debugging to hardware, I still get backend not running.

i bought the arduino m0 to allow me to step thru programs for debugging.

will i be ok on the older boards file?

is this something you would help with, if not where should i go for help?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #22 - Feb 5th, 2020 at 10:25pm
Print Post  
To be honest it is easier to help users in Visual Studio than atmel studio. To use atmel studio we simply hand off to atmel and users are expected to know how its tools work and how to test connection etc. There are also more options in atmel studio therefore unless users explain exactly what they have set we end up guessing.

In Visual Studio it's more within the vMicro menus and we get better errors back from problems launching hardware debug.
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #23 - Feb 6th, 2020 at 3:30am
Print Post  
just to be sure, vmicro does not do hardware debugging, with stepping etc, correct.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #24 - Feb 6th, 2020 at 1:57pm
Print Post  
That's not right. From mid last year we released hardware debugging in Visual Studio. You can use either the software/serial debug or the hardware/gdb debug.

You can also run both atmel studio and visual studio on the same machine and try it out.
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #25 - Feb 6th, 2020 at 3:32pm
Print Post  
when I change to hardware debugging, my sketch does not run and i get backend not running.

is there a step by step tutorial for vmicro in atmel studio?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #26 - Feb 6th, 2020 at 8:38pm
Print Post  
When you switch on use atmel debugging we simply hand over to atmel studio.

I asked you some questions previously but you did not answer them. Here they re again.


Is vMicro>Debugger>Atmel Studio Debugger enabled?
What happens when you click "Debug>Attach to Target"?
What board is shown in the atmel studio project properties? (right click proj name)



  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #27 - Feb 7th, 2020 at 1:04am
Print Post  
It was not before when i got serial debugging going, It was on automatic.
I enabled Atmel Studio debugger now.
I created a new sketch using file/ new /arduino project.  the board was already set to /arduino m0.
for some reason, it wants to assign the ATSAMD18EA to that board.
The board has a 21GA on it so I changed the device to that in the properties.
it does not show a board, device is now  ATSAMD21GA since I changed it.
debug attach to target yields backend not running (no tools)
on the tool tab of project properties, only custom programmer is available
  
Back to top
 
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #28 - Feb 7th, 2020 at 1:09am
Print Post  
I noticed that there was no tool library path in the tools/options/device & tool libraries/toollibrary path.
i set it to C:\Program Files (x86)\Atmel\Studio\7.0\tools and did debug/attach to target.
it no longer gives backend not running (no tools)
here is the output

------ Build started: Project: moTest6, Configuration: Debug ARM ------
Build started.
Project "moTest6.cppproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\chris\OneDrive\Documents\Arduino\moTest6\moTest6.cppproj" (target "Build" depends on it):
     Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
     Task "RunCompilerTask"
           Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
           C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 8 --output-sync 
cannot open linker script file samd21e18a_flash.ld: No such file or directorycollect2.exe(0,0): error: ld returned 1 exit status
           make: *** [moTest6.elf] Error 1
           Building target: moTest6.elf
           Invoking: ARM/GNU Linker : 6.3.1
           "C:\Program Files " -o moTest6.elf     -mthumb -Wl,-Map="moTest6.map" -Wl,--start-group -lm  -Wl,--end-group -L"../cmsis/linkerScripts"  -Wl,--gc-sections -mcpu=cortex-m0plus -Tsamd21e18a_flash.ld   
C:\Users\chris\OneDrive\Documents\Arduino\moTest6\Debug\Makefile(95,1): error: recipe for target 'moTest6.elf' failed
           The command exited with code 2.
     Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "moTest6.cppproj" -- FAILED.
Done building project "moTest6.cppproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
  
Back to top
 
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #29 - Feb 7th, 2020 at 1:12am
Print Post  
it is saying
cannot open linker script file samd21e18a_flash.ld: No such file or directorycol
when the device is set to samd21g18A
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #30 - Feb 7th, 2020 at 12:06pm
Print Post  
Thanks, you do not want atmel to try to build so please open build>configuration manager and uncheck your project from build. We only want the debug side of atmel studio.

You also should not be using the atmel device programming, just normal edbg or serial. What we want is same as arduino ide for upload but with as7 for debug.
« Last Edit: Feb 7th, 2020 at 3:12pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #31 - Feb 7th, 2020 at 2:45pm
Print Post  
the script file exists at
C:\Program Files (x86)\Atmel\Studio\7.0\packs\atmel\SAMD21_DFP\1.3.331\samd21a\gcc\gcc
and can be opened in a text editor
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #32 - Feb 7th, 2020 at 3:13pm
Print Post  
You do not want atmel to build, so please open build>configuration manager and uncheck your project from build. We only want the debug side of atmel studio.

You also should not be using the atmel device programming, just normal edbg or serial. What we want is same as arduino ide for upload but with as7 for debug.
« Last Edit: Feb 7th, 2020 at 3:14pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #33 - Feb 7th, 2020 at 5:15pm
Print Post  
uploads ok and runs, but no tracing window comes up despite breakpoint with {millis()} in actions
  
Back to top
 
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #34 - Feb 7th, 2020 at 5:21pm
Print Post  
i have vmicro/debugger/atmel studio degugger checked.
using debug/start debugging and break yields backen not running, no tools
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #35 - Feb 7th, 2020 at 6:44pm
Print Post  
If you right click your project and inspect the atmel studio properties what device is set? 
What device name shows on the tool bar if you see one (I don't mean the visual micro tool bar, atmel has its own tool bar that shows which device it thinks is selected.


  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #36 - Feb 7th, 2020 at 9:00pm
Print Post  
ATSAMD21G18A  same on toolbar
« Last Edit: Feb 7th, 2020 at 9:01pm by Chris Molloy »  
Back to top
 
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #37 - Feb 7th, 2020 at 9:10pm
Print Post  
ATSAMD21G18A  same on toolbar
  
Back to top
 
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #38 - Feb 7th, 2020 at 9:14pm
Print Post  
here is the properties window and the toolbar
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #39 - Feb 8th, 2020 at 1:24pm
Print Post  
Please se the visual micro debugger to Off or Serial. The "Hardware" option is relatively new, applies only to VS and needs to be hidden from As7. The only option in AS7 is to override the visual micro serial debugger and "use atmel studio debugging".

That might be causing some confusion.
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #40 - Feb 9th, 2020 at 5:55pm
Print Post  
Tim@Visual Micro wrote on Feb 8th, 2020 at 1:24pm:
Please se the visual micro debugger to Off or Serial. The "Hardware" option is relatively new, applies only to VS and needs to be hidden from As7. The only option in AS7 is to override the visual micro serial debugger and "use atmel studio debugging".

That might be causing some confusion.


i have it running. breakpoints are working, but i dont see how to step/step into. using the buttons in atmel toolbar results in nothing.  also curious why millis() keeps advancing when the program is halted?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #41 - Feb 9th, 2020 at 8:45pm
Print Post  
Make sure you are on an upto date version of atmel studio "help>check for updates".

Please show a screen shot of the debug working so we can be sure you are using the atmel debugger and not the visual micro debugger.

If it does not have optimization disabled for the code you are trying to debug it can cause step/break to fail. But becareful with the optimization it can break the build if too much. 

There are ways to disable optimization for chunks of code without disabling it for all related code but it means adding # directives to the code which is messier.

Let's first try debugging only in the .ino file with "no project" optimization. Can you inspect variables and step over simple lines of code, for example adding and subtracting 1 from a variable.

millis() it handled differently by every core. How the debug works is down to atmel and your hardware.



« Last Edit: Feb 9th, 2020 at 8:49pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #42 - Feb 9th, 2020 at 10:09pm
Print Post  
i was running the vmicro debugger.  I switched to the atmel debugger and no project optimization and the screen attached is what I get.
  

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


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #43 - Feb 9th, 2020 at 10:21pm
Print Post  
i started by clicking the "start debugging and break button beside release/debug selector resulting in the screen I sent
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #44 - Feb 10th, 2020 at 1:15am
Print Post  
Those are atmel errors so you might get more info by changing the output window from "Micro build" to "Build". The output windows with name that starts "Micro" are visual micro output windows. Atmel has its own.

Try these things in any order.

1) Run a repair on atmel studio via control panel add or remove programs.

2) Create an atmel studio application project and select your board. Click start > debugging to see if it can upload and start the debugger for a standard gcc application.

3) Look at the standard atmel studio project property pages for your project to see which debugger/programmer is selected.

4) Look at tools device programming to see if your device is detected and what config the ide has.

5) Post the verbose micro output when you try to lunch and it fails just so we can see that visual micro isn't doing anything.
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #45 - Feb 13th, 2020 at 6:33pm
Print Post  
1) Run a repair on atmel studio via control panel add or remove programs. THIS IS MY 3RD FULL INSTALL AND I HAVE REPAIRED TWICE.

2) Create an atmel studio application project and select your board. Click start > debugging to see if it can upload and start the debugger for a standard gcc application.  BACKEND NOT RUNNING, NO TOOLS

3) Look at the standard atmel studio project property pages for your project to see which debugger/programmer is selected.  NO PROGRAMMER AVAILABLE, ONLY CUSTOM PROGRAMMER

4) Look at tools device programming to see if your device is detected and what config the ide has.
THERE ARE NO AVAILABLE TOOLS.

5) Post the verbose micro output when you try to lunch and it fails just so we can see that visual micro isn't doing anything.  SEE ATTACHED
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #46 - Feb 13th, 2020 at 6:43pm
Print Post  
There is an update for as7 that allows you to set the micro-controller that the atmel project believes it is using. There isn't a direct connection between the arduino definitions and atmel device names so visual micro has to guess. For SAMD boards Visual Micro is bias to the original Arduino Zero. 

Another AS7 user was using an Adafruit M0 that has a slightly different MCU name. There is a new option on the vMicro>General menu that allows you to switch off Visual Micro attempt to automatically set the Atmel Studio Device. Then you can alter the mcu name to be correct.

Your arduino builds shows the mcu/device name should be SAMD21G18A when your ide is set to SAMD21E18A.

https://www.visualmicro.com/forums/YaBB.pl?num=1580914071

  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #47 - Feb 13th, 2020 at 7:12pm
Print Post  
I am running vmicro 1911.23.0
the tools extensions does not show any updates available.

autoselect board/port has been off all along.

when I create a new arduino project using vmicro, It always selects the E version. I change it using the project properties/device to the G18A, which is the device installed on my board.

i closed a solution that I had set up for arduino nano.  created new vmicro new arduino project .  I changed board to pro programming port.  went to change the device, and no samd devices are available.

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #48 - Feb 13th, 2020 at 7:16pm
Print Post  
As I said you should try the version published earlier today to the link I posted in my previous comment.

If that doesn't help then you are really looking at an AS7 issue and I suggested previously testing with a simple atmel gcc project to prove the tools are working.

These issues are why we recommend VS over atmel studio. Unless you already know atmel it is a learning curve for arduino users. In atmel studio we have better control over the hardware debugger than in AS7.

It might be worth re-checking the guide for AS7 here

https://www.visualmicro.com/page/Arduino-for-Atmel-Studio-7.aspx
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #49 - Feb 13th, 2020 at 7:30pm
Print Post  
in general out put, get the following
14:24:41: [WARNING] TCF command: Tool:getAttachedTools receiving failed, channel is closed
14:24:41: [ERROR] Command [C 0 Tool getAttachedTools ""] aborted, ModuleName: TCF (Command [C 0 Tool getAttachedTools ""] aborted)
14:24:41: [ERROR] Command [C 0 Tool getAttachedTools ""] aborted, ModuleName: TCF (Command [C 0 Tool getAttachedTools ""] aborted)
14:25:00: [WARNING] TCF command: Tool:getAttachedTools receiving failed, channel is closed
14:25:00: [ERROR] Command [C 1 Tool getAttachedTools ""] aborted, ModuleName: TCF (Command [C 1 Tool getAttachedTools ""] aborted)
14:25:00: [ERROR] Command [C 1 Tool getAttachedTools ""] aborted, ModuleName: TCF (Command [C 1 Tool getAttachedTools ""] aborted)
14:25:03: [WARNING] TCF command: Tool:getAttachedTools receiving failed, channel is closed
14:25:03: [ERROR] Command [C 2 Tool getAttachedTools ""] aborted, ModuleName: TCF (Command [C 2 Tool getAttachedTools ""] aborted)
14:25:03: [ERROR] Command [C 2 Tool getAttachedTools ""] aborted, ModuleName: TCF (Command [C 2 Tool getAttachedTools ""] aborted)
14:25:15: [WARNING] Error updating project settings:Object reference not set to an instance of an object.
14:26:11: [ERROR] 
14:29:10: [ERROR]
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #50 - Feb 13th, 2020 at 7:37pm
Print Post  
Thanks, those are all atmel errors not caused by Visual Micro.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #51 - Feb 13th, 2020 at 7:42pm
Print Post  
ps: I don't think that you haven't said what atmel studio tool(s) you have set in the project properties. If you click click the project name > properties that is a very important area because you are allowing atmel to take control. That is where you would set the programmer/debugger you want to use. That is what atmel is trying to load for debug.
« Last Edit: Feb 13th, 2020 at 7:42pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #52 - Feb 13th, 2020 at 7:42pm
Print Post  
I switched to atmel studio because it seemed like a simpler environment for an arduino type guy.

Would you suggest I try visual studio, which I have previously used instead of atmel?

  
Back to top
 
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #53 - Feb 13th, 2020 at 7:48pm
Print Post  
in general out put, get the following
14:24:41: [WARNING] TCF command: Tool:getAttachedTools receiving failed, channel is closed
14:24:41: [ERROR] Command [C 0 Tool getAttachedTools ""] aborted, ModuleName: TCF (Command [C 0 Tool getAttachedTools ""] aborted)
14:24:41: [ERROR] Command [C 0 Tool getAttachedTools ""] aborted, ModuleName: TCF (Command [C 0 Tool getAttachedTools ""] aborted)
14:25:00: [WARNING] TCF command: Tool:getAttachedTools receiving failed, channel is closed
14:25:00: [ERROR] Command [C 1 Tool getAttachedTools ""] aborted, ModuleName: TCF (Command [C 1 Tool getAttachedTools ""] aborted)
14:25:00: [ERROR] Command [C 1 Tool getAttachedTools ""] aborted, ModuleName: TCF (Command [C 1 Tool getAttachedTools ""] aborted)
14:25:03: [WARNING] TCF command: Tool:getAttachedTools receiving failed, channel is closed
14:25:03: [ERROR] Command [C 2 Tool getAttachedTools ""] aborted, ModuleName: TCF (Command [C 2 Tool getAttachedTools ""] aborted)
14:25:03: [ERROR] Command [C 2 Tool getAttachedTools ""] aborted, ModuleName: TCF (Command [C 2 Tool getAttachedTools ""] aborted)
14:25:15: [WARNING] Error updating project settings:Object reference not set to an instance of an object.
14:26:11: [ERROR] 
14:29:10: [ERROR]
  
Back to top
 
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #54 - Feb 13th, 2020 at 7:49pm
Print Post  
I have no toolls available.  see attached.
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #55 - Feb 13th, 2020 at 7:50pm
Print Post  
I think it's an easy thing to think that Atmel is more in tune with micro-controllers and for advanced users who are familiar with the underlying micro controllers it can be. However it is much more complicated for the same reason.

The intellisense can be more robust in atmel studio but other than that Visual Studio is certainly the easiest. It is also easier to support because, for example, if there is hardware debugger problem we have control over the tools to fix it and we can better report the entire build/debug process in our own verbose output.

  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #56 - Feb 13th, 2020 at 7:52pm
Print Post  
In your last post atmel studio can not see your board.  EDBG should be in the list, it might be related to my previous note about the wrong process/mcu being assigned to the atmel project.

It is also evident that the last upload you made was with serial debug enabled and NOT using the vmicro>debugger>use atmel studio debugging.
  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 
Send TopicPrint