Failed to locate programming port.

Sysprogs forums Forums VisualGDB Failed to locate programming port.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #29661
    jnanneng
    Participant

    VisualGDB version 5.5R4 (build 3920)

    Clean installation.  Attempting to flash to an Arduino Micro.  Arduino IDE works just fine.  VisualGDB reports error “Failed to locate programming port.  Please check VisualGB diagnostics console.”  Console output below.

    How do I resolve this?

    Initializing assemblies: 16 msec
    Registering factories: 141 msec
    Initializing VisualGDB 5.5.104.3920
    Checking fonts/colors: 3753 msec
    Level 2 initialization: 5008 msec
    Performing a 1200 bps reset sequence on COM6…
    Unexpected exception: —————— System.IO.IOException ——————
    System.IO.IOException: The port ‘COM6’ does not exist.
    at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
    at System.IO.Ports.SerialStream..ctor(String portName, Int32 baudRate, Parity parity, Int32 dataBits, StopBits stopBits, Int32 readTimeout, Int32 writeTimeout, Handshake handshake, Boolean dtrEnable, Boolean rtsEnable, Boolean discardNull, Byte parityReplace)
    at System.IO.Ports.SerialPort.Open()
    at ev.g.a()
    at ev.g.h(Boolean a)
    at qv.b()
    trace=[System.IO.Ports.InternalResources.WinIOError:89, System.IO.Ports.SerialStream..ctor:134, System.IO.Ports.SerialPort.Open:35, ev+g.a:134, ev+g.h:6, qv.b:0]

    Performing a 1200 bps reset sequence on COM6…
    Waiting for programming port to appear. Pre-reset ports: COM3, COM6
    Post-reset ports (#0): COM3, COM6
    Post-reset ports (#1): COM3, COM6
    Post-reset ports (#2): COM3, COM6
    Post-reset ports (#3): COM3, COM6
    Post-reset ports (#4): COM3, COM6
    Post-reset ports (#5): COM3, COM6
    Post-reset ports (#6): COM3, COM6
    Post-reset ports (#7): COM3, COM6
    Post-reset ports (#8): COM3, COM6
    Post-reset ports (#9): COM3, COM6
    Post-reset ports (#10): COM3, COM6
    Post-reset ports (#11): COM3, COM6
    Post-reset ports (#12): COM3, COM6
    Post-reset ports (#13): COM3, COM6
    Post-reset ports (#14): COM3, COM6
    Post-reset ports (#15): COM3, COM6
    Post-reset ports (#16): COM3, COM6
    Post-reset ports (#17): COM3, COM6
    Post-reset ports (#18): COM3, COM6
    Post-reset ports (#19): COM3, COM6
    Post-reset ports (#20): COM3, COM6
    Unexpected exception: —————— System.Exception ——————
    System.Exception: Failed to locate programming port. Please check VisualGDB diagnostics console
    at ev.g.a()
    at ev.g.h(Boolean a)
    at qv.b()
    trace=[ev+g.a:494, ev+g.h:6, qv.b:0]

    Performing a 1200 bps reset sequence on COM6…
    Unexpected exception: —————— System.IO.IOException ——————
    System.IO.IOException: The port ‘COM6’ does not exist.
    at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
    at System.IO.Ports.SerialStream..ctor(String portName, Int32 baudRate, Parity parity, Int32 dataBits, StopBits stopBits, Int32 readTimeout, Int32 writeTimeout, Handshake handshake, Boolean dtrEnable, Boolean rtsEnable, Boolean discardNull, Byte parityReplace)
    at System.IO.Ports.SerialPort.Open()
    at ev.g.a()
    at ev.g.h(Boolean a)
    at qv.b()
    trace=[System.IO.Ports.InternalResources.WinIOError:89, System.IO.Ports.SerialStream..ctor:134, System.IO.Ports.SerialPort.Open:35, ev+g.a:134, ev+g.h:6, qv.b:0]

    Performing a 1200 bps reset sequence on COM6…
    Waiting for programming port to appear. Pre-reset ports: COM3, COM6
    Post-reset ports (#0): COM3, COM6
    Post-reset ports (#1): COM3, COM6
    Post-reset ports (#2): COM3, COM6
    Post-reset ports (#3): COM3, COM6
    Post-reset ports (#4): COM3, COM6
    Post-reset ports (#5): COM3, COM6
    Post-reset ports (#6): COM3, COM6
    Post-reset ports (#7): COM3, COM6
    Post-reset ports (#8): COM3, COM6
    Post-reset ports (#9): COM3, COM6
    Post-reset ports (#10): COM3, COM6
    Post-reset ports (#11): COM3, COM6
    Post-reset ports (#12): COM3, COM6
    Post-reset ports (#13): COM3, COM6
    Post-reset ports (#14): COM3, COM6
    Post-reset ports (#15): COM3, COM6
    Post-reset ports (#16): COM3, COM6
    Post-reset ports (#17): COM3, COM6
    Post-reset ports (#18): COM3, COM6
    Post-reset ports (#19): COM3, COM6
    Post-reset ports (#20): COM3, COM6
    Unexpected exception: —————— System.Exception ——————
    System.Exception: Failed to locate programming port. Please check VisualGDB diagnostics console
    at ev.g.a()
    at ev.g.h(Boolean a)
    at qv.b()
    trace=[ev+g.a:494, ev+g.h:6, qv.b:0]

    #29666
    support
    Keymaster

    Hi,

    It looks like your Arduino core requires an external reset sequence. I.e. it will pulse the DTR signal on COM6, but will then expect the actual programming port to appear as another COM port. VisualGDB determines this by analyzing the Arduino core parameters and might determine some  settings incorrectly for your board.

    Please try double-checking what happens if you program the board with the Arduino IDE. Does it mention COM6 in the logs? Does another COM port temporarily appear in Device Manager during the programming? Are there any command lines for any programming-related tools shown in the Arduino IDE log?

    #29673
    jnanneng
    Participant

    Device manager does show a swapping of ports when uploading the sketch from the Arduino IDE.  Today was COM13 -> COM14 (bootloader) -> COM13.

    When flashing from within Visual GDB that does not occur.

    How do we fix this?  (I’ve got 4 different boards and VisualGDB fails to flash any of them–currently regretting my purchase of VisualGDB)

     

    #29674
    jnanneng
    Participant

    Discovered that arduino has a web editor.  Uploading a sketch from it displays more information in it than the arduino IDE.  Attaching that info.

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

    Based on the logs you provided, VisualGDB and the Arduino tools use different COM ports (your latest log mentions COM4, VisualGDB log mentions COM6). Please double-check that you specify the same COM port in VisualGDB Project Properties as you use in the Arduino IDE.

    #29677
    jnanneng
    Participant

    Yes, I’ve been trying different things; different machines, different USB ports, etc…

    The arduino tools all work as expected.  VisualGDB 5.5R4 fails in all cases.

    I was positive this used to work back when I purchased my VisualGDB license (but I’ve since built a new machine, etc…).  Then I noticed that VisualGDB had an update posted on december 3rd, 2020.  So I uninstalled that version and moved back to the one I likely was using… 5.4R12.  And now VisualGDB flashes successfully.

    Thus I presume there’s a software regression somewhere in the latest version of VisualGDB?

    #29678
    support
    Keymaster

    Trying different things at the same time almost always results in strange behavior, and it’s hard to say which of the multiple changed things caused it.

    We can gladly investigate it further if you could gather the output from VisualGDB Diagnostics Console in v5.4 vs v5.5 using the same COM port. This will show what has changed and will help us pinpoint the cause.

    #29679
    jnanneng
    Participant

    Here’s the VisualGDB diagnostic output from 5.4 R12, same USB port, etc… that I had used with 5.5 R4 (and that log as above)

    Performing a 1200 bps reset sequence on COM6…
    Waiting for programming port to appear. Pre-reset ports: COM3, COM6
    Post-reset ports (#0): COM3, COM6
    Post-reset ports (#1): COM3
    Post-reset ports (#2): COM7, COM3
    Found new COM port: COM7
    C:\Users\jnanneng\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17\bin\avrdude “-CC:\Users\jnanneng\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf” -patmega32u4 -cavr109 “-PCOM7” -b57600 -D “-Uflash:w:c:\projects\ArduinoProject6\Output\Arduino_Micro\Debug/ArduinoProject6.ino.hex:i”

    Connecting to programmer: .
    Connecting to programmer: .
    Found programmer: Id = “CATERIN”; type = S
    Found programmer: Id = “CATERIN”; type = S
    Software Version = 1.0; No Hardware Version given.
    Software Version = 1.0; No Hardware Version given.
    Programmer supports auto addr increment.
    Programmer supports auto addr increment.
    Programmer supports buffered memory access with buffersize=128 bytes.
    Programmer supports buffered memory access with buffersize=128 bytes.

    Programmer supports the following devices:
    Programmer supports the following devices:
    Device code: 0x44
    Device code: 0x44

    avrdude: AVR device initialized and ready to accept instructions
    avrdude: AVR device initialized and ready to accept instructions

    Reading | ################################################## | 100% -0.00s
    Reading | ################################################## | 100% -0.00s

    avrdude: Device signature = 0x1e9587 (probably m32u4)
    avrdude: Device signature = 0x1e9587 (probably m32u4)
    avrdude: reading input file “c:\projects\ArduinoProject6\Output\Arduino_Micro\Debug/ArduinoProject6.ino.hex”
    avrdude: reading input file “c:\projects\ArduinoProject6\Output\Arduino_Micro\Debug/ArduinoProject6.ino.hex”
    avrdude: writing flash (4088 bytes):
    avrdude: writing flash (4088 bytes):

    Writing | ################################################## | 100% 0.32s
    Writing | ################################################## | 100% 0.32s

    avrdude: 4088 bytes of flash written
    avrdude: 4088 bytes of flash written
    avrdude: verifying flash memory against c:\projects\ArduinoProject6\Output\Arduino_Micro\Debug/ArduinoProject6.ino.hex:
    avrdude: verifying flash memory against c:\projects\ArduinoProject6\Output\Arduino_Micro\Debug/ArduinoProject6.ino.hex:
    avrdude: load data flash data from input file c:\projects\ArduinoProject6\Output\Arduino_Micro\Debug/ArduinoProject6.ino.hex:
    avrdude: load data flash data from input file c:\projects\ArduinoProject6\Output\Arduino_Micro\Debug/ArduinoProject6.ino.hex:
    avrdude: input file c:\projects\ArduinoProject6\Output\Arduino_Micro\Debug/ArduinoProject6.ino.hex contains 4088 bytes
    avrdude: input file c:\projects\ArduinoProject6\Output\Arduino_Micro\Debug/ArduinoProject6.ino.hex contains 4088 bytes
    avrdude: reading on-chip flash data:
    avrdude: reading on-chip flash data:

    Reading | ################################################## | 100% 0.04s
    Reading | ################################################## | 100% 0.04s

    avrdude: verifying …
    avrdude: verifying …
    avrdude: 4088 bytes of flash verified
    avrdude: 4088 bytes of flash verified

    avrdude done. Thank you.
    avrdude done. Thank you.

    #29680
    support
    Keymaster

    Thanks, we have located the difference. We have indeed changed the Arduino reset logic to match the Arduino IDE more closely, as another user reported problems with Arduino Nano.

    As we do not have the hardware to recheck it on our side, please try downloading and running the attached test project. Does it reset the board properly into the bootloader (with a different COM port)? If not, does removing everything between port.Open() and port.Close() result in a reset?

    Attachments:
    You must be logged in to view attached files.
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.