SinoIOT for VS Code
Serial terminal and firmware download for the SinoWealth SH87F8919 Wi-Fi 6 / BLE 5.2 SoC,
built for the SinoIOT SDK. Flash your build over the board's UART, watch it boot in a VS Code
terminal, and let AI agents and scripts use the same board connection.
Version 1.0 covers the terminal, flashing, reboot, chip detection and Agent Access.
Partition programming (erase, multiple images), OTP/eFuse and command history will follow in
later versions; until then use the SinoIOT Flash Tool GUI for them.
Quick start
- Connect the board's UART to your PC with a USB-UART adapter (CH340, CP210x, FTDI, ...).
- Open your SinoIOT SDK folder in VS Code and build the project.
- Click the port item in the status bar and pick the adapter (for example
COM17 or
/dev/ttyUSB0).
- Click Connect (link icon): the board's log appears in a SinoIOT terminal tab. Type commands as in
any serial terminal.
- Click Flash (lightning icon): the current build is downloaded at 2 Mbps, every block is CRC-checked, the
board reboots and you see the new firmware start in the same terminal.
Features
- Serial terminal in a normal VS Code terminal tab: 115200 bps, ANSI colours, Enter sends
CRLF. Disconnect releases the port but keeps the tab.
- One-click flash of the current SDK build (
build/<chip>/<project>/package/all-app.bin
for the chip and project selected in the SDK), or of any .bin from the Explorer context menu.
Multi-image BL1DLV10 files are split automatically.
- Robust bootloader sync: software reboot, RTS reset, and if both fail, a prompt to press
the board's RESET button.
- Reboot and Detect Chip (product ID, flash ID and link speed; writes nothing).
- Agent Access: an explicit switch that lets AI coding agents, the SDK's
tools/ai/board_cli.py and the SDK's Build & Flash task use this window's board connection.
- History buffer for agents and debugging: every line from the board with a millisecond
timestamp, plus the commands sent (
[TX]) and when flashing or reboots happened.
- Works next to the SinoIOT Flash Tool GUI: each tool uses its own port and TCP port.
Nothing is opened or connected automatically: the serial port is only used after you click
Connect, Flash or Reboot.
Status bar
| Item |
Action |
COM17 |
Select the port; while connected, show the terminal |
| link icon / disconnect icon |
Connect / Disconnect: open or release the port |
| lightning icon |
Flash the current build (spins while flashing) |
| folder icon |
Choose a firmware file (.bin) and flash it |
| reboot icon |
Reboot the board |
Agent Access: Off / On |
Switch Agent Access (available while connected) |
All commands are in the Command Palette under SinoIOT: Select Serial Port, Connect,
Disconnect, Show Terminal, Flash Current Build, Flash File..., Detect Chip, Reboot Board,
Agent Access On / Off, Show Log.
Agent Access
AI coding agents that can run shell commands build, flash and test firmware through the SDK's
tools/ai/board_cli.py. That script talks to a local TCP port
(3320 + ID), served either by the SinoIOT Flash Tool GUI or by this extension.
- On (while connected): the extension listens on the first free port and writes its ID to
.vscode/.current_flashtool_id, so board_cli.py and Build & Flash use this window.
- Off, or Disconnect: it stops listening and restores the previous ID.
Agents can then send commands, stream the log, read the history, reboot the board and flash
firmware (board_cli.py --flash_sync) while you watch everything in the terminal. The port only
listens on 127.0.0.1 and the WSL network adapter, so the board is not reachable from the
network.
- Windows: ports are
COMn.
- Linux: ports are
/dev/ttyUSBn or /dev/ttyACMn. Your user needs serial access:
sudo usermod -aG dialout $USER, then log out and in again.
- Windows + WSL2: install the extension in the Windows VS Code (Install Locally). With
a WSL folder open it still uses the Windows COM port and reads the firmware from WSL; agents
in WSL reach Agent Access through the WSL network. Do not attach the USB-UART adapter to WSL
with
usbipd. The first time Agent Access is switched on, Windows may ask whether VS Code
may accept connections; allow it for the WSL network.
Settings
| Setting |
Default |
Meaning |
sinoiot.port |
(empty) |
Fixed serial port; empty: the port selected in the status bar |
sinoiot.terminal.baudRate |
115200 |
Terminal baud rate |
sinoiot.flash.file |
(empty) |
Firmware to flash instead of the current build |
sinoiot.flash.highSpeed |
true |
Download at 2 Mbps (falls back to 115200 if refused) |
sinoiot.flash.rebootAfter |
true |
Reboot after flashing |
sinoiot.flash.verboseLog |
false |
Log every protocol frame in the SinoIOT output |
sinoiot.history.maxLines |
200000 |
Lines kept in the history buffer |
sinoiot.tcp.flashtoolId |
-1 |
Agent Access ID (0-5); -1: the first free one |
sinoiot.tcp.bindAllInterfaces |
false |
Let Agent Access listen on all network interfaces |
Requirements
- An SH87F8919 board with its download UART on a USB-UART adapter. If the adapter's RTS line
drives the chip's reset (the usual auto-reset circuit), flashing is fully automatic;
otherwise press RESET when prompted.
- VS Code 1.85 or later.
- For Agent Access and Build & Flash: a SinoIOT SDK with
tools/ai/board_cli.py.
Troubleshooting
- "Access denied" / port busy: another program uses the port (Flash Tool GUI, another VS Code
window, a serial terminal). Close it or disconnect there.
- "Permission denied" on Linux: add your user to the
dialout group (see Platforms).
- Sync fails: check the UART wiring and that the board is powered; press RESET when asked.
- The SinoIOT output channel (SinoIOT: Show Log) shows every step of a flash.
License
Apache-2.0, see the LICENSE file.