VS Arduino
>> >> Debugging Arduino DUE
https://www.visualmicro.com/forums/YaBB.pl?num=1520542529

Message started by Aleks on Mar 8th, 2018 at 8:55pm

Title: Debugging Arduino DUE
Post by Aleks on Mar 8th, 2018 at 8:55pm
Hi.
How to properly connect Arduino Due and configure Visual micro in the visual studio, to debug incoming data from the serial port?

You can how the driver looks in the image


Due-Good-Usb-Install_001.png ( 34 KB | 3 Downloads )

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 9th, 2018 at 1:04pm
1. Make sure the DUE is working correctly. Does Serial.println("Hello world") work?

Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 10th, 2018 at 9:52am
Hi.
in Arduino IDE everything works.
VS does not see the device on the COM port.
Tried on different USB ports.Reinstall the driver.
Nothing helps.
Other boards, leo, uno, nano, is work!

https://drive.google.com/file/d/1Z0ZYOEpANs7FqaO93KKKEHPZFvIfdJi8/view

After reinstalling the drivers.

https://drive.google.com/file/d/1jI1sywoNhgBUAZY7jnOvUCvtUpEK-KYu/view

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 10th, 2018 at 3:07pm
Hello,

I want to help you but you have raised two questions.

Can we please first confirm that you can see the serial port in visual micro and upload okay?

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 10th, 2018 at 7:48pm
What is the version of visual micro you are using. "tools>extensions and updates>arduino ide for vs"

Thanks

Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 10th, 2018 at 9:12pm

Tim@Visual Micro wrote on Mar 10th, 2018 at 3:07pm:
Hello,

I want to help you but you have raised two questions.

Can we please first confirm that you can see the serial port in visual micro and upload okay?

Hi. I understand English very badly, so I translate it using Google(
I do not understand what I need to see?
In the previous message, I put a screenshot, it shows which port I'm using.
Exactly the same as in the Arduino IDE.


Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 10th, 2018 at 9:48pm

Tim@Visual Micro wrote on Mar 10th, 2018 at 7:48pm:
What is the version of visual micro you are using. "tools>extensions and updates>arduino ide for vs"

Version 1803.6.3
While preparing the answer, I decided to check. it worked!
But I'm glad nothing.
When reloading the sketch, the same error.
I thought maybe it's in the computer.
Rebooted, but nothing helps.
On different ports at once an error.
I'm guessing that it's in some kind of cache.
If you have a debug version of a record in the log file.
I can install it and send the results.

Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 10th, 2018 at 10:57pm
I tried the studio in amtel.
The sketch is loaded.
but I do not like amtel studio.
I write on C# and would like to work in the same environment.

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 10th, 2018 at 11:06pm
Oh okay you have corrupt WMI database.

Change these options ...

"Tools>options>visual micro>communications>friendly port names" = False
"Tools>options>visual micro>communications>friendly port menus" = False

Why?

You see in your example "COM4 " not "COM4" this is because of some corruption in the windows WMI port names database.

Switch off the options and we use simpler windows port list.

I will try to trim() the extra space in the next release

Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 11th, 2018 at 12:19pm

Tim@Visual Micro wrote on Mar 10th, 2018 at 11:06pm:
Oh okay you have corrupt WMI database.

Change these options ...

"Tools>options>visual micro>communications>friendly port names" = False
"Tools>options>visual micro>communications>friendly port menus" = False


It did not help

https://drive.google.com/file/d/1raU7KO02XSEFg-cmBURYBZyeQ61-AyDD/view


Compiling debug version of 'Blink1' for 'Arduino Due (Programming Port)'
Program size: 22 936 bytes (used 4% of a 524 288 byte maximum) (1,60 secs)

Uploading 'Blink1' to 'Arduino Due (Programming Port)' using 'COM3'
Uploader started for board Arduino Due (Programming Port)
Upload method will be: bootloader
Uploading via Bootloader
C:\Users\aleks\AppData\Local\arduino15\packages\arduino\tools\bossac\1.6.1-arduino\bossac.exe -i -d --port=COM3 -U false -e -w -v -b C:\Users\aleks\AppData\Local\Temp\VMBuilds\Blink1\ARDUIN~2\Debug/BLINK1~1.BIN -R
The uploader process failed
No device found on COM3
Send auto-baud
Set binary mode

but when it started working on another port

Compiling debug version of 'Blink1' for 'Arduino Due (Native USB Port)'
Program size: 23 008 bytes (used 4% of a 524 288 byte maximum) (2,27 secs)

Uploading 'Blink1' to 'Arduino Due (Native USB Port)' using 'COM16'
Uploader started for board Arduino Due (Native USB Port)
Upload method will be: bootloader
Uploading via Bootloader
PORTS {COM1,COM16} / {COM1,COM17} => {COM17}
C:\Users\aleks\AppData\Local\arduino15\packages\arduino\tools\bossac\1.6.1-arduino\bossac.exe -i -d --port=COM17 -U true -e -w -v -b C:\Users\aleks\AppData\Local\Temp\VMBuilds\Blink1\ARDUIN~1\Debug/BLINK1~1.BIN -R
Set binary mode
readWord(addr=0)=0x20001000
readWord(addr=0xe000ed00)=0x412fc230
readWord(addr=0x400e0740)=0
readWord(addr=0x400e0940)=0x285e0a60
version()=v1.1 Dec 15 2010 19:25:04
chipId=0x285e0a60
Connected at 921600 baud
..........
etc.


I do not care through which port to program.
Tell me how to configure the visual micro.
I need to send a string to the serial port and read it in the code.


Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 11th, 2018 at 2:03pm
Okay thanks for the info.

Visual Micro is used by 1000's of people and the DUE is standard arduino board.

Visual Micro uses C#, Arduino IDE uses Java so that is only difference.

For upload both arduino and visual micro use external tool chain program

[code]C:\Users\aleks\AppData\Local\arduino15\packages\arduino\tools\bossac\1.6.1-arduino\bossac.exe -i -d --port=COM3 -U false -e -w -v -b C:\Users\aleks\AppData\Local\Temp\VMBuilds\Blink1\ARDUIN~2\Debug/BLINK1~1.BIN -R
[/code]
See above, you can try it in .bat file outside of visual micro.

I suggest this might be a windows usb problem. I recommend deleting your usb driver from "control panel>device manager" then installing usb from \drivers folder below arduino ide.

or try different usb cable.

Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 11th, 2018 at 5:00pm

Tim@Visual Micro wrote on Mar 11th, 2018 at 2:03pm:
I suggest this might be a windows usb problem. I recommend deleting your usb driver from "control panel>device manager" then installing usb from \drivers folder below arduino ide.

or try different usb cable.

In the third post on the first screenshot, I showed that in Arduino IDE, sketches are loaded on the Arduino Due (Programming Port).
I also wrote above that I reinstalled the driver. I tried on different ports. I tried 10 cables.

Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 11th, 2018 at 5:01pm

Aleks wrote on Mar 11th, 2018 at 12:19pm:
I do not care through which port to program.
Tell me how to configure the visual micro.
I need to send a string to the serial port and read it in the code.

How to do this?

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 11th, 2018 at 8:04pm
Please show picture of device manager > com ports. Also right mouse click the Due in the device manager list and click Properties. Then confirm usb driver name + date/time

Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 12th, 2018 at 8:26pm
Good day.
Here are links to all screenshots, the text in Russian, but I think it will be clear.
If not, I will install the English interface for Windows
Driver version 3.4.2014.8, date 08/08/2014
Download from the site wch.kn, it seems this is the last.
https://drive.google.com/file/d/149_mF_8kx0qBF9Yc7y_IDAbhy5sHmTd7/view
https://drive.google.com/file/d/1rTAcQDGMmCze-LX2y0_mVbz4zfdN-q7K/view
https://drive.google.com/file/d/1q8bVGb98lmcZE6RARxII_lY8bY1un74I/view
https://drive.google.com/file/d/17Hg7R6LxnmwweeHMw9IevIMaD4J71KwP/view

I started translating the documentation into Russian, and I read how to configure the extended output when compiling and loading.
I attach a link to a text file with all the data displayed.
Maybe this will help

https://drive.google.com/file/d/1OJeQ_GBr557lI7qHFi-veNBlKWcWX2OV/view

I will remind (I wrote earlier) in Arduino IDE uploading works.

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 12th, 2018 at 10:19pm
Thanks for the info

Please open the project in the arduino ide. Switch on "file>preferences>upload verbose" and the upload. Then post the upload output from arduino here.

Then I can compare the difference.

Thanks

Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 13th, 2018 at 4:29am
Hi.

https://drive.google.com/file/d/1E2MrviH5MF2gra25WCdVx9_DQwkhZqTr/view

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 13th, 2018 at 1:21pm
The DUE has two ports

In Arduino IDE you must use the one that fails in Visual Micro. Otherwise your test is invalid.

Arduino Due (Programming Port)'

Please show verbose output from Arduino IDE when Programming Port is selected




Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 13th, 2018 at 2:38pm

Tim@Visual Micro wrote on Mar 13th, 2018 at 1:21pm:
The DUE has two ports

In Arduino IDE you must use the one that fails in Visual Micro. Otherwise your test is invalid.

Arduino Due (Programming Port)'

Please show verbose output from Arduino IDE when Programming Port is selected


Do you even read what I wrote above? >:(
I even applied screenshots.
Of course I know that DUE has two ports.
I even wrote that the port of Nativa USB? the sketch is uploaded from the visual micro.
I'm certainly dummy in microcontrollers but I know how to choose the right kind of port for programming and the COM port number in Arduino IDE and of course I chose Programming Port /
Honestly did not understand how you guessed that the wrong port was selected?

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 13th, 2018 at 3:08pm
Well I am confused. You have reported many different COM port numbers

In visual micro the programming port is reported by you as being COM3

In visual micro the native USB port is higher.

In arduino you have COM20 selected yet you say it is the programming port??

In the arduino output it shows board reset at 1200 baud. Reset at 1200 baud is usually associated to Native USB type connections. It is possible that this is a false output from Arduino but I will look into it.

[code]Forcing reset using 1200bps open/close on port COM20[/code]

Please be clear about COM port numbers and board names and explain why you have selected COM20 in arduino but COM3 in visual studio.

Thanks


ps: I read all your messages. Please be clear when you are talking about "Programming" port or "Native" port. Your reports talk about a "different port" but that is confusing because many users would say COM1 and COM2 are different ports.

Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 13th, 2018 at 4:09pm

Tim@Visual Micro wrote on Mar 13th, 2018 at 3:08pm:
Well I am confused. You have reported many different COM port numbers

Logs I did on a same port Com20
I tried different ports, so earlier I did screenshots on COM3 port
Does not matter, does not work on any ports


Tim@Visual Micro wrote on Mar 13th, 2018 at 3:08pm:
I read all your messages. Please be clear when you are talking about "Programming" port or "Native" port. Your reports talk about a "different port" but that is confusing because many users would say COM1 and COM2 are different ports.


I will explain.
In Visual micro, on the port (Native usb port), the sketch is uploaded.
but not uploaded when using (programming port )

I can re-make screenshots and prepare logs on any COM port.
Which one is better for you? :)

PS: I can send a log file when uploading through the Native USB port, maybe this will help to understand the reason.

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 13th, 2018 at 7:48pm
It's okay thanks I will compare the  logs you have posted

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 13th, 2018 at 9:25pm
I tried the Due and it works okay but you need to follow my original instruction and ensure the USB driver is correct.

You are installing the wrong USB driver. The correct driver is provided by the arduino ide/drivers folder




Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 14th, 2018 at 10:08am
Good day!
It seems I know why it does not work.
Because I bought the board in China :)

When I installed the driver from Arduino.
It ceases to work even in Arduino IDE.

I decided not to torture myself or yourself)
I thought I'll upload sketches via port (Native CSS)
And debug the port through the Program.
But it did not help.

That's what happens.
If I connect both ports, debugging does not stop at the breakpoint.And if you leave it connected only to Native USB , everything works.

Maybe I did not set up work with the second port?
Help me how to do this?

I see a peculiarity when working with one or two ports.

When the card is connected only via the Native USB port
The driver is called Arduino DUE and is connected to COM10

When I connect the second port, the driver for the Native USB is called the Bossf program port and connected via another COM port

If you want I can help you understand why the Chinese driver is not loaded sketch. I can send debugging information.

Now I will learn how to debug the CSS USB TTL converter.


2018-03-14_02_03_22-R_RjoS_R_R_S_S_R_S__S_S_S_S_R_R_S_S_R_.png ( 64 KB | 0 Downloads )
2018-03-14_02_04_03-D__R_R_Rjo_R_R_R_S_R_R_R_S_S__R_R_S_S_RjoR_R_Rjo_R_S_RjoR_S_R_S__2018-03-14_02_03_22-R_RjoS_R_R_S_S_R_S__S_S_S_S_R_R_S_S_R__png_-_.png ( 52 KB | 0 Downloads )

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 14th, 2018 at 12:03pm
1)

The bossac upload command is independent of visual micro. If you make the command work with your board outside of visual studio (.bat file) then you will have solved the issue.

2)

Please start a new thread if you would like to discuss debugging on the Native USB port.


Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 14th, 2018 at 9:09pm
where did you buy your board? I will buy one and try it.

Please give purchase link

Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 15th, 2018 at 7:58am
https://www.aliexpress.com/item/Due-R3-Board-DUE-CH340-for-arduino-ATSAM3X8E-ARM-Main-Control-Board-with-1-meter-USB/32848287516.html?spm=a2g0s.9042311.0.0.QnypeS


Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 15th, 2018 at 9:14am
Do not buy, I'll try on another computer.
By the way, I have a question.
If I try to delete the registration of the program and check the work on the unregistered program, can I then return the registration?

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 15th, 2018 at 9:38pm
1)
Thanks. I should get one anyway. If you have a problem then others will?

2)

I am not sure I understand the question.

Visual Micro is free to build and upload. This means you can test uploading on any machine with visual micro without registration.

Does this answer the question?

Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 16th, 2018 at 6:53am

Tim@Visual Micro wrote on Mar 15th, 2018 at 9:38pm:
1)
Thanks. I should get one anyway. If you have a problem then others will?

2)

I am not sure I understand the question.

Visual Micro is free to build and upload. This means you can test uploading on any machine with visual micro without registration.

Does this answer the question?

I have a Pro version.
I thought that maybe there is a problem in the pro version
(I myself am a developer and I understand that anything can happen :)

And can I register again later?

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 16th, 2018 at 10:26am
Yes I know you have the Pro version. You wrote to me complaining the price was too high for Russia. I gave you special reduced price.

The activation/registration is not linked to visual studio. You have activated your machine OK and have Pro enabled so what is the problem?


Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 16th, 2018 at 11:08am

Tim@Visual Micro wrote on Mar 16th, 2018 at 10:26am:
Yes I know you have the Pro version. You wrote to me complaining the price was too high for Russia. I gave you special reduced price.

For this many thanks.


Quote:
The activation/registration is not linked to visual studio. You have activated your machine OK and have Pro enabled so what is the problem?


I just wanted to check if there was an error on the trial version or not.
Question.
When I studied the documentation,
I read that I can delete the registration key from the settings and register it with another computer.
How often can this be done?
I would like to do this at home and at work.
Since I can not be at the same time in two places :) I would have enough of one key.

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 16th, 2018 at 12:20pm
That would defeat the reason for 1 machine and 3 machine licence keys.


Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 20th, 2018 at 11:32am
Good day.
I apologize for not responding for a long time.

I checked the upload sketch on the DUE on another computer.
The computer was first installed Visual Studio Communi 2017 Preview
Installed Visual Mikro (not registered)

On the port of NativUSB is fine.

On the port "Programm port" sketch was uploaded only the first time.
Further he writes that the device was not found.

Compiling debug version of 'TestForFlashDue' for 'Arduino Due (Programming Port)'
Program size: 22 936 bytes (used 4% of a 524 288 byte maximum) (1,10 secs)

Uploading 'TestForFlashDue' to 'Arduino Due (Programming Port)' using 'COM5'
The uploader process failed
No device found on COM5


I noticed that when the sketch was loaded for the first time.
The system brought up such a message, and nothing more.
Launching Debugger...

Those. could not start debugging.

PS:In Arduino IDE, everything works, on both ports.

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 20th, 2018 at 3:18pm
Please change the tool bar from Debug to Release so that you have same build and upload as Arduino IDE

Title: Re: Debugging Arduino DUE
Post by Aleks on Mar 20th, 2018 at 3:50pm
The same message

Compiling 'TestForFlashDue' for 'Arduino Due (Programming Port)'
Program size: 21 924 bytes (used 4% of a 524 288 byte maximum) (0,22 secs)

Uploading 'TestForFlashDue' to 'Arduino Due (Programming Port)' using 'COM5'
The uploader returned an error
No device found on COM5


how are the screenshots applied?

Title: Re: Debugging Arduino DUE
Post by Visual Micro on Mar 21st, 2018 at 8:50pm
What is the USB driver name, date and time in Control Panel > Device Manager?

Thanks

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