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
Hot Topic (More than 8 Replies) Can not select correct target "Device" to upload to. (Read 3699 times)
Phillip A. Gonzales
Junior Member
**
Offline


Posts: 18
Joined: Jun 19th, 2019
Can not select correct target "Device" to upload to.
Jun 19th, 2019 at 11:35pm
Print Post  
I am trying to use the Adafruit MetroM4 microcontroller board. It uses a SAMD51J19A as the MCU https://learn.adafruit.com/adafruit-metro-m4-express-featuring-atsamd51. I was able to import the board packages via the initial configuration OF VM as I have been using the M4 with the Arduino IDE. 

I have tried to create a project with an Arduino sketch via AS7, however, I run into a similar issue. Where I can select the board but not the MCU. I am using an ATMEL-ICE as the debugger, the M4 has SWD pinouts which I am trying to utilize.

Please let me know if anyone has any ideas on how to set the correct MCU.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can not select correct target "Device" to upload to.
Reply #1 - Jun 20th, 2019 at 12:52pm
Print Post  
Hi

I'm trying to understand where the issue lies. Can you confirm that without using atmel studio device programming you can use Visual Micro to build and upload to the board in the same way as we do in the Arduino IDE? (That would normally be serial upload)

Also confirm what you click to upload in the Arduino IDE.

Thanks
« Last Edit: Jun 20th, 2019 at 12:53pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Phillip A. Gonzales
Junior Member
**
Offline


Posts: 18
Joined: Jun 19th, 2019
Re: Can not select correct target "Device" to upload to.
Reply #2 - Jun 20th, 2019 at 6:28pm
Print Post  
Hello,

I can confirm that I am able to build and upload the code and libraries that I have developed and been using with the Arduino IDE. 

I am not too sure what you mean by Quote:
"Also confirm what you click to upload in the Arduino IDE."


I have included the verbose output from the compiler. 

Code (C++)
Select All
Compiling 'Testing_M4' for 'Adafruit Metro M4 (SAMD51)'
Build Folder: ruit_metro_m4/Release"
Summary: Header=1 Prototypes=3 Imports=3
Additional Defines:
Architecture Tools: one-eabi-gcc/4.8.3-2014q1/bin/"
Api: 1.1905.26-0
Sketch Book: "file:///C:/Users/pag130030/Documents/Arduino"
Sketch Include Paths
Core Include Paths
Include Path amd/1.5.1/cores/arduino"
Include Path amd/1.5.1/variants/metro_m4"

Deep search for libraries ...
Using previous search results: o_m4\Release\Testing_M4.cpp
Using previous search results: o_m4\Release\Testing_M4.cpp
Using previous search results: o_m4\Release\Testing_M4.cpp
Using previous search results: o_m4\Release\Testing_M4.cpp
Using previous search results: el.cpp
Using previous search results: C:\Users\pag130030\Documents\Arduino\libraries\Adafruit_NeoPixel\esp8266.c
Using previous search results: C:\Users\pag130030\Documents\Arduino\libraries\Motor1\Motor1.cpp
Using previous search results: C:\Users\pag130030\Documents\Arduino\libraries\ButtonMkIII\ButtonMkIII.cpp

Building variant ...

  Using previously compiled variant

Building core ...

Building libraries ...

Using library Adafruit_NeoPixel version 1.2.3 in folder "file:///C:/Users/pag130030/Documents/Arduino/libraries/Adafruit_NeoPixel"
  Using previously compiled file: o_m4\Release\Adafruit_NeoPixel\esp8266.c.o
  Using previously compiled file: o_m4\Release\Adafruit_NeoPixel\Adafruit_NeoPixel.cpp.o

Using library Motor1 version 0.0.0 in folder "file:///C:/Users/pag130030/Documents/Arduino/libraries/Motor1"
  Using previously compiled file: o_m4\Release\Motor1\Motor1.cpp.o

Using library ButtonMkIII version 0.0.0 in folder "file:///C:/Users/pag130030/Documents/Arduino/libraries/ButtonMkIII"
  Using previously compiled file: o_m4\Release\ButtonMkIII\ButtonMkIII.cpp.o

Building project code ...
  Using previously compiled file: o_m4\Release\Testing_M4.cpp.o

