Repository navigation
Description
Tool
Visual Studio extension
Description
The nanoFramework Deploy command in the VS Code extension stops after the build with:
Could not connect to /dev/tty.usbserial-110 to verify device compatibility.
The device runs nanoFramework and the application (LED blink) is running. nanoff works on the same port at 115200 baud.
The message comes from checkDeploymentCompatibility() in out/dotnet.js, which starts nanoDebugBridge and sends
initialize then connect. The bridge replies:
{"id":2,"success":false,"error":"Device '/dev/cu.usbserial-110' not found. Make sure it's connected and running nanoFramework."}
What I found:
-
I drove the bridge by hand with JSON lines on stdin (
dotnet nanoFramework.Tools.DebugBridge.dll). Same result with
/dev/cu.usbserial-110and/dev/tty.usbserial-110. -
Using
nanoFramework.Tools.DebugLibrary.Net.dlldirectly:PortSerial.ConnectDevice()returnsConnected, then
engine.Connect(...)returnsFalseat 921600, 460800 and 115200, also after waiting 6 seconds for the board to boot. -
The device does answer a Wire Protocol ping, but not at 921600. I sent a
Monitor_Pingpacket by hand with pyserial
(markerNFPKTV1\0, flags 8192, payloadSource=0, Flags=1, CRC32 non-reflected, polynomial0x04C11DB7, init 0,
copied from the decompiled library) after an RTS reset:Host baud Reply 9600, 57600, 921600, 1500000, 2000000, 3000000 none 880000 to 990000 (10 kHz steps) none 115200 / 230400 / 460800 4 / 8 / 16 garbage bytes 1000000 to 1060000 32 or 64 bytes, header-like, with bit errors At 1,000,000 baud I get
4e c6 50 8b 54 96 31 00 ...; the expected markerNFPKTV1\0is
4e 46 50 4b 54 56 31 00. Bit 7 is set on some bytes, consistent with a baud rate mismatch. -
My hypothesis, not verified: the CH340 with the macOS built-in driver does not generate 921600 baud accurately.
I have not tried the WCH vendor driver or another USB-serial chip. -
The boot log at 115200 shows the CLR starting normally (
App version: 1.18.0.561,main_task: Calling app_main()).
How to reproduce
- macOS with a CH340-based ESP32-CAM-MB adapter, firmware
ESP32_CAM_REV31.18.0.561, and a project that builds with
the extension. - Get the app running on the device, for example with
nanoff --platform esp32 --serialport /dev/cu.usbserial-110 --baud 115200 --deploy --image Consoleapp1.bin --address 0x1E0000 --reset
(the address is needed because of issue 1: <link to issue 1>). - In VS Code, run the nanoFramework Deploy command and choose the port.
- The error above appears and nothing is deployed.
Expected behaviour
Deploy works, or reports a clear reason (for example "no reply at 921600, retry at a lower baud rate"). Ideas:
- Allow configuring the debug bridge baud rate, or fall back to lower rates.
- Let the user skip the compatibility check, or fall back to
nanoffwhen the bridge cannot reach the device.
Relation to #1837
#1837 is also about the VS Code extension on macOS (Apple Silicon) talking
to an ESP32 through the debug bridge, but it is a different failure and it is closed:
- Unable to debug in VS Code in macOS #1837 is a debug session, with extension 1.0.247, where the bridge crashes with
System.AccessViolationException
inGlobalExclusiveDeviceAccess.GetOrCreateright afterConnecting to device ... at baud rate 921600. It was fixed in
a later version. - Here the extension is 1.0.364, the bridge does not crash, it returns
Device '...' not foundfromconnect,
and the failing step is the Deploy compatibility check. I traced it toengine.Connect(...)getting no reply. - The Unable to debug in VS Code in macOS #1837 reporter's port is
/dev/cu.usbserial-A5069RR4, which looks like an FTDI-style serial number, and it
worked after the fix. Mine is a CH340 (/dev/cu.usbserial-110, vendor ID 0x1A86), which supports my suspicion that
the adapter/driver matters. I did not verify that.
Screenshots
No response
Aditional context
- Visual Studio version: not used (Visual Studio Code 1.143.1, arm64, macOS, Darwin 24.6.0)
- .NET nanoFramework extension version:
nanoframework.vscode-nanoframework-1.0.364 - Tool versions: nanoff 2.5.169+a727d21aed, Mono 6.12.0.206 (msbuild 16.10.1), .NET SDK 10.0.203
- Target name(s):
ESP32_CAM_REV3 - Firmware version: 1.18.0.561 (ESP-IDF v5.5.6)
- Device capabilities output: not available, the bridge cannot connect.
nanoff --devicedetailsoutput:ESP32 (ESP32-D0WD-V3 (revision v3.1)) Features Wi-Fi, BT, Dual Core + LP Core, 240MHz, Vref calibration in eFuse, Coding Scheme None Flash size 4MB unknown from (manufacturer 0x85 device 0x1620) PSRAM: undetermined Crystal 40MHz - Libraries: CoreLibrary 1.17.11, System.Device.Gpio 1.1.64, Runtime.Events 1.11.39. The native checksums in the
.pe
files match the firmware'snative_assemblies.csv(mscorlib 0x1549C856, System.Device.Gpio 0x097E7BC5,
Runtime.Events 0x0EAB00C9). - Hardware: ESP32-CAM AI-Thinker with ESP32-CAM-MB adapter, ESP32-D0WD-V3 rev v3.1, 4 MB flash, 8 MB PSRAM.
USB-serial chip WCH CH340/CH341 (vendor ID 0x1A86), macOS built-in driver. - Even if the check passed, the extension runs
nanoffwithout--address, which is wrong for this firmware
(issue 1). - Found along the way:
System.Device.GpioneedsnanoFramework.Runtime.Events. When it is not referenced the
project builds, the image only containsmscorlibandSystem.Device.Gpio, and the app silently does not start.
I added the package by hand. nanoff --listdevicesreports "No devices found" for this ESP32 while it is connected and running nanoFramework;
I assume it only lists USB devices.
Activity
delfuria commentedon Oct 29, 2026
Update: the problem is the USB-serial driver, not the bridge.
With the macOS built-in driver the CH340 (vendor ID 0x1A86) cannot communicate at 921600 baud. After installing the
WCH CH34x driver (https://github.com/WCHSoftGroup/ch34xser_macos), the port becomes
/dev/cu.wchusbserial110and:Monitor_Pingat 921600 baud now returns a cleanNFPKTV1\0marker (80 bytes). Before, nothing arrivedat 921600, and above 1,000,000 baud the frame had flipped bits.
nanoff --nanodevice --devicedetails --serialport /dev/cu.wchusbserial110reports:So this report is a driver limitation on macOS with CH340 adapters, and the bridge is fine. What could still be improved
in the extension:
A hint such as "no reply at 921600 baud: check the USB-serial driver/adapter, or try another cable" would have saved a lot
of time.
page of the extension, if it exists, is a good place).
Feel free to close this issue or to retitle it as a documentation/diagnostics improvement.
Update: with the WCH driver the extension's Deploy command also works end to end on this setup (compatibility check passes, nanoff --nanodevice --deploy runs, the new build runs on the device).