Arduino UNO R4 Wifi debug

Sysprogs forums Forums VisualGDB Arduino UNO R4 Wifi debug

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #36428
    roujesky
    Participant

    I just bought an Arduino R4 Wifi.   I created the simple blinky application in the Arduino IDE 2.3.4 and it flashes the on board LED and I can even step thru the app in the debugger.   Kind of primitive, tho.   anyway, I imported the little app into VGDB.  I close the arduino IDE.   I press the VS button “Build and Program Arduino Sketch into flash memory” and it prompts me for the com port.  I use COM3, just like the arduino IDE used (that is why I closed it).  And I get  the error  Failed to upload the compiled sketch (attached), no device attached.  But the arduino ide uses COM 3 just fine. I also, I  clicked on the “Dump the command line into a batch file” .   I am also attaching that just in case that is useful

    I am running windows 11, VGDB version 6.0R6(build 5261) .

    any ideas would be appreciated

    thanks!

    Attachments:
    You must be logged in to view attached files.
    #36430
    roujesky
    Participant

    I just noticed that I cannot upload a .bat file.  I renamed to a txt file and here it is

    Attachments:
    You must be logged in to view attached files.
    #36432
    support
    Keymaster

    Hi,

    The command line looks fine. You can try running it manually and comparing it against the command used by the Arduino IDE (should be mentioned in the Arduino IDE logs). If there is a particular difference between the command lines, we should be able to fix it.

    #36437
    roujesky
    Participant

    I set the logging in the arduino IDE to verbose.  attached is the logging.

    thanks!

     

     

    Attachments:
    You must be logged in to view attached files.
    #36442
    support
    Keymaster

    The command lines look identical except for the -d argument:

    VisualGDB:

    "C:\Users\RobertOujesky\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.9.1-arduino5\bossac" --port=COM3 -U -e -w "C:\Users\RobertOujesky\source\repos\ap7\Output\Arduino_UNO_R4_WiFi\Debug/AP1.ino.bin" -R

    Arduino IDE:

    "C:\Users\RobertOujesky\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.9.1-arduino5/bossac" -d --port=COM3 -U -e -w "C:\Users\RobertOujesky\AppData\Local\arduino\sketches\9144B9EB1CD4BF9BEC21C2EBE1773425/AP1.ino.bin" -R

    Please try running both commands manually from the Command Prompt window. Can you confirm that adding “-d” to the VisualGDB’s command line resolves the problem?

    #36462
    roujesky
    Participant

    Interesting, the Arduino (-d) gave me

    C:\Users\RobertOujesky>”C:\Users\RobertOujesky\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.9.1-arduino5/bossac” -d –port=COM3 -U -e -w “C:\Users\RobertOujesky\AppData\Local\arduino\sketches\9144B9EB1CD4BF9BEC21C2EBE1773425/AP1.ino.bin” -R
    Set binary mode
    Send auto-baud
    Set binary mode
    No device found on COM3

    The VisualGDB version (no -d) gave me the same thing

    C:\Users\RobertOujesky>”C:\Users\RobertOujesky\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.9.1-arduino5\bossac” –port=COM3 -U -e -w “C:\Users\RobertOujesky\source\repos\ap7\Output\Arduino_UNO_R4_WiFi\Debug/AP1.ino.bin” -R
    No device found on COM3

    although I dont see the 3 lines

    Set binary mode
    Send auto-baud
    Set binary mode

    after the first time running the command.   I ran both commands a few times with and without arduino ide running.   I made sure that I could still debug with the arduino IDE on com 3.   Attached is a screenshot of my device manager showing my ports in case that means anything….

     

     

    Attachments:
    You must be logged in to view attached files.
    #36464
    support
    Keymaster

    Hi,

    Thanks for checking this. If the Arduino IDE works, but running the same command outside it produces a different result, it could be some system-level setting (antivirus?) or Arduino IDE doing something undocumented (running a different command before it?). Unfortunately, we are not aware of anything specific that could be causing it and don’t have the same board to try it out.

    You can try asking on the Arduino forums for any clues to run the programming command line manually (it’s not really specific to VisualGDB). If there is any trick to getting it to program via command line, VisualGDB should be easily able to replicate it, but if it’s something non-trivial deep within the Arduino IDE, there might be no easy way around it.

    #36469
    roujesky
    Participant

    The response in the arduino forum is here:

    https://forum.arduino.cc/t/cannot-run-from-bossac-from-command-line/1356621/3

    I pressed the reset button on the board and it does blink the L LED, but bossac command from the command lines still says no device found on com3.

    I was at least hoping i could see a DFU device appear in the device manager.   I did not see anything appear….

    Not sure how to try “1200 bps touch” correctly.   I looked thru the arduino-cli docs and did not see a reference to it.   I did try just using TeraTerm and connect to the board thru COM3 at 1200 BPS and it started blinking like in that DFU mode, but bossac from the command line had the same error. 🙁

    I am not sure what to try next…

     

    thanks!

     

     

    #36474
    support
    Keymaster

    This could be tricky. The 1200bps touch indeed isn’t documented very well. VisualGDB does support it for some ESP8266 targets, however the Arduino Uno could be handling it differently.

    We are currently fixing a few last-minute issues with the upcoming VisualGDB 6.0R7 and will look into this after that.

    #36476
    roujesky
    Participant

    Thanks!

    #36477
    support
    Keymaster

    OK, we have rechecked it. VisualGDB should normally handle it correctly. You can try opening View->Other Windows->VisualGDB Diagnostics, initiating a FLASH programming and checking that the diagnostics console mentions as 1200 bps reset sequence on the correct COM port.

    If VisualGDB does mention the reset, but the board does not accept it, the best we can do is share the code snippet on our side that is responsible for resetting the board:

    using (var port = new System.IO.Ports.SerialPort(COMPortFromSettings) { BaudRate = 1200 })
    {
        port.Open();
        port.RtsEnable = true;
        port.DtrEnable = true;
        port.Handshake = System.IO.Ports.Handshake.RequestToSend;
        Thread.Sleep(1000);
        port.DtrEnable = false;
        port.Close();
    }

    If you can tweak it to the point where the board can recognize it, we can add a setting on our side to replicate it. Otherwise, you would need to use an oscilloscope/logic analyzer on the COM port pins to figure out the exact difference between the Arduino IDE and our reset implementation. It could boil down to timings on a particular board and a particular COM port, and may just not be worth the effort if it only affects one board.

    #36482
    roujesky
    Participant

    Here is VisualGDB diagnostics output:

    Initializing assemblies: 6 msec
    Registering factories: 85 msec
    Initializing VisualGDB version: 6.0.106.5261
    Checking fonts/colors: 10 msec
    Level 2 initialization: 590 msec
    Determining the top-level window to show a WPF popup…
    GetActiveWindow() returned 60ea0. Will use it.
    Performing a 1200 bps reset sequence on COM3…
    Determining the top-level window to show a WPF popup…
    GetActiveWindow() returned 60ea0. Will use it.
    Run “C:\Users\RobertOujesky\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.9.1-arduino5\bossac –port=COM3 -U -e -w “C:\Users\RobertOujesky\source\repos\ap7\Output\Arduino_UNO_R4_WiFi\Debug/AP1.ino.bin” -R” in directory “” on local computer
    Run “C:\Users\RobertOujesky\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.9.1-arduino5\bossac –port=COM3 -U -e -w “C:\Users\RobertOujesky\source\repos\ap7\Output\Arduino_UNO_R4_WiFi\Debug/AP1.ino.bin” -R” in directory “” on local computer
    No device found on COM3
    Determining the top-level window to show a WPF popup…
    GetActiveWindow() returned a0e3c. Will use it.

     

    I will hook up my LA later and take a look.

    thanks again

     

     

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.