Linking it all together ...
# Coping cached core 612050ce8\core.a to o_m4\Release\core.a

-gcc\4.8.3-2014q1/bin/arm-none-eabi-gcc" etro_m4\Release" -Os -Wl,--gc-sections -save-temps 5.1\variants\metro_m4/linker_scripts/gcc/flash_with_bootloader.ld" fruit_metro_m4\Release/Testing_M4.ino.map" --specs=nano.specs --specs=nosys.specs -mcpu=cortex-m4 -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -o ro_m4\Release/Testing_M4.ino.elf" "Testing_M4.cpp.o" "Adafruit_NeoPixel\esp8266.c.o" "Adafruit_NeoPixel\Adafruit_NeoPixel.cpp.o" "Motor1\Motor1.cpp.o" "ButtonMkIII\ButtonMkIII.cpp.o" a612050ce8\variant\variant.cpp.o" -Wl,--start-group 5.1\variants\metro_m4" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16 5.1\variants\metro_m4" -lm ro_m4\Release/core.a" -Wl,--end-group
## recipe.objcopy.bin.pattern
-gcc\4.8.3-2014q1/bin/arm-none-eabi-objcopy" -O binary ro_m4\Release/Testing_M4.ino.elf" ro_m4\Release/Testing_M4.ino.bin"
## recipe.objcopy.hex.pattern
-gcc\4.8.3-2014q1/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom ro_m4\Release/Testing_M4.ino.elf" ro_m4\Release/Testing_M4.ino.hex"

Program Testing_M4 size: 12,928 bytes (used 3% of a 507,904 byte maximum) (1.13 secs)

# Copy build result to 'Project>Property Pages>Intermediate Directory'
# Destination: file:///C:/Users/pag130030/Documents/Arduino/Testing_M4/Release

Uploading 'Testing_M4' to 'Adafruit Metro M4 (SAMD51)' using 'COM9'
Device       : ATSAMD51x19
Version      : v1.1 [Arduino:XYZ] Apr  8 2018 16:27:40
Address      : 0x0
Pages        : 1024
Page Size    : 512 bytes
Total Size   : 512KB
Planes       : 1
Lock Regions : 32
Locked       : none
Security     : false
BOD          : false
BOR          : true
Write 13216 bytes to flash (26 pages)
[                              ] 0% (0/26 pages)
[=========                     ] 30% (8/26 pages)
[==================            ] 61% (16/26 pages)
[===========================   ] 92% (24/26 pages)
[==============================] 100% (26/26 pages)
Done in 0.166 seconds
Verify 13216 bytes of flash
[=                             ] 3% (1/26 pages)
[==                            ] 7% (2/26 pages)
[===                           ] 11% (3/26 pages)
[====                          ] 15% (4/26 pages)
[=====                         ] 19% (5/26 pages)
	The upload process has finished. via 'COM11'
[======                        ] 23% (6/26 pages)
[========                      ] 26% (7/26 pages)
[=========                     ] 30% (8/26 pages)
[==========                    ] 34% (9/26 pages)
[===========                   ] 38% (10/26 pages)
[============                  ] 42% (11/26 pages)
[=============                 ] 46% (12/26 pages)
[===============               ] 50% (13/26 pages)
[================              ] 53% (14/26 pages)
[=================             ] 57% (15/26 pages)
[==================            ] 61% (16/26 pages)
[===================           ] 65% (17/26 pages)
[====================          ] 69% (18/26 pages)
[=====================         ] 73% (19/26 pages)
[=======================       ] 76% (20/26 pages)
[========================      ] 80% (21/26 pages)
[=========================     ] 84% (22/26 pages)
[==========================    ] 88% (23/26 pages)
[===========================   ] 92% (24/26 pages)
[============================  ] 96% (25/26 pages)
[==============================] 100% (26/26 pages)
Verify successful
Done in 0.073 seconds 


« Last Edit: Jun 24th, 2019 at 1:51pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can not select correct target "Device" to upload to.
Reply #3 - Jun 20th, 2019 at 7:58pm
Print Post  
That's fine thanks. You are using standard COM port upload with Visual Micro and with the Arduino IDE. Both are working the same, Visual Micro only needs the board to be selected, same as the Arduino IDE

Now you want to use some Atmel Studio debugging and to do that Atmel needs to know which mcu is selected, Atmel does not know about boards but Visual Micro should auto select the correct mcu for you.

You seems to indicate that for both Visual Micro projects and for native Atmel projects you are unable to see the correct MCU in the Atmel Studio list? 

Can you please show a screen shot of the list or part of the list of micro-controllers that you do see in the Atmel Studio list?

  
Back to top
WWW  
IP Logged
 
Phillip A. Gonzales
Junior Member
**
Offline


Posts: 18
Joined: Jun 19th, 2019
Re: Can not select correct target "Device" to upload to.
Reply #4 - Jun 20th, 2019 at 9:00pm
Print Post  
I left for the day and came back to try to solve the issue and it seems like I am now able to select the correct device and debugger. However, I am not faced with a new issue. 

Here are the steps I am taking: (Seen in the attachments)
  • Building & Uploading the code to the M4
  • Receiving a successful upload message
  • Click on "Start Debugging (F5)"
  • Recive Error Message 4109


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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can not select correct target "Device" to upload to.
Reply #5 - Jun 20th, 2019 at 9:08pm
Print Post  
We are about to release gdb debugging in Visual Studio which will be more within our control. If you use the atmel tools in atmel studio you are not using visual micro so we have less control and atmel can be difficult.

I can't see any attachments however the things to note are that you should set the vMicro>Uploader>programmer to "atmel studio device programming" and also check the "user programmer for upload" option just below the programmers list. There is a micro programmers tool bar that you can show if that's easier to use. Before trying to debug you should ensure you can upload using the ICE which you should be able to do after you enable that setting.

When you have clean upload the debug should work also?

You should also create an empty atmel studio c++ project ane prove that atmel is working okay with upload and debug.
« Last Edit: Jun 20th, 2019 at 9:09pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Phillip A. Gonzales
Junior Member
**
Offline


Posts: 18
Joined: Jun 19th, 2019
Re: Can not select correct target "Device" to upload to.
Reply #6 - Jun 24th, 2019 at 1:43pm
Print Post  
My apologies on the attachment issue here is a link to the images https://imgur.com/a/ku36nP4

I believe that the images will clear any questions on how I am going about the upload and debugging. 

I will be attempting to create an Arduino core and build & upload today. I will reply with the results once/if I am successful. 

Tim@Visual Micro wrote on Jun 20th, 2019 at 9:08pm:
We are about to release gdb debugging in Visual Studio which will be more within our control. If you use the atmel tools in atmel studio you are not using visual micro so we have less control and atmel can be difficult.

Do you feel like your GDB will resolve the issue, if so what is the timeline for its release?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Can not select correct target "Device" to upload to.
Reply #7 - Jun 24th, 2019 at 2:00pm
Print Post  
The gdb in vs is due over the next week.

In "atmel studio>tools>device programming" is the ice selected?

Plse show image of the vMicro>debugger menu and also the vMicro>Uploader menu
  
Back to top
WWW  
IP Logged
 
Phillip A. Gonzales
Junior Member
**
Offline


Posts: 18
Joined: Jun 19th, 2019
Re: Can not select correct target "Device" to upload to.
Reply #8 - Jun 24th, 2019 at 2:51pm
Print Post  
That is great to hear, I am looking forward to using it. 

As for the current situation I just now discovered that the cable that I was using was not in the same configuration as the cable the ICE came with.
Now that I have switched back to the original cable it is now reading the ICE and the Metro M4. 
However, I am now receiving a new error I have included this error in the images as well as the requested images.  
https://imgur.com/a/ETGqZMB
  
Back to top
 
IP Logged
 
Phillip A. Gonzales
Junior Member
**
Offline


Posts: 18
Joined: Jun 19th, 2019
Re: Can not select correct target "Device" to upload to.
Reply #9 - Jun 25th, 2019 at 8:03pm
Print Post  
Tim Leek, 

I just wanted to let you know that I have solved the issue and it was due to AS7 randomly switching the target device.  Shocked

I have since been able to debug, however, I am running into odd issues. 

I have created another post as this post's issue has been resolved. 
https://www.visualmicro.com/forums/YaBB.pl?num=1561492557
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint