<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://docs.bouffalolab.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E5%BC%A0%E8%89%AF</id>
	<title>Bouffalo Lab Docs - 用户贡献 [zh-cn]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.bouffalolab.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E5%BC%A0%E8%89%AF"/>
	<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E7%89%B9%E6%AE%8A:%E7%94%A8%E6%88%B7%E8%B4%A1%E7%8C%AE/%E5%BC%A0%E8%89%AF"/>
	<updated>2026-07-14T03:17:19Z</updated>
	<subtitle>用户贡献</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDBForWindows&amp;diff=318</id>
		<title>DebuggingBouffaloLabChipsWithGDBForWindows</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDBForWindows&amp;diff=318"/>
		<updated>2026-06-24T05:47:02Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= How to debug the DVK light development board via CKLink: =&lt;br /&gt;
&lt;br /&gt;
==== 1. Connect to the PC via USB. ====&lt;br /&gt;
GPIO 1   TCK&lt;br /&gt;
&lt;br /&gt;
GPIO 3   TDI&lt;br /&gt;
&lt;br /&gt;
GPIO 2   TDO&lt;br /&gt;
&lt;br /&gt;
GPIO 0   TMS&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVK Light CKLinkLite.jpg| 600像素 | BL616DVKLight_CKLinkLite]]&lt;br /&gt;
&lt;br /&gt;
==== 2. Perform GDB debugging. ====&lt;br /&gt;
&lt;br /&gt;
Windows environments are also supported, but the setup is more complicated. We strongly recommend using the Ubuntu development environment.&lt;br /&gt;
If you choose to use a Windows environment:&lt;br /&gt;
&lt;br /&gt;
* 2.1 debugserver&lt;br /&gt;
&lt;br /&gt;
Debugserver can be used in a Windows environment. For details, please refer to the compressed package and the following two links:&lt;br /&gt;
&lt;br /&gt;
https://www.xrvm.cn/document?temp=install-t-head-debugserver-and-ice-drivers&amp;amp;slug=t-head-debug-server-user-manual&lt;br /&gt;
&lt;br /&gt;
https://www.xrvm.cn/document?temp=main-interface-menu-toolbar-introduction&amp;amp;slug=t-head-debug-server-user-manual&lt;br /&gt;
&lt;br /&gt;
* 2.2 gdb&lt;br /&gt;
For GDB, I recommend installing Ubuntu under WSL. &lt;br /&gt;
 &amp;lt;code&amp;gt;riscv64-unknown-elf-gdb *.elf&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDBForWindows&amp;diff=317</id>
		<title>DebuggingBouffaloLabChipsWithGDBForWindows</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDBForWindows&amp;diff=317"/>
		<updated>2026-06-24T05:46:30Z</updated>

		<summary type="html">&lt;p&gt;张良：​创建页面，内容为“ = How to debug the DVK light development board via CKLink: =  ==== 1. Connect to the PC via USB. ==== GPIO 1   TCK  GPIO 3   TDI  GPIO 2   TDO  GPIO 0   TMS   BL616DVKLight_CKLinkLite  ==== 2. Perform GDB debugging. ====  Windows environments are also supported, but the setup is more complicated. We strongly recommend using the Ubuntu deve…”&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= How to debug the DVK light development board via CKLink: =&lt;br /&gt;
&lt;br /&gt;
==== 1. Connect to the PC via USB. ====&lt;br /&gt;
GPIO 1   TCK&lt;br /&gt;
&lt;br /&gt;
GPIO 3   TDI&lt;br /&gt;
&lt;br /&gt;
GPIO 2   TDO&lt;br /&gt;
&lt;br /&gt;
GPIO 0   TMS&lt;br /&gt;
&lt;br /&gt;
[[index.php?title=文件:BL616DVK_Light_CKLinkLite.jpg|链接=文件:BL616DVK_Light_CKLinkLite.jpg|800x800像素| BL616DVKLight_CKLinkLite]]&lt;br /&gt;
&lt;br /&gt;
==== 2. Perform GDB debugging. ====&lt;br /&gt;
&lt;br /&gt;
Windows environments are also supported, but the setup is more complicated. We strongly recommend using the Ubuntu development environment.&lt;br /&gt;
If you choose to use a Windows environment:&lt;br /&gt;
&lt;br /&gt;
* 2.1 debugserver&lt;br /&gt;
&lt;br /&gt;
Debugserver can be used in a Windows environment. For details, please refer to the compressed package and the following two links:&lt;br /&gt;
&lt;br /&gt;
https://www.xrvm.cn/document?temp=install-t-head-debugserver-and-ice-drivers&amp;amp;slug=t-head-debug-server-user-manual&lt;br /&gt;
&lt;br /&gt;
https://www.xrvm.cn/document?temp=main-interface-menu-toolbar-introduction&amp;amp;slug=t-head-debug-server-user-manual&lt;br /&gt;
&lt;br /&gt;
* 2.2 gdb&lt;br /&gt;
For GDB, I recommend installing Ubuntu under WSL. &lt;br /&gt;
 &amp;lt;code&amp;gt;riscv64-unknown-elf-gdb *.elf&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=316</id>
		<title>DebuggingBouffaloLabChipsWithGDB</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=316"/>
		<updated>2026-06-24T01:09:59Z</updated>

		<summary type="html">&lt;p&gt;张良：​/* 1. Connect to the PC via USB. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to debug the DVK light development board via CKLink: =&lt;br /&gt;
&lt;br /&gt;
==== 1. Connect to the PC via USB. ====&lt;br /&gt;
GPIO 1   TCK&lt;br /&gt;
&lt;br /&gt;
GPIO 3   TDI&lt;br /&gt;
&lt;br /&gt;
GPIO 2   TDO&lt;br /&gt;
&lt;br /&gt;
GPIO 0   TMS&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVK Light CKLinkLite.jpg| 600像素 | BL616DVKLight_CKLinkLite]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2. Perform GDB debugging. ====&lt;br /&gt;
&lt;br /&gt;
Using Ubuntu as an example, run the following two commands separately:&amp;lt;code&amp;gt;DebugServerConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;riscv64-unknown-elf-gdb *.elf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVKLight_CKLinkLite.gif| BL616DVKLight_CKLinkLite]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=315</id>
		<title>DebuggingBouffaloLabChipsWithGDB</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=315"/>
		<updated>2026-06-24T01:04:31Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= How to debug the DVK light development board via CKLink: =&lt;br /&gt;
&lt;br /&gt;
==== 1. Connect to the PC via USB. ====&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVK Light CKLinkLite.jpg| 600像素 | BL616DVKLight_CKLinkLite]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2. Perform GDB debugging. ====&lt;br /&gt;
&lt;br /&gt;
Using Ubuntu as an example, run the following two commands separately:&amp;lt;code&amp;gt;DebugServerConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;riscv64-unknown-elf-gdb *.elf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVKLight_CKLinkLite.gif| BL616DVKLight_CKLinkLite]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=FlashWholeBin&amp;diff=305</id>
		<title>FlashWholeBin</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=FlashWholeBin&amp;diff=305"/>
		<updated>2026-05-28T08:28:36Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1. After pressing &#039;&#039;&#039;boot&#039;&#039;&#039;, press and release &#039;&#039;&#039;chip_en&#039;&#039;&#039;, and the device will enter &#039;&#039;&#039;programming mode&#039;&#039;&#039;.    &lt;br /&gt;
&lt;br /&gt;
2. Open &#039;&#039;&#039;BLFlashCube-ubuntu&#039;&#039;&#039; (&#039;&#039;&#039;BLFlashCube.exe&#039;&#039;&#039;), then go to Flash Utils -&amp;gt; Port/SN(/dev/ttyUSB0) -&amp;gt; Flash Program (Browse) -&amp;gt; select lg_demo_20260528.bin -&amp;gt; &#039;&#039;&#039;Download&#039;&#039;&#039;.  &lt;br /&gt;
&lt;br /&gt;
[[文件:Flash_wholebin.gif | Flash_wholebin Overview]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Open the serial port (baud rate &#039;&#039;&#039;2M&#039;&#039;&#039;), then press &#039;&#039;&#039;chip_en&#039;&#039;&#039;(reset) to view the log.&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=FlashWholeBin&amp;diff=304</id>
		<title>FlashWholeBin</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=FlashWholeBin&amp;diff=304"/>
		<updated>2026-05-28T08:25:49Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
1. After pressing boot, press and release chip_en, and the device will enter programming mode.    &lt;br /&gt;
&lt;br /&gt;
2. Open BLFlashCube-ubuntu (BLFlashCube.exe), then go to Flash Utils -&amp;gt; Port/SN(/dev/ttyUSB0) -&amp;gt; Flash Program (Browse) -&amp;gt; select lg_demo_20260528.bin -&amp;gt; Download.  &lt;br /&gt;
&lt;br /&gt;
[[文件:Flash_wholebin.gif | Flash_wholebin Overview]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Open the serial port (baud rate 2M), then press rst to view the log.&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=FlashWholeBin&amp;diff=303</id>
		<title>FlashWholeBin</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=FlashWholeBin&amp;diff=303"/>
		<updated>2026-05-28T08:24:47Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
1. After pressing boot, press and release chip_en, and the device will enter programming mode.    &lt;br /&gt;
&lt;br /&gt;
2. Open BLFlashCube-ubuntu (BLFlashCube.exe), then go to Flash Utils -&amp;gt; Port/SN(/dev/ttyUSB0) -&amp;gt; Flash Program (Browse) -&amp;gt; select lg_demo_20260528.bin -&amp;gt; Download.  &lt;br /&gt;
&lt;br /&gt;
[[index.php?title=文件:Flash_wholebin.gif|链接=文件:Flash_wholebin.gif| Flash_wholebin]]  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Open the serial port (baud rate 2M), then press rst to view the log.&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=FlashWholeBin&amp;diff=302</id>
		<title>FlashWholeBin</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=FlashWholeBin&amp;diff=302"/>
		<updated>2026-05-28T08:24:01Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
1. After pressing boot, press and release chip_en, and the device will enter programming mode.  &lt;br /&gt;
&lt;br /&gt;
2. Open BLFlashCube-ubuntu (BLFlashCube.exe), then go to Flash Utils -&amp;gt; Port/SN(/dev/ttyUSB0) -&amp;gt; Flash Program (Browse) -&amp;gt; select lg_demo_20260528.bin -&amp;gt; Download.  &lt;br /&gt;
&lt;br /&gt;
[[index.php?title=文件:Flash_wholebin.gif|链接=文件:Flash_wholebin.gif| Flash_wholebin]]  &lt;br /&gt;
&lt;br /&gt;
3. Open the serial port (baud rate 2M), then press rst to view the log.&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:Flash_wholebin.gif&amp;diff=301</id>
		<title>文件:Flash wholebin.gif</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:Flash_wholebin.gif&amp;diff=301"/>
		<updated>2026-05-28T08:22:06Z</updated>

		<summary type="html">&lt;p&gt;张良：​Flash wholebin&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 摘要 ==&lt;br /&gt;
Flash wholebin&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=FlashWholeBin&amp;diff=300</id>
		<title>FlashWholeBin</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=FlashWholeBin&amp;diff=300"/>
		<updated>2026-05-28T08:19:50Z</updated>

		<summary type="html">&lt;p&gt;张良：​创建页面，内容为“ 1. After pressing boot, press and release chip_en, and the device will enter programming mode.    2. Open BLFlashCube-ubuntu (BLFlashCube.exe), then go to Flash Utils -&amp;gt; Port/SN(/dev/ttyUSB0) -&amp;gt; Flash Program (Browse) -&amp;gt; select lg_demo_20260528.bin -&amp;gt; Download.    3. Open the serial port (baud rate 2M), then press rst to view the log.”&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
1. After pressing boot, press and release chip_en, and the device will enter programming mode.  &lt;br /&gt;
&lt;br /&gt;
2. Open BLFlashCube-ubuntu (BLFlashCube.exe), then go to Flash Utils -&amp;gt; Port/SN(/dev/ttyUSB0) -&amp;gt; Flash Program (Browse) -&amp;gt; select lg_demo_20260528.bin -&amp;gt; Download.  &lt;br /&gt;
&lt;br /&gt;
3. Open the serial port (baud rate 2M), then press rst to view the log.&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:Nethub_arch.gif&amp;diff=299</id>
		<title>文件:Nethub arch.gif</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:Nethub_arch.gif&amp;diff=299"/>
		<updated>2026-04-24T17:15:00Z</updated>

		<summary type="html">&lt;p&gt;张良：​张良上传文件:Nethub arch.gif的新版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 摘要 ==&lt;br /&gt;
nethub sdio usb interface arch.&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubVirtualChannel&amp;diff=298</id>
		<title>NetHubVirtualChannel</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubVirtualChannel&amp;diff=298"/>
		<updated>2026-04-24T17:13:00Z</updated>

		<summary type="html">&lt;p&gt;张良：​Reduce overlap between NetHubArchitecture and NetHubVirtualChannel (2026-04-25)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub USER Virtual Channel =&lt;br /&gt;
&lt;br /&gt;
This document describes the current NetHub USER virtual channel support.&lt;br /&gt;
&lt;br /&gt;
It focuses on USER virtual channel usage, prerequisites, APIs, and limits. For the full NetHub architecture and the broader interface support matrix, read [[NetHubArchitecture|NetHubArchitecture.md]].&lt;br /&gt;
&lt;br /&gt;
== 1. Concept ==&lt;br /&gt;
&lt;br /&gt;
USER virtual channel is a logical message channel carried on the active host interface.&lt;br /&gt;
&lt;br /&gt;
It is not a separate physical interface. The public API is transport-neutral, while the current in-tree implementation is still centered on the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
Common logical types:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt; || private customer or application data&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;AT&amp;lt;/code&amp;gt; || control payloads&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt; || internal coordination messages&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 2. Current Scope ==&lt;br /&gt;
&lt;br /&gt;
Current implementation summary:&lt;br /&gt;
&lt;br /&gt;
* the public API is transport-neutral by design&lt;br /&gt;
* the current in-tree end-to-end USER virtual channel path follows the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface&lt;br /&gt;
* the device-side implementation is currently in &amp;lt;code&amp;gt;backend/host/sdio/virtualchan.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* the host userspace library is currently aligned with &amp;lt;code&amp;gt;mr_sdio.ko + netlink&amp;lt;/code&amp;gt;&lt;br /&gt;
* USB device-side ACM transport exists, but in-tree host &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; alignment is not finished&lt;br /&gt;
* SPI is not supported&lt;br /&gt;
&lt;br /&gt;
== 3. Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Before using the current in-tree USER virtual channel path, confirm:&lt;br /&gt;
&lt;br /&gt;
* device side is built with &amp;lt;code&amp;gt;CONFIG_NETHUB=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* device side enables &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* the selected bring-up path uses the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface&lt;br /&gt;
* host side has loaded &amp;lt;code&amp;gt;mr_sdio.ko&amp;lt;/code&amp;gt;&lt;br /&gt;
* the host-device link is already working&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* USER and AT are parallel logical channels&lt;br /&gt;
* customer private data should stay on the &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt; type&lt;br /&gt;
* documentation should not describe USB and SPI as if they already share a finished end-to-end virtual channel stack&lt;br /&gt;
&lt;br /&gt;
== 4. Device-Side API ==&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Common APIs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_user_send(const void *data, uint16_t len);&lt;br /&gt;
int nethub_vchan_user_recv_register(nethub_vchan_recv_cb_t recv_cb, void *cb_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 5. Host-Side API ==&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub/virtualchan/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initialization and cleanup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_init(void);&lt;br /&gt;
int nethub_vchan_deinit(void);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
USER channel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
typedef void (*nethub_vchan_recv_callback_t)(const void *data, size_t len);&lt;br /&gt;
&lt;br /&gt;
int nethub_vchan_user_send(const void *data, size_t len);&lt;br /&gt;
int nethub_vchan_user_register_callback(nethub_vchan_recv_callback_t callback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optional state query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct {&lt;br /&gt;
    nethub_vchan_link_state_t link_state;&lt;br /&gt;
    nethub_vchan_host_state_t host_state;&lt;br /&gt;
} nethub_vchan_state_snapshot_t;&lt;br /&gt;
&lt;br /&gt;
int nethub_vchan_get_state_snapshot(nethub_vchan_state_snapshot_t *snapshot);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optional link event callback:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_register_link_event_callback(&lt;br /&gt;
    nethub_vchan_link_event_callback_t callback,&lt;br /&gt;
    void *user_data);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 6. Typical Usage Order ==&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;nethub_vchan_init()&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;nethub_vchan_user_register_callback()&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;nethub_vchan_user_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;nethub_vchan_deinit()&amp;lt;/code&amp;gt; when finished&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;nethub_vchan.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
static void user_rx_cb(const void *data, size_t len)&lt;br /&gt;
{&lt;br /&gt;
    printf(&amp;quot;recv USER data: %.*s\n&amp;quot;, (int)len, (const char *)data);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
    const char *msg = &amp;quot;hello from host&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    if (nethub_vchan_init() != 0) {&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    nethub_vchan_user_register_callback(user_rx_cb);&lt;br /&gt;
    nethub_vchan_user_send(msg, strlen(msg));&lt;br /&gt;
&lt;br /&gt;
    nethub_vchan_deinit();&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 7. Limits and Notes ==&lt;br /&gt;
&lt;br /&gt;
* maximum payload length per message is &amp;lt;code&amp;gt;1500&amp;lt;/code&amp;gt; bytes&lt;br /&gt;
* USER virtual channel is packet-oriented, not a byte stream&lt;br /&gt;
* the current in-tree end-to-end path is SDIO-based&lt;br /&gt;
* if the device side does not enable &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN&amp;lt;/code&amp;gt;, the current in-tree USER virtual channel path will not work&lt;br /&gt;
* if control traffic and USER traffic coexist, keep private application traffic on &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt; and do not reuse the &amp;lt;code&amp;gt;AT&amp;lt;/code&amp;gt; type&lt;br /&gt;
&lt;br /&gt;
== 8. Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[NetHub|NetHub.md]]&lt;br /&gt;
* [[NetHubQuickBringup|NetHubQuickBringup.md]]&lt;br /&gt;
* [[NetHubArchitecture|NetHubArchitecture.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubArchitecture&amp;diff=297</id>
		<title>NetHubArchitecture</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubArchitecture&amp;diff=297"/>
		<updated>2026-04-24T17:12:58Z</updated>

		<summary type="html">&lt;p&gt;张良：​Reduce overlap between NetHubArchitecture and NetHubVirtualChannel (2026-04-25)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub Architecture =&lt;br /&gt;
&lt;br /&gt;
This document summarizes the current NetHub architecture across the device-side module, the optional host control stack, and the current support boundaries.&lt;br /&gt;
&lt;br /&gt;
== 1. High-Level Model ==&lt;br /&gt;
&lt;br /&gt;
NetHub runs on the device and bridges already-available Wi-Fi capability onto one selected host interface.&lt;br /&gt;
&lt;br /&gt;
[[文件:Nethub_arch.gif | NetHub Architecture Overview]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Wi-Fi backend + lwIP&lt;br /&gt;
       |&lt;br /&gt;
       v&lt;br /&gt;
     nethub&lt;br /&gt;
  +-----------+&lt;br /&gt;
  | data-path |&lt;br /&gt;
  | filter    |&lt;br /&gt;
  | ctrlpath  |&lt;br /&gt;
  | vchan     |&lt;br /&gt;
  +-----------+&lt;br /&gt;
       |&lt;br /&gt;
       v&lt;br /&gt;
host interface&lt;br /&gt;
(SDIO / USB / SPI)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important boundary:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub&amp;lt;/code&amp;gt; core does not directly depend on &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; is an optional example consumer of the NetHub control path&lt;br /&gt;
&lt;br /&gt;
== 2. Current Support Matrix ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Area !! SDIO !! USB !! SPI&lt;br /&gt;
|-&lt;br /&gt;
| Device-side interface backend || yes || yes || yes&lt;br /&gt;
|-&lt;br /&gt;
| Device-side data-path || yes || yes, through &amp;lt;code&amp;gt;USB ECM&amp;lt;/code&amp;gt; || no&lt;br /&gt;
|-&lt;br /&gt;
| Device-side control transport plumbing || yes || yes, through &amp;lt;code&amp;gt;USB ACM&amp;lt;/code&amp;gt; || no&lt;br /&gt;
|-&lt;br /&gt;
| Current in-tree host Linux stack || yes || not yet the main host path || no&lt;br /&gt;
|-&lt;br /&gt;
| End-to-end USER virtual channel || yes || not yet aligned in-tree || no&lt;br /&gt;
|-&lt;br /&gt;
| Default interface today || yes || no || no&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 3. Device-Side Layers ==&lt;br /&gt;
&lt;br /&gt;
Public headers:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_filter.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Internal layers:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bootstrap/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;core/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;profile/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/wifi/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/sdio/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/usb/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/spi/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Main public APIs:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_bootstrap()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_shutdown()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_get_status()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_set_active_wifi_channel()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_ctrl_upld_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_ctrl_dnld_register()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_vchan_user_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_vchan_user_recv_register()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_set_wifi_rx_filter()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 4. Data-Path ==&lt;br /&gt;
&lt;br /&gt;
The data-path is the main NetHub function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
host payload -&amp;gt; host interface backend -&amp;gt; nethub -&amp;gt; active Wi-Fi endpoint&lt;br /&gt;
Wi-Fi RX     -&amp;gt; nethub filter     -&amp;gt; local / host / both&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Device-side Wi-Fi is already owned by the Wi-Fi backend. NetHub mainly wires the selected host interface to that Wi-Fi backend.&lt;br /&gt;
&lt;br /&gt;
== 5. Control Path ==&lt;br /&gt;
&lt;br /&gt;
NetHub exposes a stable control path facade:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_ctrl_upld_send(uint8_t *data_buff, uint32_t data_size);&lt;br /&gt;
int nethub_ctrl_dnld_register(nethub_ctrl_rx_cb_t dnld_cb, void *cbpri_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That facade is implemented per interface.&lt;br /&gt;
&lt;br /&gt;
Current interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;: implemented in-tree&lt;br /&gt;
* &amp;lt;code&amp;gt;USB&amp;lt;/code&amp;gt;: device-side ACM transport plumbing implemented&lt;br /&gt;
* &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt;: not implemented&lt;br /&gt;
&lt;br /&gt;
Main build-time switches related to this area:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=y&amp;lt;/code&amp;gt;&lt;br /&gt;
** the example enables &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; plus host &amp;lt;code&amp;gt;bflbwifid / bflbwifictrl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; does not participate in the build&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CONFIG_NETHUB_AT_USE_VCHAN&amp;lt;/code&amp;gt; should be documented carefully as an example or legacy SDIO-specific control path convention, not as a finished transport-wide selector.&lt;br /&gt;
&lt;br /&gt;
== 6. Virtual Channel ==&lt;br /&gt;
&lt;br /&gt;
NetHub also exposes a logical virtual channel layer for message-style traffic such as &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;AT&amp;lt;/code&amp;gt;, and internal coordination payloads.&lt;br /&gt;
&lt;br /&gt;
Architecture role:&lt;br /&gt;
&lt;br /&gt;
* device side uses &amp;lt;code&amp;gt;components/net/nethub/include/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* host side uses &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub/virtualchan/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* the API is intentionally transport-neutral across host interfaces&lt;br /&gt;
&lt;br /&gt;
Current implementation boundary:&lt;br /&gt;
&lt;br /&gt;
* the current in-tree end-to-end USER virtual channel path follows the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface&lt;br /&gt;
* the device-side implementation is still centered on the SDIO backend&lt;br /&gt;
* the host userspace &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; library is also SDIO-based today&lt;br /&gt;
* USB device-side ACM transport exists, but the host-side wrapper is not yet aligned as a finished end-to-end virtual channel path&lt;br /&gt;
&lt;br /&gt;
For prerequisites, detailed APIs, usage order, and limits, read [[NetHubVirtualChannel|NetHubVirtualChannel.md]].&lt;br /&gt;
&lt;br /&gt;
== 7. Host-Side Optional Stack ==&lt;br /&gt;
&lt;br /&gt;
When the optional AT control solution is used, the typical host-side stack is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bflbwifictrl -&amp;gt; bflbwifid -&amp;gt; libbflbwifi -&amp;gt; tty or vchan backend&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* this stack is not mandatory for NetHub data-path-only products&lt;br /&gt;
* the in-tree host Linux stack is still centered on the SDIO path&lt;br /&gt;
&lt;br /&gt;
== 8. Low-Power Scope ==&lt;br /&gt;
&lt;br /&gt;
Current low-power support is &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
The example configuration automatically disables &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE&amp;lt;/code&amp;gt; on other chips.&lt;br /&gt;
&lt;br /&gt;
== 9. Recommended Reading ==&lt;br /&gt;
&lt;br /&gt;
* [[NetHub|NetHub.md]]&lt;br /&gt;
* [[NetHubQuickBringup|NetHubQuickBringup.md]]&lt;br /&gt;
* [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubArchitecture&amp;diff=296</id>
		<title>NetHubArchitecture</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubArchitecture&amp;diff=296"/>
		<updated>2026-04-24T17:07:50Z</updated>

		<summary type="html">&lt;p&gt;张良：​Add NetHub architecture diagram to docs (2026-04-25)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub Architecture =&lt;br /&gt;
&lt;br /&gt;
This document summarizes the current NetHub architecture across the device-side module, the optional host control stack, and the current support boundaries.&lt;br /&gt;
&lt;br /&gt;
== 1. High-Level Model ==&lt;br /&gt;
&lt;br /&gt;
NetHub runs on the device and bridges already-available Wi-Fi capability onto one selected host interface.&lt;br /&gt;
&lt;br /&gt;
[[文件:Nethub_arch.gif | NetHub Architecture Overview]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Wi-Fi backend + lwIP&lt;br /&gt;
       |&lt;br /&gt;
       v&lt;br /&gt;
     nethub&lt;br /&gt;
  +-----------+&lt;br /&gt;
  | data-path |&lt;br /&gt;
  | filter    |&lt;br /&gt;
  | ctrlpath  |&lt;br /&gt;
  | vchan     |&lt;br /&gt;
  +-----------+&lt;br /&gt;
       |&lt;br /&gt;
       v&lt;br /&gt;
host interface&lt;br /&gt;
(SDIO / USB / SPI)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important boundary:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub&amp;lt;/code&amp;gt; core does not directly depend on &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; is an optional example consumer of the NetHub control path&lt;br /&gt;
&lt;br /&gt;
== 2. Current Support Matrix ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Area !! SDIO !! USB !! SPI&lt;br /&gt;
|-&lt;br /&gt;
| Device-side interface backend || yes || yes || yes&lt;br /&gt;
|-&lt;br /&gt;
| Device-side data-path || yes || yes, through &amp;lt;code&amp;gt;USB ECM&amp;lt;/code&amp;gt; || no&lt;br /&gt;
|-&lt;br /&gt;
| Device-side control transport plumbing || yes || yes, through &amp;lt;code&amp;gt;USB ACM&amp;lt;/code&amp;gt; || no&lt;br /&gt;
|-&lt;br /&gt;
| Current in-tree host Linux stack || yes || not yet the main host path || no&lt;br /&gt;
|-&lt;br /&gt;
| End-to-end USER virtual channel || yes || not yet aligned in-tree || no&lt;br /&gt;
|-&lt;br /&gt;
| Default interface today || yes || no || no&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 3. Device-Side Layers ==&lt;br /&gt;
&lt;br /&gt;
Public headers:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_filter.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Internal layers:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bootstrap/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;core/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;profile/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/wifi/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/sdio/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/usb/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/spi/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Main public APIs:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_bootstrap()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_shutdown()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_get_status()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_set_active_wifi_channel()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_ctrl_upld_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_ctrl_dnld_register()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_vchan_user_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_vchan_user_recv_register()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_set_wifi_rx_filter()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 4. Data-Path ==&lt;br /&gt;
&lt;br /&gt;
The data-path is the main NetHub function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
host payload -&amp;gt; host interface backend -&amp;gt; nethub -&amp;gt; active Wi-Fi endpoint&lt;br /&gt;
Wi-Fi RX     -&amp;gt; nethub filter     -&amp;gt; local / host / both&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Device-side Wi-Fi is already owned by the Wi-Fi backend. NetHub mainly wires the selected host interface to that Wi-Fi backend.&lt;br /&gt;
&lt;br /&gt;
== 5. Control Path ==&lt;br /&gt;
&lt;br /&gt;
NetHub exposes a stable control path facade:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_ctrl_upld_send(uint8_t *data_buff, uint32_t data_size);&lt;br /&gt;
int nethub_ctrl_dnld_register(nethub_ctrl_rx_cb_t dnld_cb, void *cbpri_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That facade is implemented per interface.&lt;br /&gt;
&lt;br /&gt;
Current interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;: implemented in-tree&lt;br /&gt;
* &amp;lt;code&amp;gt;USB&amp;lt;/code&amp;gt;: device-side ACM transport plumbing implemented&lt;br /&gt;
* &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt;: not implemented&lt;br /&gt;
&lt;br /&gt;
Main build-time switches related to this area:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=y&amp;lt;/code&amp;gt;&lt;br /&gt;
** the example enables &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; plus host &amp;lt;code&amp;gt;bflbwifid / bflbwifictrl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; does not participate in the build&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CONFIG_NETHUB_AT_USE_VCHAN&amp;lt;/code&amp;gt; should be documented carefully as an example or legacy SDIO-specific control path convention, not as a finished transport-wide selector.&lt;br /&gt;
&lt;br /&gt;
== 6. Virtual Channel ==&lt;br /&gt;
&lt;br /&gt;
NetHub also exposes a logical virtual channel API:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_user_send(const void *data, uint16_t len);&lt;br /&gt;
int nethub_vchan_user_recv_register(nethub_vchan_recv_cb_t recv_cb, void *cb_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
API intent:&lt;br /&gt;
&lt;br /&gt;
* stable logical message API across host interfaces&lt;br /&gt;
&lt;br /&gt;
Current implementation:&lt;br /&gt;
&lt;br /&gt;
* the in-tree implementation is still SDIO-backed&lt;br /&gt;
* the host userspace &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; library is also SDIO-based today&lt;br /&gt;
* therefore the current end-to-end USER virtual channel path follows the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface&lt;br /&gt;
&lt;br /&gt;
== 7. Host-Side Optional Stack ==&lt;br /&gt;
&lt;br /&gt;
When the optional AT control solution is used, the typical host-side stack is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bflbwifictrl -&amp;gt; bflbwifid -&amp;gt; libbflbwifi -&amp;gt; tty or vchan backend&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* this stack is not mandatory for NetHub data-path-only products&lt;br /&gt;
* the in-tree host Linux stack is still centered on the SDIO path&lt;br /&gt;
&lt;br /&gt;
== 8. Low-Power Scope ==&lt;br /&gt;
&lt;br /&gt;
Current low-power support is &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
The example configuration automatically disables &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE&amp;lt;/code&amp;gt; on other chips.&lt;br /&gt;
&lt;br /&gt;
== 9. Recommended Reading ==&lt;br /&gt;
&lt;br /&gt;
* [[NetHub|NetHub.md]]&lt;br /&gt;
* [[NetHubQuickBringup|NetHubQuickBringup.md]]&lt;br /&gt;
* [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:Nethub_arch.gif&amp;diff=295</id>
		<title>文件:Nethub arch.gif</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:Nethub_arch.gif&amp;diff=295"/>
		<updated>2026-04-24T17:01:58Z</updated>

		<summary type="html">&lt;p&gt;张良：​张良上传文件:Nethub arch.gif的新版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 摘要 ==&lt;br /&gt;
nethub sdio usb interface arch.&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:Nethub_arch.gif&amp;diff=294</id>
		<title>文件:Nethub arch.gif</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:Nethub_arch.gif&amp;diff=294"/>
		<updated>2026-04-24T16:59:30Z</updated>

		<summary type="html">&lt;p&gt;张良：​张良上传文件:Nethub arch.gif的新版本&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 摘要 ==&lt;br /&gt;
nethub sdio usb interface arch.&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:Nethub_arch.gif&amp;diff=293</id>
		<title>文件:Nethub arch.gif</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:Nethub_arch.gif&amp;diff=293"/>
		<updated>2026-04-24T16:57:51Z</updated>

		<summary type="html">&lt;p&gt;张良：​nethub sdio usb interface arch.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 摘要 ==&lt;br /&gt;
nethub sdio usb interface arch.&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup&amp;diff=292</id>
		<title>NetHubQuickBringup</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup&amp;diff=292"/>
		<updated>2026-04-24T15:11:47Z</updated>

		<summary type="html">&lt;p&gt;张良：​Add more NetHubQuickBringup FAQs (2026-04-24)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub Quick Start =&lt;br /&gt;
&lt;br /&gt;
This document is for customers using NetHub for the first time. The goal is to get you to the current default interface as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
[[文件:Nethub_sdio_quickstart_demo.gif | NetHub SDIO Quick Start Demo]]&lt;br /&gt;
&lt;br /&gt;
== 1. Current Support Matrix ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Item !! Current status&lt;br /&gt;
|-&lt;br /&gt;
| Default interface || &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USB interface || device-side backend implemented with &amp;lt;code&amp;gt;USB ECM + USB ACM&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| SPI interface || not implemented&lt;br /&gt;
|-&lt;br /&gt;
| USER virtual channel || default interface is &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Optional AT control solution || available, but not mandatory&lt;br /&gt;
|-&lt;br /&gt;
| Low power || currently &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Read this table literally:&lt;br /&gt;
&lt;br /&gt;
* if you want the shortest successful path today, choose &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
* if you are evaluating the USB interface, focus on the device-side backend and USB descriptors first&lt;br /&gt;
* do not plan on &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt; bring-up yet&lt;br /&gt;
&lt;br /&gt;
== 2. Main Configuration Switches ==&lt;br /&gt;
&lt;br /&gt;
For most users, the main configuration changes are these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;makefile&amp;quot;&amp;gt;&lt;br /&gt;
CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE =y&lt;br /&gt;
CONFIG_NETHUB_LOWPOWER_ENABLE          =y&lt;br /&gt;
CONFIG_NETHUB_PROFILE_USB              =n&lt;br /&gt;
CONFIG_NETHUB_PROFILE_SDIO             =y&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* the config symbol names still use &amp;lt;code&amp;gt;PROFILE&amp;lt;/code&amp;gt;, but they select the active host interface&lt;br /&gt;
* set &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_SDIO=y&amp;lt;/code&amp;gt; for the current default interface&lt;br /&gt;
* set &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_USB=y&amp;lt;/code&amp;gt; only when you want to evaluate the USB interface&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n&amp;lt;/code&amp;gt; means &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; will not participate in the build&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE=y&amp;lt;/code&amp;gt; is currently meaningful only on &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additional current default facts in &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_AT_USE_VCHAN=n&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MR_TTY=n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3. Wi-Fi Backend Selection ==&lt;br /&gt;
&lt;br /&gt;
Default configuration:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_WL80211&amp;lt;/code&amp;gt; disabled&lt;br /&gt;
* &amp;lt;code&amp;gt;fhost&amp;lt;/code&amp;gt; selected&lt;br /&gt;
&lt;br /&gt;
If you want &amp;lt;code&amp;gt;wl80211&amp;lt;/code&amp;gt;, enable this in &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;makefile&amp;quot;&amp;gt;&lt;br /&gt;
CONFIG_WL80211=y&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fhost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wl80211&amp;lt;/code&amp;gt; are mutually exclusive&lt;br /&gt;
* current NetHub supports both device-side Wi-Fi backends&lt;br /&gt;
&lt;br /&gt;
== 4. Device Build and Flash ==&lt;br /&gt;
&lt;br /&gt;
Build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd examples/wifi/nethub&lt;br /&gt;
&lt;br /&gt;
# BL616&lt;br /&gt;
make CHIP=bl616 BOARD=bl616dk&lt;br /&gt;
&lt;br /&gt;
# BL616CL&lt;br /&gt;
make CHIP=bl616cl BOARD=bl616cldk&lt;br /&gt;
&lt;br /&gt;
# BL618DG&lt;br /&gt;
make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=ap&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flash example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd examples/wifi/nethub&lt;br /&gt;
make flash CHIP=bl618dg COMX=/dev/ttyUSB0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 5. Hardware Interface Pins ==&lt;br /&gt;
&lt;br /&gt;
The pin tables below are the current default mappings used by the in-tree BSP board helpers.&lt;br /&gt;
&lt;br /&gt;
Reference sources in the repository:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/board/bl616dk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/board/bl616cldk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/board/bl618dgdk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 5.1 Default SDIO Pins ===&lt;br /&gt;
&lt;br /&gt;
These are the current &amp;lt;code&amp;gt;board_sdh_gpio_init()&amp;lt;/code&amp;gt; mappings used by the BSP.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin Function !! BL616 / BL618 (&amp;lt;code&amp;gt;bl616dk&amp;lt;/code&amp;gt;) !! BL618DG (&amp;lt;code&amp;gt;bl618dgdk&amp;lt;/code&amp;gt;) !! BL616CL (&amp;lt;code&amp;gt;bl616cldk&amp;lt;/code&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO10&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO43&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO6&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT3&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO11&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO44&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO7&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_CMD&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO12&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO45&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO8&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_CLK&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO13&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO46&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO9&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO14&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO47&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO10&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO15&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO48&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO11&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* this table shows the current default 4-bit SDIO wiring used by the NetHub SDIO data-path&lt;br /&gt;
* 1-line mode is also supported; if you use 1-line mode, keep &amp;lt;code&amp;gt;CMD&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CLK&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;DAT0&amp;lt;/code&amp;gt; first&lt;br /&gt;
* the BSP configures these pins with &amp;lt;code&amp;gt;GPIO_FUNC_SDH | GPIO_ALTERNATE | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 5.2 Default USB Pins ===&lt;br /&gt;
&lt;br /&gt;
The current USB interface uses the board&#039;s default USB differential pair.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Chip / Board family !! Default USB pins in current BSP !! Current BSP behavior !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| BL616 / BL618 (&amp;lt;code&amp;gt;bl616dk&amp;lt;/code&amp;gt;) || board default USB port path || current BSP enables USB clock in &amp;lt;code&amp;gt;board.c&amp;lt;/code&amp;gt;, but does not expose a dedicated &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; helper || treat this as the board&#039;s fixed default USB routing in the current example&lt;br /&gt;
|-&lt;br /&gt;
| BL616CL (&amp;lt;code&amp;gt;bl616cldk&amp;lt;/code&amp;gt;) || &amp;lt;code&amp;gt;GPIO32&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GPIO33&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; configures the pair as analog pins || current BSP documents the pair, not separate &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; labels&lt;br /&gt;
|-&lt;br /&gt;
| BL618DG (&amp;lt;code&amp;gt;bl618dgdk&amp;lt;/code&amp;gt;) || &amp;lt;code&amp;gt;GPIO40&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GPIO41&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; configures the pair as analog pins || current BSP documents the pair, not separate &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; labels&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* for &amp;lt;code&amp;gt;BL616CL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;, the BSP helper only tells us the USB pair used by the board, not which pin is &amp;lt;code&amp;gt;D+&amp;lt;/code&amp;gt; and which pin is &amp;lt;code&amp;gt;D-&amp;lt;/code&amp;gt;&lt;br /&gt;
* if you are wiring a custom board and need explicit &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; polarity, confirm it from the board schematic or chip or package documentation&lt;br /&gt;
&lt;br /&gt;
== 6. Host Bring-Up Guidance ==&lt;br /&gt;
&lt;br /&gt;
For the current in-tree host Linux stack, use:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub/README.md&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Today that host stack follows the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
For USB projects, keep expectations aligned with current code status:&lt;br /&gt;
&lt;br /&gt;
* device-side &amp;lt;code&amp;gt;ECM + ACM&amp;lt;/code&amp;gt; backend exists&lt;br /&gt;
* host-side transport flattening into the same &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; behavior as SDIO is not fully documented or aligned in-tree yet&lt;br /&gt;
&lt;br /&gt;
== 7. USER Virtual Channel ==&lt;br /&gt;
&lt;br /&gt;
If you need private application messages between host and device, read:&lt;br /&gt;
&lt;br /&gt;
* [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;br /&gt;
&lt;br /&gt;
Current implementation:&lt;br /&gt;
&lt;br /&gt;
* the current in-tree end-to-end USER virtual channel follows the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface&lt;br /&gt;
* the public device API is transport-neutral by design&lt;br /&gt;
* the in-tree implementation behind it is still SDIO-backed today&lt;br /&gt;
&lt;br /&gt;
== 8. Low-Power Note ==&lt;br /&gt;
&lt;br /&gt;
Low power is currently supported only on &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For other chips, &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt; automatically turns &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE&amp;lt;/code&amp;gt; off. In practice, you normally keep this option enabled only for &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; builds.&lt;br /&gt;
&lt;br /&gt;
== 9. Common Questions ==&lt;br /&gt;
&lt;br /&gt;
=== 9.1 &amp;lt;code&amp;gt;bflbwifid&amp;lt;/code&amp;gt; Fails to Start ===&lt;br /&gt;
&lt;br /&gt;
This question is relevant only when you use the optional host control stack.&lt;br /&gt;
&lt;br /&gt;
Check first:&lt;br /&gt;
&lt;br /&gt;
* whether the device and host control backends match&lt;br /&gt;
* whether &amp;lt;code&amp;gt;/dev/ttyAT0&amp;lt;/code&amp;gt; exists&lt;br /&gt;
* whether &amp;lt;code&amp;gt;mr_sdio.ko&amp;lt;/code&amp;gt; has been loaded successfully&lt;br /&gt;
* whether the SDIO hardware link is working properly&lt;br /&gt;
&lt;br /&gt;
=== 9.2 &amp;lt;code&amp;gt;connect_ap&amp;lt;/code&amp;gt; Succeeds but the Host Has No Network Access ===&lt;br /&gt;
&lt;br /&gt;
Check first:&lt;br /&gt;
&lt;br /&gt;
* whether &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; has reached &amp;lt;code&amp;gt;GOTIP&amp;lt;/code&amp;gt;&lt;br /&gt;
* whether &amp;lt;code&amp;gt;mr_eth0&amp;lt;/code&amp;gt; has an address&lt;br /&gt;
* whether services such as &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;dhcpcd&amp;lt;/code&amp;gt; override the NetHub configuration&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;build.sh&amp;lt;/code&amp;gt; builds userspace with &amp;lt;code&amp;gt;ENABLE_NETIF_AUTO_CONFIG=1&amp;lt;/code&amp;gt; by default&lt;br /&gt;
* after the device reports &amp;lt;code&amp;gt;GOTIP&amp;lt;/code&amp;gt;, the host automatically configures the IP, gateway, and DNS of &amp;lt;code&amp;gt;mr_eth0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 9.3 &amp;lt;code&amp;gt;build.sh unload&amp;lt;/code&amp;gt; Reports That the Module Is Busy ===&lt;br /&gt;
&lt;br /&gt;
Check first:&lt;br /&gt;
&lt;br /&gt;
* whether &amp;lt;code&amp;gt;bflbwifid&amp;lt;/code&amp;gt; is still running&lt;br /&gt;
* whether &amp;lt;code&amp;gt;nethub_vchan_app&amp;lt;/code&amp;gt; is still running&lt;br /&gt;
&lt;br /&gt;
=== 9.4 How Do I Change the Host-Side Virtual Interface Name &amp;lt;code&amp;gt;mr_eth0&amp;lt;/code&amp;gt;? ===&lt;br /&gt;
&lt;br /&gt;
The default host-side virtual network interface name comes from:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/kernel/netdev/mr_netdev.c&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The macro is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#define ETH_DRV_NAME &amp;quot;mr_eth%d&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first created interface therefore appears as &amp;lt;code&amp;gt;mr_eth0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To change the interface name, update &amp;lt;code&amp;gt;ETH_DRV_NAME&amp;lt;/code&amp;gt; to the pattern you want. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#define ETH_DRV_NAME &amp;quot;nethub%d&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* keep &amp;lt;code&amp;gt;%d&amp;lt;/code&amp;gt; if you want Linux to allocate names such as &amp;lt;code&amp;gt;nethub0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;nethub1&amp;lt;/code&amp;gt;, and so on&lt;br /&gt;
* rebuild the host software after the change and reload the host-side kernel module&lt;br /&gt;
* if any local scripts or service configuration still refer to &amp;lt;code&amp;gt;mr_eth0&amp;lt;/code&amp;gt;, update them accordingly&lt;br /&gt;
&lt;br /&gt;
=== 9.5 Can the Host Expose &amp;lt;code&amp;gt;AP&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;STA&amp;lt;/code&amp;gt; at the Same Time? ===&lt;br /&gt;
&lt;br /&gt;
No. Due to the current software implementation, this is not supported yet.&lt;br /&gt;
&lt;br /&gt;
Current behavior:&lt;br /&gt;
&lt;br /&gt;
* the host side exposes only one virtual interface at a time&lt;br /&gt;
* the default active Wi-Fi channel is &amp;lt;code&amp;gt;STA&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need to switch between &amp;lt;code&amp;gt;AP&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;STA&amp;lt;/code&amp;gt;, call &amp;lt;code&amp;gt;nethub_set_active_wifi_channel()&amp;lt;/code&amp;gt; directly:&lt;br /&gt;
&lt;br /&gt;
* use &amp;lt;code&amp;gt;NETHUB_CHANNEL_WIFI_AP&amp;lt;/code&amp;gt; to switch to &amp;lt;code&amp;gt;AP&amp;lt;/code&amp;gt;&lt;br /&gt;
* use &amp;lt;code&amp;gt;NETHUB_CHANNEL_WIFI_STA&amp;lt;/code&amp;gt; to switch to &amp;lt;code&amp;gt;STA&amp;lt;/code&amp;gt;&lt;br /&gt;
* the default value is &amp;lt;code&amp;gt;NETHUB_CHANNEL_WIFI_STA&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 9.6 What Should the Host Side Handle When &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n&amp;lt;/code&amp;gt;? ===&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n&amp;lt;/code&amp;gt;, the optional AT-based host control solution is not part of the build.&lt;br /&gt;
&lt;br /&gt;
What you need to handle yourself:&lt;br /&gt;
&lt;br /&gt;
* you need your own private control path to carry required messages between host and device&lt;br /&gt;
* this includes, but is not limited to, host netdev link-up handling&lt;br /&gt;
* this also includes host-side IP address and netmask configuration&lt;br /&gt;
&lt;br /&gt;
In short, NetHub still provides the data-path, but the host-side control workflow becomes your own responsibility.&lt;br /&gt;
&lt;br /&gt;
=== 9.7 Why Does &amp;lt;code&amp;gt;ifconfig&amp;lt;/code&amp;gt; Not Show the Virtual Interface? ===&lt;br /&gt;
&lt;br /&gt;
Check first:&lt;br /&gt;
&lt;br /&gt;
* use a command such as &amp;lt;code&amp;gt;ifconfig -a&amp;lt;/code&amp;gt; to list interfaces that are currently down&lt;br /&gt;
* find the virtual interface and bring it up manually, for example: &amp;lt;code&amp;gt;sudo ifconfig mr_eth0 up&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* some Linux systems, including newer Raspberry Pi OS releases, run &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; by default&lt;br /&gt;
* because of that, the exact behavior depends on your host environment and may need host-specific analysis&lt;br /&gt;
&lt;br /&gt;
=== 9.8 For Dual-Stack Traffic, Can Users Customize the Filter? Is There Any Difference Between USB and SDIO? ===&lt;br /&gt;
&lt;br /&gt;
Yes. The default configuration already covers most scenarios, but users can still customize the Wi-Fi RX filter if needed.&lt;br /&gt;
&lt;br /&gt;
Important points:&lt;br /&gt;
&lt;br /&gt;
* the filter is not bound to one interface type; there is no special filter split between &amp;lt;code&amp;gt;USB&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
* the current built-in policy is shared by both &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;USB&amp;lt;/code&amp;gt;&lt;br /&gt;
* you can refer to &amp;lt;code&amp;gt;components/net/nethub/profile/nh_profile_sdio.c&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;components/net/nethub/profile/nh_profile_usb.c&amp;lt;/code&amp;gt;; both use the same built-in Wi-Fi RX policy&lt;br /&gt;
&lt;br /&gt;
Default built-in policy reference:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/profile/nh_profile_builtin.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;NH_FILTER_MATCH_8021X&amp;lt;/code&amp;gt;: handled locally and not delivered to the host&lt;br /&gt;
* &amp;lt;code&amp;gt;NH_FILTER_MATCH_ARP&amp;lt;/code&amp;gt;: handled locally and also delivered to the host&lt;br /&gt;
* &amp;lt;code&amp;gt;NH_FILTER_MATCH_DHCP4&amp;lt;/code&amp;gt;: handled locally&lt;br /&gt;
* &amp;lt;code&amp;gt;NH_FILTER_MATCH_ICMP4&amp;lt;/code&amp;gt;: handled locally&lt;br /&gt;
* other packets: delivered to the host by default&lt;br /&gt;
&lt;br /&gt;
If the default policy does not match your requirement:&lt;br /&gt;
&lt;br /&gt;
* you can call &amp;lt;code&amp;gt;nethub_set_wifi_rx_filter(nethub_wifi_rx_filter_cb_t filter_cb, void *user_ctx)&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;components/net/nethub/include/nethub_filter.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* for the callback behavior, refer to &amp;lt;code&amp;gt;nh_filter_apply_policy()&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;components/net/nethub/core/nh_filter.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* if you need a more complex policy, it is also fine to contact us directly&lt;br /&gt;
&lt;br /&gt;
=== 9.9 Why Can the Host Not Ping Other Devices on the Same LAN? ===&lt;br /&gt;
&lt;br /&gt;
This is expected with the current default policy.&lt;br /&gt;
&lt;br /&gt;
Reason:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ICMP&amp;lt;/code&amp;gt; packets are handled locally on the device side by default&lt;br /&gt;
* they are not delivered to the host by default&lt;br /&gt;
&lt;br /&gt;
So, by default:&lt;br /&gt;
&lt;br /&gt;
* other LAN devices pinging the device can work&lt;br /&gt;
* host-side ping visibility to other LAN devices is not part of the default behavior&lt;br /&gt;
&lt;br /&gt;
== 10. Where to Go Next ==&lt;br /&gt;
&lt;br /&gt;
* overall entry: [[NetHub|NetHub.md]]&lt;br /&gt;
* architecture: [[NetHubArchitecture|NetHubArchitecture.md]]&lt;br /&gt;
* USER virtual channel: [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup&amp;diff=291</id>
		<title>NetHubQuickBringup</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup&amp;diff=291"/>
		<updated>2026-04-24T14:37:57Z</updated>

		<summary type="html">&lt;p&gt;张良：​Restore FAQ and add AP/STA host-interface FAQ (2026-04-24)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub Quick Start =&lt;br /&gt;
&lt;br /&gt;
This document is for customers using NetHub for the first time. The goal is to get you to the current default interface as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
[[文件:Nethub_sdio_quickstart_demo.gif | NetHub SDIO Quick Start Demo]]&lt;br /&gt;
&lt;br /&gt;
== 1. Current Support Matrix ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Item !! Current status&lt;br /&gt;
|-&lt;br /&gt;
| Default interface || &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USB interface || device-side backend implemented with &amp;lt;code&amp;gt;USB ECM + USB ACM&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| SPI interface || not implemented&lt;br /&gt;
|-&lt;br /&gt;
| USER virtual channel || default interface is &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Optional AT control solution || available, but not mandatory&lt;br /&gt;
|-&lt;br /&gt;
| Low power || currently &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Read this table literally:&lt;br /&gt;
&lt;br /&gt;
* if you want the shortest successful path today, choose &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
* if you are evaluating the USB interface, focus on the device-side backend and USB descriptors first&lt;br /&gt;
* do not plan on &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt; bring-up yet&lt;br /&gt;
&lt;br /&gt;
== 2. Main Configuration Switches ==&lt;br /&gt;
&lt;br /&gt;
For most users, the main configuration changes are these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;makefile&amp;quot;&amp;gt;&lt;br /&gt;
CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE =y&lt;br /&gt;
CONFIG_NETHUB_LOWPOWER_ENABLE          =y&lt;br /&gt;
CONFIG_NETHUB_PROFILE_USB              =n&lt;br /&gt;
CONFIG_NETHUB_PROFILE_SDIO             =y&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* the config symbol names still use &amp;lt;code&amp;gt;PROFILE&amp;lt;/code&amp;gt;, but they select the active host interface&lt;br /&gt;
* set &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_SDIO=y&amp;lt;/code&amp;gt; for the current default interface&lt;br /&gt;
* set &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_USB=y&amp;lt;/code&amp;gt; only when you want to evaluate the USB interface&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n&amp;lt;/code&amp;gt; means &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; will not participate in the build&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE=y&amp;lt;/code&amp;gt; is currently meaningful only on &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additional current default facts in &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_AT_USE_VCHAN=n&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MR_TTY=n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3. Wi-Fi Backend Selection ==&lt;br /&gt;
&lt;br /&gt;
Default configuration:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_WL80211&amp;lt;/code&amp;gt; disabled&lt;br /&gt;
* &amp;lt;code&amp;gt;fhost&amp;lt;/code&amp;gt; selected&lt;br /&gt;
&lt;br /&gt;
If you want &amp;lt;code&amp;gt;wl80211&amp;lt;/code&amp;gt;, enable this in &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;makefile&amp;quot;&amp;gt;&lt;br /&gt;
CONFIG_WL80211=y&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fhost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wl80211&amp;lt;/code&amp;gt; are mutually exclusive&lt;br /&gt;
* current NetHub supports both device-side Wi-Fi backends&lt;br /&gt;
&lt;br /&gt;
== 4. Device Build and Flash ==&lt;br /&gt;
&lt;br /&gt;
Build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd examples/wifi/nethub&lt;br /&gt;
&lt;br /&gt;
# BL616&lt;br /&gt;
make CHIP=bl616 BOARD=bl616dk&lt;br /&gt;
&lt;br /&gt;
# BL616CL&lt;br /&gt;
make CHIP=bl616cl BOARD=bl616cldk&lt;br /&gt;
&lt;br /&gt;
# BL618DG&lt;br /&gt;
make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=ap&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flash example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd examples/wifi/nethub&lt;br /&gt;
make flash CHIP=bl618dg COMX=/dev/ttyUSB0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 5. Hardware Interface Pins ==&lt;br /&gt;
&lt;br /&gt;
The pin tables below are the current default mappings used by the in-tree BSP board helpers.&lt;br /&gt;
&lt;br /&gt;
Reference sources in the repository:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/board/bl616dk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/board/bl616cldk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/board/bl618dgdk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 5.1 Default SDIO Pins ===&lt;br /&gt;
&lt;br /&gt;
These are the current &amp;lt;code&amp;gt;board_sdh_gpio_init()&amp;lt;/code&amp;gt; mappings used by the BSP.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin Function !! BL616 / BL618 (&amp;lt;code&amp;gt;bl616dk&amp;lt;/code&amp;gt;) !! BL618DG (&amp;lt;code&amp;gt;bl618dgdk&amp;lt;/code&amp;gt;) !! BL616CL (&amp;lt;code&amp;gt;bl616cldk&amp;lt;/code&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO10&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO43&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO6&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT3&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO11&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO44&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO7&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_CMD&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO12&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO45&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO8&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_CLK&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO13&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO46&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO9&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO14&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO47&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO10&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO15&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO48&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO11&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* this table shows the current default 4-bit SDIO wiring used by the NetHub SDIO data-path&lt;br /&gt;
* 1-line mode is also supported; if you use 1-line mode, keep &amp;lt;code&amp;gt;CMD&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CLK&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;DAT0&amp;lt;/code&amp;gt; first&lt;br /&gt;
* the BSP configures these pins with &amp;lt;code&amp;gt;GPIO_FUNC_SDH | GPIO_ALTERNATE | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 5.2 Default USB Pins ===&lt;br /&gt;
&lt;br /&gt;
The current USB interface uses the board&#039;s default USB differential pair.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Chip / Board family !! Default USB pins in current BSP !! Current BSP behavior !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| BL616 / BL618 (&amp;lt;code&amp;gt;bl616dk&amp;lt;/code&amp;gt;) || board default USB port path || current BSP enables USB clock in &amp;lt;code&amp;gt;board.c&amp;lt;/code&amp;gt;, but does not expose a dedicated &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; helper || treat this as the board&#039;s fixed default USB routing in the current example&lt;br /&gt;
|-&lt;br /&gt;
| BL616CL (&amp;lt;code&amp;gt;bl616cldk&amp;lt;/code&amp;gt;) || &amp;lt;code&amp;gt;GPIO32&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GPIO33&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; configures the pair as analog pins || current BSP documents the pair, not separate &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; labels&lt;br /&gt;
|-&lt;br /&gt;
| BL618DG (&amp;lt;code&amp;gt;bl618dgdk&amp;lt;/code&amp;gt;) || &amp;lt;code&amp;gt;GPIO40&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GPIO41&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; configures the pair as analog pins || current BSP documents the pair, not separate &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; labels&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* for &amp;lt;code&amp;gt;BL616CL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;, the BSP helper only tells us the USB pair used by the board, not which pin is &amp;lt;code&amp;gt;D+&amp;lt;/code&amp;gt; and which pin is &amp;lt;code&amp;gt;D-&amp;lt;/code&amp;gt;&lt;br /&gt;
* if you are wiring a custom board and need explicit &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; polarity, confirm it from the board schematic or chip or package documentation&lt;br /&gt;
&lt;br /&gt;
== 6. Host Bring-Up Guidance ==&lt;br /&gt;
&lt;br /&gt;
For the current in-tree host Linux stack, use:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub/README.md&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Today that host stack follows the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
For USB projects, keep expectations aligned with current code status:&lt;br /&gt;
&lt;br /&gt;
* device-side &amp;lt;code&amp;gt;ECM + ACM&amp;lt;/code&amp;gt; backend exists&lt;br /&gt;
* host-side transport flattening into the same &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; behavior as SDIO is not fully documented or aligned in-tree yet&lt;br /&gt;
&lt;br /&gt;
== 7. USER Virtual Channel ==&lt;br /&gt;
&lt;br /&gt;
If you need private application messages between host and device, read:&lt;br /&gt;
&lt;br /&gt;
* [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;br /&gt;
&lt;br /&gt;
Current implementation:&lt;br /&gt;
&lt;br /&gt;
* the current in-tree end-to-end USER virtual channel follows the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface&lt;br /&gt;
* the public device API is transport-neutral by design&lt;br /&gt;
* the in-tree implementation behind it is still SDIO-backed today&lt;br /&gt;
&lt;br /&gt;
== 8. Low-Power Note ==&lt;br /&gt;
&lt;br /&gt;
Low power is currently supported only on &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For other chips, &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt; automatically turns &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE&amp;lt;/code&amp;gt; off. In practice, you normally keep this option enabled only for &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; builds.&lt;br /&gt;
&lt;br /&gt;
== 9. Common Questions ==&lt;br /&gt;
&lt;br /&gt;
=== 9.1 &amp;lt;code&amp;gt;bflbwifid&amp;lt;/code&amp;gt; Fails to Start ===&lt;br /&gt;
&lt;br /&gt;
This question is relevant only when you use the optional host control stack.&lt;br /&gt;
&lt;br /&gt;
Check first:&lt;br /&gt;
&lt;br /&gt;
* whether the device and host control backends match&lt;br /&gt;
* whether &amp;lt;code&amp;gt;/dev/ttyAT0&amp;lt;/code&amp;gt; exists&lt;br /&gt;
* whether &amp;lt;code&amp;gt;mr_sdio.ko&amp;lt;/code&amp;gt; has been loaded successfully&lt;br /&gt;
* whether the SDIO hardware link is working properly&lt;br /&gt;
&lt;br /&gt;
=== 9.2 &amp;lt;code&amp;gt;connect_ap&amp;lt;/code&amp;gt; Succeeds but the Host Has No Network Access ===&lt;br /&gt;
&lt;br /&gt;
Check first:&lt;br /&gt;
&lt;br /&gt;
* whether &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; has reached &amp;lt;code&amp;gt;GOTIP&amp;lt;/code&amp;gt;&lt;br /&gt;
* whether &amp;lt;code&amp;gt;mr_eth0&amp;lt;/code&amp;gt; has an address&lt;br /&gt;
* whether services such as &amp;lt;code&amp;gt;NetworkManager&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;dhcpcd&amp;lt;/code&amp;gt; override the NetHub configuration&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;build.sh&amp;lt;/code&amp;gt; builds userspace with &amp;lt;code&amp;gt;ENABLE_NETIF_AUTO_CONFIG=1&amp;lt;/code&amp;gt; by default&lt;br /&gt;
* after the device reports &amp;lt;code&amp;gt;GOTIP&amp;lt;/code&amp;gt;, the host automatically configures the IP, gateway, and DNS of &amp;lt;code&amp;gt;mr_eth0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 9.3 &amp;lt;code&amp;gt;build.sh unload&amp;lt;/code&amp;gt; Reports That the Module Is Busy ===&lt;br /&gt;
&lt;br /&gt;
Check first:&lt;br /&gt;
&lt;br /&gt;
* whether &amp;lt;code&amp;gt;bflbwifid&amp;lt;/code&amp;gt; is still running&lt;br /&gt;
* whether &amp;lt;code&amp;gt;nethub_vchan_app&amp;lt;/code&amp;gt; is still running&lt;br /&gt;
&lt;br /&gt;
=== 9.4 How Do I Change the Host-Side Virtual Interface Name &amp;lt;code&amp;gt;mr_eth0&amp;lt;/code&amp;gt;? ===&lt;br /&gt;
&lt;br /&gt;
The default host-side virtual network interface name comes from:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/kernel/netdev/mr_netdev.c&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The macro is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#define ETH_DRV_NAME &amp;quot;mr_eth%d&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first created interface therefore appears as &amp;lt;code&amp;gt;mr_eth0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To change the interface name, update &amp;lt;code&amp;gt;ETH_DRV_NAME&amp;lt;/code&amp;gt; to the pattern you want. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#define ETH_DRV_NAME &amp;quot;nethub%d&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* keep &amp;lt;code&amp;gt;%d&amp;lt;/code&amp;gt; if you want Linux to allocate names such as &amp;lt;code&amp;gt;nethub0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;nethub1&amp;lt;/code&amp;gt;, and so on&lt;br /&gt;
* rebuild the host software after the change and reload the host-side kernel module&lt;br /&gt;
* if any local scripts or service configuration still refer to &amp;lt;code&amp;gt;mr_eth0&amp;lt;/code&amp;gt;, update them accordingly&lt;br /&gt;
&lt;br /&gt;
=== 9.5 Can the Host Expose &amp;lt;code&amp;gt;AP&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;STA&amp;lt;/code&amp;gt; at the Same Time? ===&lt;br /&gt;
&lt;br /&gt;
No. Due to the current software implementation, this is not supported yet.&lt;br /&gt;
&lt;br /&gt;
Current behavior:&lt;br /&gt;
&lt;br /&gt;
* the host side exposes only one virtual interface at a time&lt;br /&gt;
* the default active Wi-Fi channel is &amp;lt;code&amp;gt;STA&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need to switch between &amp;lt;code&amp;gt;AP&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;STA&amp;lt;/code&amp;gt;, call &amp;lt;code&amp;gt;nethub_set_active_wifi_channel()&amp;lt;/code&amp;gt; directly:&lt;br /&gt;
&lt;br /&gt;
* use &amp;lt;code&amp;gt;NETHUB_CHANNEL_WIFI_AP&amp;lt;/code&amp;gt; to switch to &amp;lt;code&amp;gt;AP&amp;lt;/code&amp;gt;&lt;br /&gt;
* use &amp;lt;code&amp;gt;NETHUB_CHANNEL_WIFI_STA&amp;lt;/code&amp;gt; to switch to &amp;lt;code&amp;gt;STA&amp;lt;/code&amp;gt;&lt;br /&gt;
* the default value is &amp;lt;code&amp;gt;NETHUB_CHANNEL_WIFI_STA&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 10. Where to Go Next ==&lt;br /&gt;
&lt;br /&gt;
* overall entry: [[NetHub|NetHub.md]]&lt;br /&gt;
* architecture: [[NetHubArchitecture|NetHubArchitecture.md]]&lt;br /&gt;
* USER virtual channel: [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubVirtualChannel&amp;diff=290</id>
		<title>NetHubVirtualChannel</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubVirtualChannel&amp;diff=290"/>
		<updated>2026-04-24T14:27:37Z</updated>

		<summary type="html">&lt;p&gt;张良：​Unify tone and terminology across NetHub docs (2026-04-24)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub USER Virtual Channel =&lt;br /&gt;
&lt;br /&gt;
This document describes the current NetHub USER virtual channel support.&lt;br /&gt;
&lt;br /&gt;
== 1. Concept ==&lt;br /&gt;
&lt;br /&gt;
USER virtual channel is a logical message channel carried on the active host interface.&lt;br /&gt;
&lt;br /&gt;
It is not a separate physical interface. The public API is transport-neutral, while the current in-tree implementation is still centered on the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
Common logical types:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt; || private customer or application data&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;AT&amp;lt;/code&amp;gt; || control payloads&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt; || internal coordination messages&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 2. Current Support Status ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Area !! Current status&lt;br /&gt;
|-&lt;br /&gt;
| Device API surface || transport-neutral by design&lt;br /&gt;
|-&lt;br /&gt;
| Device in-tree implementation || currently in &amp;lt;code&amp;gt;backend/host/sdio/virtualchan.c&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Host userspace library || currently aligned with &amp;lt;code&amp;gt;mr_sdio.ko + netlink&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Default interface for the current in-tree USER virtual channel path || &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USB || device-side ACM transport exists, but in-tree host &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; alignment is not finished&lt;br /&gt;
|-&lt;br /&gt;
| SPI || not supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 3. Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Before using the current in-tree USER virtual channel path, confirm:&lt;br /&gt;
&lt;br /&gt;
* device side is built with &amp;lt;code&amp;gt;CONFIG_NETHUB=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* device side enables &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* the selected bring-up path uses the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface&lt;br /&gt;
* host side has loaded &amp;lt;code&amp;gt;mr_sdio.ko&amp;lt;/code&amp;gt;&lt;br /&gt;
* the host-device link is already working&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* USER and AT are parallel logical channels&lt;br /&gt;
* customer private data should stay on the &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt; type&lt;br /&gt;
* documentation should not describe USB and SPI as if they already share a finished end-to-end virtual channel stack&lt;br /&gt;
&lt;br /&gt;
== 4. Device-Side API ==&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Common APIs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_user_send(const void *data, uint16_t len);&lt;br /&gt;
int nethub_vchan_user_recv_register(nethub_vchan_recv_cb_t recv_cb, void *cb_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 5. Host-Side API ==&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub/virtualchan/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initialization and cleanup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_init(void);&lt;br /&gt;
int nethub_vchan_deinit(void);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
USER channel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
typedef void (*nethub_vchan_recv_callback_t)(const void *data, size_t len);&lt;br /&gt;
&lt;br /&gt;
int nethub_vchan_user_send(const void *data, size_t len);&lt;br /&gt;
int nethub_vchan_user_register_callback(nethub_vchan_recv_callback_t callback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optional state query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct {&lt;br /&gt;
    nethub_vchan_link_state_t link_state;&lt;br /&gt;
    nethub_vchan_host_state_t host_state;&lt;br /&gt;
} nethub_vchan_state_snapshot_t;&lt;br /&gt;
&lt;br /&gt;
int nethub_vchan_get_state_snapshot(nethub_vchan_state_snapshot_t *snapshot);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optional link event callback:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_register_link_event_callback(&lt;br /&gt;
    nethub_vchan_link_event_callback_t callback,&lt;br /&gt;
    void *user_data);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 6. Typical Usage Order ==&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;nethub_vchan_init()&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;nethub_vchan_user_register_callback()&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;nethub_vchan_user_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;nethub_vchan_deinit()&amp;lt;/code&amp;gt; when finished&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;nethub_vchan.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
static void user_rx_cb(const void *data, size_t len)&lt;br /&gt;
{&lt;br /&gt;
    printf(&amp;quot;recv USER data: %.*s\n&amp;quot;, (int)len, (const char *)data);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
    const char *msg = &amp;quot;hello from host&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    if (nethub_vchan_init() != 0) {&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    nethub_vchan_user_register_callback(user_rx_cb);&lt;br /&gt;
    nethub_vchan_user_send(msg, strlen(msg));&lt;br /&gt;
&lt;br /&gt;
    nethub_vchan_deinit();&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 7. Limits and Notes ==&lt;br /&gt;
&lt;br /&gt;
* maximum payload length per message is &amp;lt;code&amp;gt;1500&amp;lt;/code&amp;gt; bytes&lt;br /&gt;
* USER virtual channel is packet-oriented, not a byte stream&lt;br /&gt;
* the current in-tree end-to-end path is SDIO-based&lt;br /&gt;
* if the device side does not enable &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN&amp;lt;/code&amp;gt;, the current in-tree USER virtual channel path will not work&lt;br /&gt;
* if control traffic and USER traffic coexist, keep private application traffic on &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt; and do not reuse the &amp;lt;code&amp;gt;AT&amp;lt;/code&amp;gt; type&lt;br /&gt;
&lt;br /&gt;
== 8. Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[NetHub|NetHub.md]]&lt;br /&gt;
* [[NetHubQuickBringup|NetHubQuickBringup.md]]&lt;br /&gt;
* [[NetHubArchitecture|NetHubArchitecture.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubArchitecture&amp;diff=289</id>
		<title>NetHubArchitecture</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubArchitecture&amp;diff=289"/>
		<updated>2026-04-24T14:27:34Z</updated>

		<summary type="html">&lt;p&gt;张良：​Unify tone and terminology across NetHub docs (2026-04-24)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub Architecture =&lt;br /&gt;
&lt;br /&gt;
This document summarizes the current NetHub architecture across the device-side module, the optional host control stack, and the current support boundaries.&lt;br /&gt;
&lt;br /&gt;
== 1. High-Level Model ==&lt;br /&gt;
&lt;br /&gt;
NetHub runs on the device and bridges already-available Wi-Fi capability onto one selected host interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Wi-Fi backend + lwIP&lt;br /&gt;
       |&lt;br /&gt;
       v&lt;br /&gt;
     nethub&lt;br /&gt;
  +-----------+&lt;br /&gt;
  | data-path |&lt;br /&gt;
  | filter    |&lt;br /&gt;
  | ctrlpath  |&lt;br /&gt;
  | vchan     |&lt;br /&gt;
  +-----------+&lt;br /&gt;
       |&lt;br /&gt;
       v&lt;br /&gt;
host interface&lt;br /&gt;
(SDIO / USB / SPI)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important boundary:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub&amp;lt;/code&amp;gt; core does not directly depend on &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; is an optional example consumer of the NetHub control path&lt;br /&gt;
&lt;br /&gt;
== 2. Current Support Matrix ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Area !! SDIO !! USB !! SPI&lt;br /&gt;
|-&lt;br /&gt;
| Device-side interface backend || yes || yes || yes&lt;br /&gt;
|-&lt;br /&gt;
| Device-side data-path || yes || yes, through &amp;lt;code&amp;gt;USB ECM&amp;lt;/code&amp;gt; || no&lt;br /&gt;
|-&lt;br /&gt;
| Device-side control transport plumbing || yes || yes, through &amp;lt;code&amp;gt;USB ACM&amp;lt;/code&amp;gt; || no&lt;br /&gt;
|-&lt;br /&gt;
| Current in-tree host Linux stack || yes || not yet the main host path || no&lt;br /&gt;
|-&lt;br /&gt;
| End-to-end USER virtual channel || yes || not yet aligned in-tree || no&lt;br /&gt;
|-&lt;br /&gt;
| Default interface today || yes || no || no&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 3. Device-Side Layers ==&lt;br /&gt;
&lt;br /&gt;
Public headers:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_filter.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Internal layers:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bootstrap/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;core/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;profile/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/wifi/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/sdio/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/usb/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/spi/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Main public APIs:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_bootstrap()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_shutdown()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_get_status()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_set_active_wifi_channel()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_ctrl_upld_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_ctrl_dnld_register()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_vchan_user_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_vchan_user_recv_register()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_set_wifi_rx_filter()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 4. Data-Path ==&lt;br /&gt;
&lt;br /&gt;
The data-path is the main NetHub function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
host payload -&amp;gt; host interface backend -&amp;gt; nethub -&amp;gt; active Wi-Fi endpoint&lt;br /&gt;
Wi-Fi RX     -&amp;gt; nethub filter     -&amp;gt; local / host / both&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Device-side Wi-Fi is already owned by the Wi-Fi backend. NetHub mainly wires the selected host interface to that Wi-Fi backend.&lt;br /&gt;
&lt;br /&gt;
== 5. Control Path ==&lt;br /&gt;
&lt;br /&gt;
NetHub exposes a stable control path facade:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_ctrl_upld_send(uint8_t *data_buff, uint32_t data_size);&lt;br /&gt;
int nethub_ctrl_dnld_register(nethub_ctrl_rx_cb_t dnld_cb, void *cbpri_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That facade is implemented per interface.&lt;br /&gt;
&lt;br /&gt;
Current interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;: implemented in-tree&lt;br /&gt;
* &amp;lt;code&amp;gt;USB&amp;lt;/code&amp;gt;: device-side ACM transport plumbing implemented&lt;br /&gt;
* &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt;: not implemented&lt;br /&gt;
&lt;br /&gt;
Main build-time switches related to this area:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=y&amp;lt;/code&amp;gt;&lt;br /&gt;
** the example enables &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; plus host &amp;lt;code&amp;gt;bflbwifid / bflbwifictrl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; does not participate in the build&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CONFIG_NETHUB_AT_USE_VCHAN&amp;lt;/code&amp;gt; should be documented carefully as an example or legacy SDIO-specific control path convention, not as a finished transport-wide selector.&lt;br /&gt;
&lt;br /&gt;
== 6. Virtual Channel ==&lt;br /&gt;
&lt;br /&gt;
NetHub also exposes a logical virtual channel API:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_user_send(const void *data, uint16_t len);&lt;br /&gt;
int nethub_vchan_user_recv_register(nethub_vchan_recv_cb_t recv_cb, void *cb_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
API intent:&lt;br /&gt;
&lt;br /&gt;
* stable logical message API across host interfaces&lt;br /&gt;
&lt;br /&gt;
Current implementation:&lt;br /&gt;
&lt;br /&gt;
* the in-tree implementation is still SDIO-backed&lt;br /&gt;
* the host userspace &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; library is also SDIO-based today&lt;br /&gt;
* therefore the current end-to-end USER virtual channel path follows the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface&lt;br /&gt;
&lt;br /&gt;
== 7. Host-Side Optional Stack ==&lt;br /&gt;
&lt;br /&gt;
When the optional AT control solution is used, the typical host-side stack is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bflbwifictrl -&amp;gt; bflbwifid -&amp;gt; libbflbwifi -&amp;gt; tty or vchan backend&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* this stack is not mandatory for NetHub data-path-only products&lt;br /&gt;
* the in-tree host Linux stack is still centered on the SDIO path&lt;br /&gt;
&lt;br /&gt;
== 8. Low-Power Scope ==&lt;br /&gt;
&lt;br /&gt;
Current low-power support is &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
The example configuration automatically disables &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE&amp;lt;/code&amp;gt; on other chips.&lt;br /&gt;
&lt;br /&gt;
== 9. Recommended Reading ==&lt;br /&gt;
&lt;br /&gt;
* [[NetHub|NetHub.md]]&lt;br /&gt;
* [[NetHubQuickBringup|NetHubQuickBringup.md]]&lt;br /&gt;
* [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup&amp;diff=288</id>
		<title>NetHubQuickBringup</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup&amp;diff=288"/>
		<updated>2026-04-24T14:27:32Z</updated>

		<summary type="html">&lt;p&gt;张良：​Unify tone and terminology across NetHub docs (2026-04-24)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub Quick Start =&lt;br /&gt;
&lt;br /&gt;
This document is for customers using NetHub for the first time. The goal is to get you to the current default interface as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
[[文件:Nethub_sdio_quickstart_demo.gif | NetHub SDIO Quick Start Demo]]&lt;br /&gt;
&lt;br /&gt;
== 1. Current Support Matrix ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Item !! Current status&lt;br /&gt;
|-&lt;br /&gt;
| Default interface || &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USB interface || device-side backend implemented with &amp;lt;code&amp;gt;USB ECM + USB ACM&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| SPI interface || not implemented&lt;br /&gt;
|-&lt;br /&gt;
| USER virtual channel || default interface is &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Optional AT control solution || available, but not mandatory&lt;br /&gt;
|-&lt;br /&gt;
| Low power || currently &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Read this table literally:&lt;br /&gt;
&lt;br /&gt;
* if you want the shortest successful path today, choose &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
* if you are evaluating the USB interface, focus on the device-side backend and USB descriptors first&lt;br /&gt;
* do not plan on &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt; bring-up yet&lt;br /&gt;
&lt;br /&gt;
== 2. Main Configuration Switches ==&lt;br /&gt;
&lt;br /&gt;
For most users, the main configuration changes are these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;makefile&amp;quot;&amp;gt;&lt;br /&gt;
CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE =y&lt;br /&gt;
CONFIG_NETHUB_LOWPOWER_ENABLE          =y&lt;br /&gt;
CONFIG_NETHUB_PROFILE_USB              =n&lt;br /&gt;
CONFIG_NETHUB_PROFILE_SDIO             =y&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* the config symbol names still use &amp;lt;code&amp;gt;PROFILE&amp;lt;/code&amp;gt;, but they select the active host interface&lt;br /&gt;
* set &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_SDIO=y&amp;lt;/code&amp;gt; for the current default interface&lt;br /&gt;
* set &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_USB=y&amp;lt;/code&amp;gt; only when you want to evaluate the USB interface&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n&amp;lt;/code&amp;gt; means &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; will not participate in the build&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE=y&amp;lt;/code&amp;gt; is currently meaningful only on &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additional current default facts in &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_AT_USE_VCHAN=n&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MR_TTY=n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3. Wi-Fi Backend Selection ==&lt;br /&gt;
&lt;br /&gt;
Default configuration:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_WL80211&amp;lt;/code&amp;gt; disabled&lt;br /&gt;
* &amp;lt;code&amp;gt;fhost&amp;lt;/code&amp;gt; selected&lt;br /&gt;
&lt;br /&gt;
If you want &amp;lt;code&amp;gt;wl80211&amp;lt;/code&amp;gt;, enable this in &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;makefile&amp;quot;&amp;gt;&lt;br /&gt;
CONFIG_WL80211=y&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fhost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wl80211&amp;lt;/code&amp;gt; are mutually exclusive&lt;br /&gt;
* current NetHub supports both device-side Wi-Fi backends&lt;br /&gt;
&lt;br /&gt;
== 4. Device Build and Flash ==&lt;br /&gt;
&lt;br /&gt;
Build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd examples/wifi/nethub&lt;br /&gt;
&lt;br /&gt;
# BL616&lt;br /&gt;
make CHIP=bl616 BOARD=bl616dk&lt;br /&gt;
&lt;br /&gt;
# BL616CL&lt;br /&gt;
make CHIP=bl616cl BOARD=bl616cldk&lt;br /&gt;
&lt;br /&gt;
# BL618DG&lt;br /&gt;
make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=ap&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flash example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd examples/wifi/nethub&lt;br /&gt;
make flash CHIP=bl618dg COMX=/dev/ttyUSB0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 5. Hardware Interface Pins ==&lt;br /&gt;
&lt;br /&gt;
The pin tables below are the current default mappings used by the in-tree BSP board helpers.&lt;br /&gt;
&lt;br /&gt;
Reference sources in the repository:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/board/bl616dk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/board/bl616cldk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/board/bl618dgdk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 5.1 Default SDIO Pins ===&lt;br /&gt;
&lt;br /&gt;
These are the current &amp;lt;code&amp;gt;board_sdh_gpio_init()&amp;lt;/code&amp;gt; mappings used by the BSP.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin Function !! BL616 / BL618 (&amp;lt;code&amp;gt;bl616dk&amp;lt;/code&amp;gt;) !! BL618DG (&amp;lt;code&amp;gt;bl618dgdk&amp;lt;/code&amp;gt;) !! BL616CL (&amp;lt;code&amp;gt;bl616cldk&amp;lt;/code&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO10&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO43&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO6&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT3&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO11&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO44&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO7&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_CMD&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO12&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO45&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO8&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_CLK&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO13&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO46&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO9&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO14&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO47&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO10&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO15&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO48&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO11&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* this table shows the current default 4-bit SDIO wiring used by the NetHub SDIO data-path&lt;br /&gt;
* 1-line mode is also supported; if you use 1-line mode, keep &amp;lt;code&amp;gt;CMD&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CLK&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;DAT0&amp;lt;/code&amp;gt; first&lt;br /&gt;
* the BSP configures these pins with &amp;lt;code&amp;gt;GPIO_FUNC_SDH | GPIO_ALTERNATE | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 5.2 Default USB Pins ===&lt;br /&gt;
&lt;br /&gt;
The current USB interface uses the board&#039;s default USB differential pair.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Chip / Board family !! Default USB pins in current BSP !! Current BSP behavior !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| BL616 / BL618 (&amp;lt;code&amp;gt;bl616dk&amp;lt;/code&amp;gt;) || board default USB port path || current BSP enables USB clock in &amp;lt;code&amp;gt;board.c&amp;lt;/code&amp;gt;, but does not expose a dedicated &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; helper || treat this as the board&#039;s fixed default USB routing in the current example&lt;br /&gt;
|-&lt;br /&gt;
| BL616CL (&amp;lt;code&amp;gt;bl616cldk&amp;lt;/code&amp;gt;) || &amp;lt;code&amp;gt;GPIO32&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GPIO33&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; configures the pair as analog pins || current BSP documents the pair, not separate &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; labels&lt;br /&gt;
|-&lt;br /&gt;
| BL618DG (&amp;lt;code&amp;gt;bl618dgdk&amp;lt;/code&amp;gt;) || &amp;lt;code&amp;gt;GPIO40&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GPIO41&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; configures the pair as analog pins || current BSP documents the pair, not separate &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; labels&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* for &amp;lt;code&amp;gt;BL616CL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;, the BSP helper only tells us the USB pair used by the board, not which pin is &amp;lt;code&amp;gt;D+&amp;lt;/code&amp;gt; and which pin is &amp;lt;code&amp;gt;D-&amp;lt;/code&amp;gt;&lt;br /&gt;
* if you are wiring a custom board and need explicit &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; polarity, confirm it from the board schematic or chip or package documentation&lt;br /&gt;
&lt;br /&gt;
== 6. Host Bring-Up Guidance ==&lt;br /&gt;
&lt;br /&gt;
For the current in-tree host Linux stack, use:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub/README.md&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Today that host stack follows the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface.&lt;br /&gt;
&lt;br /&gt;
For USB projects, keep expectations aligned with current code status:&lt;br /&gt;
&lt;br /&gt;
* device-side &amp;lt;code&amp;gt;ECM + ACM&amp;lt;/code&amp;gt; backend exists&lt;br /&gt;
* host-side transport flattening into the same &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; behavior as SDIO is not fully documented or aligned in-tree yet&lt;br /&gt;
&lt;br /&gt;
== 7. USER Virtual Channel ==&lt;br /&gt;
&lt;br /&gt;
If you need private application messages between host and device, read:&lt;br /&gt;
&lt;br /&gt;
* [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;br /&gt;
&lt;br /&gt;
Current implementation:&lt;br /&gt;
&lt;br /&gt;
* the current in-tree end-to-end USER virtual channel follows the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface&lt;br /&gt;
* the public device API is transport-neutral by design&lt;br /&gt;
* the in-tree implementation behind it is still SDIO-backed today&lt;br /&gt;
&lt;br /&gt;
== 8. Low-Power Note ==&lt;br /&gt;
&lt;br /&gt;
Low power is currently supported only on &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For other chips, &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt; automatically turns &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE&amp;lt;/code&amp;gt; off. In practice, you normally keep this option enabled only for &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; builds.&lt;br /&gt;
&lt;br /&gt;
== 9. Where to Go Next ==&lt;br /&gt;
&lt;br /&gt;
* overall entry: [[NetHub|NetHub.md]]&lt;br /&gt;
* architecture: [[NetHubArchitecture|NetHubArchitecture.md]]&lt;br /&gt;
* USER virtual channel: [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHub&amp;diff=287</id>
		<title>NetHub</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHub&amp;diff=287"/>
		<updated>2026-04-24T14:27:32Z</updated>

		<summary type="html">&lt;p&gt;张良：​Unify tone and terminology across NetHub docs (2026-04-24)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub =&lt;br /&gt;
&lt;br /&gt;
NetHub bridges device-side Wi-Fi capability to a selected host interface.&lt;br /&gt;
&lt;br /&gt;
The current solution targets Wi-Fi SoCs such as &amp;lt;code&amp;gt;BL616 / BL618 / BL616CL / BL618DG&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Current Status ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Item !! Current status&lt;br /&gt;
|-&lt;br /&gt;
| Default interface || &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USB data-path || device-side &amp;lt;code&amp;gt;USB ECM&amp;lt;/code&amp;gt; backend implemented&lt;br /&gt;
|-&lt;br /&gt;
| USB control transport || device-side &amp;lt;code&amp;gt;USB ACM&amp;lt;/code&amp;gt; transport plumbing implemented&lt;br /&gt;
|-&lt;br /&gt;
| SPI || not implemented&lt;br /&gt;
|-&lt;br /&gt;
| USER virtual channel || default interface is &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Low power || currently &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only&lt;br /&gt;
|-&lt;br /&gt;
| Optional ATModule control solution || available, but not mandatory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Document Guide ==&lt;br /&gt;
&lt;br /&gt;
Use these documents according to what you need:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Document !! Focus&lt;br /&gt;
|-&lt;br /&gt;
| [[NetHubQuickBringup|NetHubQuickBringup.md]] || default interface, main configuration switches, build and flash, SDIO and USB pins&lt;br /&gt;
|-&lt;br /&gt;
| [[NetHubArchitecture|NetHubArchitecture.md]] || internal layering, public APIs, support matrix, and interface differences&lt;br /&gt;
|-&lt;br /&gt;
| [[NetHubVirtualChannel|NetHubVirtualChannel.md]] || USER virtual channel scope, prerequisites, APIs, and limits&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Key Points ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; is the current default interface for the in-tree bring-up path.&lt;br /&gt;
* &amp;lt;code&amp;gt;USB&amp;lt;/code&amp;gt; device-side backend is implemented with &amp;lt;code&amp;gt;ECM + ACM&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt; is still a stub and is not ready for bring-up.&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub&amp;lt;/code&amp;gt; core exposes data-path, control path, and virtual channel facades without directly depending on &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The optional &amp;lt;code&amp;gt;ATModule + bflbwifid + bflbwifictrl&amp;lt;/code&amp;gt; flow is available, but not mandatory.&lt;br /&gt;
&lt;br /&gt;
== In-Repo Reference Directories ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;examples/wifi/nethub&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Local Documentation Source ==&lt;br /&gt;
&lt;br /&gt;
The in-repo documentation source is:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;examples/wifi/nethub/docs/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Online Wiki ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.bouffalolab.com/index.php?title=NetHub NetHub]&lt;br /&gt;
* [https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup NetHubQuickBringup]&lt;br /&gt;
* [https://docs.bouffalolab.com/index.php?title=NetHubArchitecture NetHubArchitecture]&lt;br /&gt;
* [https://docs.bouffalolab.com/index.php?title=NetHubVirtualChannel NetHubVirtualChannel]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubVirtualChannel&amp;diff=286</id>
		<title>NetHubVirtualChannel</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubVirtualChannel&amp;diff=286"/>
		<updated>2026-04-24T14:20:29Z</updated>

		<summary type="html">&lt;p&gt;张良：​Sync NetHub docs from local Markdown (2026-04-24 wording update)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub USER Virtual Channel =&lt;br /&gt;
&lt;br /&gt;
This document describes the current NetHub USER virtual-channel support.&lt;br /&gt;
&lt;br /&gt;
== 1. Concept ==&lt;br /&gt;
&lt;br /&gt;
USER virtual channel is a logical message channel carried on the active host link.&lt;br /&gt;
&lt;br /&gt;
It is not a separate physical interface. The public API is designed to be transport-neutral, while the current in-tree implementation is still centered on the SDIO reference path.&lt;br /&gt;
&lt;br /&gt;
Common logical types:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt; || private customer or application data&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;AT&amp;lt;/code&amp;gt; || control payloads&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt; || internal coordination messages&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 2. Current Support Status ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Area !! Current status&lt;br /&gt;
|-&lt;br /&gt;
| Device API surface || transport-neutral by design&lt;br /&gt;
|-&lt;br /&gt;
| Device in-tree implementation || currently in &amp;lt;code&amp;gt;backend/host/sdio/virtualchan.c&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Host userspace library || currently aligned with &amp;lt;code&amp;gt;mr_sdio.ko + netlink&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Default interface for the current in-tree USER vchan path || &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USB || device-side ACM transport exists, but in-tree host &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; alignment is not finished&lt;br /&gt;
|-&lt;br /&gt;
| SPI || not supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 3. Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Before using the current in-tree USER virtual-channel path, confirm:&lt;br /&gt;
&lt;br /&gt;
* device side is built with &amp;lt;code&amp;gt;CONFIG_NETHUB=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* device side enables &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* the selected bring-up path is the current SDIO reference flow&lt;br /&gt;
* host side has loaded &amp;lt;code&amp;gt;mr_sdio.ko&amp;lt;/code&amp;gt;&lt;br /&gt;
* the host-device link is already working&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* USER and AT are parallel logical channels&lt;br /&gt;
* customer private data should stay on the &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt; type&lt;br /&gt;
* documentation should not claim that USB and SPI already share the same finished end-to-end virtual-channel stack&lt;br /&gt;
&lt;br /&gt;
== 4. Device-Side API ==&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Common APIs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_user_send(const void *data, uint16_t len);&lt;br /&gt;
int nethub_vchan_user_recv_register(nethub_vchan_recv_cb_t recv_cb, void *cb_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 5. Host-Side API ==&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub/virtualchan/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initialization and cleanup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_init(void);&lt;br /&gt;
int nethub_vchan_deinit(void);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
USER channel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
typedef void (*nethub_vchan_recv_callback_t)(const void *data, size_t len);&lt;br /&gt;
&lt;br /&gt;
int nethub_vchan_user_send(const void *data, size_t len);&lt;br /&gt;
int nethub_vchan_user_register_callback(nethub_vchan_recv_callback_t callback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optional state query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct {&lt;br /&gt;
    nethub_vchan_link_state_t link_state;&lt;br /&gt;
    nethub_vchan_host_state_t host_state;&lt;br /&gt;
} nethub_vchan_state_snapshot_t;&lt;br /&gt;
&lt;br /&gt;
int nethub_vchan_get_state_snapshot(nethub_vchan_state_snapshot_t *snapshot);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optional link event callback:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_register_link_event_callback(&lt;br /&gt;
    nethub_vchan_link_event_callback_t callback,&lt;br /&gt;
    void *user_data);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 6. Typical Usage Order ==&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;code&amp;gt;nethub_vchan_init()&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;nethub_vchan_user_register_callback()&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;nethub_vchan_user_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
# &amp;lt;code&amp;gt;nethub_vchan_deinit()&amp;lt;/code&amp;gt; when finished&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;nethub_vchan.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
static void user_rx_cb(const void *data, size_t len)&lt;br /&gt;
{&lt;br /&gt;
    printf(&amp;quot;recv USER data: %.*s\n&amp;quot;, (int)len, (const char *)data);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
    const char *msg = &amp;quot;hello from host&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    if (nethub_vchan_init() != 0) {&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    nethub_vchan_user_register_callback(user_rx_cb);&lt;br /&gt;
    nethub_vchan_user_send(msg, strlen(msg));&lt;br /&gt;
&lt;br /&gt;
    nethub_vchan_deinit();&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 7. Limits and Notes ==&lt;br /&gt;
&lt;br /&gt;
* maximum payload length per message is &amp;lt;code&amp;gt;1500&amp;lt;/code&amp;gt; bytes&lt;br /&gt;
* USER virtual channel is packet-oriented, not a byte stream&lt;br /&gt;
* the current in-tree end-to-end path is SDIO-based&lt;br /&gt;
* if the device side does not enable &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN&amp;lt;/code&amp;gt;, the current in-tree USER virtual-channel path will not work&lt;br /&gt;
* if control traffic and USER traffic coexist, keep private application traffic on &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt; and do not reuse the &amp;lt;code&amp;gt;AT&amp;lt;/code&amp;gt; type&lt;br /&gt;
&lt;br /&gt;
== 8. Related Pages ==&lt;br /&gt;
&lt;br /&gt;
* [[NetHub|NetHub.md]]&lt;br /&gt;
* [[NetHubQuickBringup|NetHubQuickBringup.md]]&lt;br /&gt;
* [[NetHubArchitecture|NetHubArchitecture.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubArchitecture&amp;diff=285</id>
		<title>NetHubArchitecture</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubArchitecture&amp;diff=285"/>
		<updated>2026-04-24T14:20:27Z</updated>

		<summary type="html">&lt;p&gt;张良：​Sync NetHub docs from local Markdown (2026-04-24 wording update)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub Architecture =&lt;br /&gt;
&lt;br /&gt;
This document summarizes the current NetHub architecture across the device-side module, the optional host control stack, and the current support limits.&lt;br /&gt;
&lt;br /&gt;
== 1. High-Level Model ==&lt;br /&gt;
&lt;br /&gt;
NetHub runs on the device and bridges already-available Wi-Fi capability onto one selected host-link profile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Wi-Fi backend + lwIP&lt;br /&gt;
       |&lt;br /&gt;
       v&lt;br /&gt;
     nethub&lt;br /&gt;
  +-----------+&lt;br /&gt;
  | data-path |&lt;br /&gt;
  | filter    |&lt;br /&gt;
  | ctrlpath  |&lt;br /&gt;
  | vchan     |&lt;br /&gt;
  +-----------+&lt;br /&gt;
       |&lt;br /&gt;
       v&lt;br /&gt;
host-link profile&lt;br /&gt;
(SDIO / USB / SPI)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important boundary:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub&amp;lt;/code&amp;gt; core does not directly depend on &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; is an optional example consumer of the NetHub control path&lt;br /&gt;
&lt;br /&gt;
== 2. Current Support Matrix ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Area !! SDIO !! USB !! SPI&lt;br /&gt;
|-&lt;br /&gt;
| Device-side profile || yes || yes || yes&lt;br /&gt;
|-&lt;br /&gt;
| Device-side data-path || yes || yes, through &amp;lt;code&amp;gt;USB ECM&amp;lt;/code&amp;gt; || no&lt;br /&gt;
|-&lt;br /&gt;
| Device-side control transport plumbing || yes || yes, through &amp;lt;code&amp;gt;USB ACM&amp;lt;/code&amp;gt; || no&lt;br /&gt;
|-&lt;br /&gt;
| Current in-tree host Linux reference path || yes || not yet the main reference path || no&lt;br /&gt;
|-&lt;br /&gt;
| End-to-end USER virtual channel || yes || not yet aligned in-tree || no&lt;br /&gt;
|-&lt;br /&gt;
| Current default interface || yes || no || no&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 3. Device-Side Layers ==&lt;br /&gt;
&lt;br /&gt;
Public headers:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_filter.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Internal layers:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bootstrap/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;core/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;profile/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/wifi/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/sdio/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/usb/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/spi/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Main public APIs:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_bootstrap()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_shutdown()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_get_status()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_set_active_wifi_channel()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_ctrl_upld_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_ctrl_dnld_register()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_vchan_user_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_vchan_user_recv_register()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_set_wifi_rx_filter()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 4. Data-Path ==&lt;br /&gt;
&lt;br /&gt;
The data-path is the main NetHub function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
host payload -&amp;gt; host-link backend -&amp;gt; nethub -&amp;gt; active Wi-Fi endpoint&lt;br /&gt;
Wi-Fi RX     -&amp;gt; nethub filter     -&amp;gt; local / host / both&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Device-side Wi-Fi is already owned by the Wi-Fi backend. NetHub mainly wires the host-link side to that Wi-Fi backend.&lt;br /&gt;
&lt;br /&gt;
== 5. Control Path ==&lt;br /&gt;
&lt;br /&gt;
NetHub exposes a stable control-path facade:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_ctrl_upld_send(uint8_t *data_buff, uint32_t data_size);&lt;br /&gt;
int nethub_ctrl_dnld_register(nethub_ctrl_rx_cb_t dnld_cb, void *cbpri_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That facade is implemented per profile.&lt;br /&gt;
&lt;br /&gt;
Current interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;: implemented in-tree&lt;br /&gt;
* &amp;lt;code&amp;gt;USB&amp;lt;/code&amp;gt;: device-side ACM transport plumbing implemented&lt;br /&gt;
* &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt;: not implemented&lt;br /&gt;
&lt;br /&gt;
Main build-time switches related to this area:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=y&amp;lt;/code&amp;gt;&lt;br /&gt;
** the example enables &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; plus host &amp;lt;code&amp;gt;bflbwifid / bflbwifictrl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; does not participate in the build&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CONFIG_NETHUB_AT_USE_VCHAN&amp;lt;/code&amp;gt; should be documented carefully as an example or legacy SDIO control-path convention, not as a finished transport-wide selector.&lt;br /&gt;
&lt;br /&gt;
== 6. Virtual Channel ==&lt;br /&gt;
&lt;br /&gt;
NetHub also exposes a logical virtual-channel API:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_user_send(const void *data, uint16_t len);&lt;br /&gt;
int nethub_vchan_user_recv_register(nethub_vchan_recv_cb_t recv_cb, void *cb_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
API intent:&lt;br /&gt;
&lt;br /&gt;
* stable logical message API across host-link types&lt;br /&gt;
&lt;br /&gt;
Current backend reality:&lt;br /&gt;
&lt;br /&gt;
* the in-tree implementation is still SDIO-backed&lt;br /&gt;
* the host userspace &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; library is also SDIO-based today&lt;br /&gt;
* therefore the current end-to-end USER virtual-channel story follows the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface&lt;br /&gt;
&lt;br /&gt;
== 7. Host-Side Optional Stack ==&lt;br /&gt;
&lt;br /&gt;
When the optional AT control solution is used, the typical host-side stack is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bflbwifictrl -&amp;gt; bflbwifid -&amp;gt; libbflbwifi -&amp;gt; tty or vchan backend&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* this stack is not required for NetHub data-path-only products&lt;br /&gt;
* the in-tree host Linux reference stack is still centered on the SDIO path&lt;br /&gt;
&lt;br /&gt;
== 8. Low-Power Scope ==&lt;br /&gt;
&lt;br /&gt;
Current low-power support is &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
The example configuration automatically disables &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE&amp;lt;/code&amp;gt; on other chips.&lt;br /&gt;
&lt;br /&gt;
== 9. Recommended Reading ==&lt;br /&gt;
&lt;br /&gt;
* [[NetHub|NetHub.md]]&lt;br /&gt;
* [[NetHubQuickBringup|NetHubQuickBringup.md]]&lt;br /&gt;
* [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup&amp;diff=284</id>
		<title>NetHubQuickBringup</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup&amp;diff=284"/>
		<updated>2026-04-24T14:20:25Z</updated>

		<summary type="html">&lt;p&gt;张良：​Sync NetHub docs from local Markdown (2026-04-24 wording update)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub Quick Start =&lt;br /&gt;
&lt;br /&gt;
This document is for customers using NetHub for the first time. The goal is to get you to the current default interface as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
[[文件:Nethub_sdio_quickstart_demo.gif | NetHub SDIO Quick Start Demo]]&lt;br /&gt;
&lt;br /&gt;
== 1. Current Support Matrix ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Item !! Current status&lt;br /&gt;
|-&lt;br /&gt;
| Default interface || &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USB profile || device-side backend implemented with &amp;lt;code&amp;gt;USB ECM + USB ACM&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| SPI profile || not implemented&lt;br /&gt;
|-&lt;br /&gt;
| USER virtual channel || default interface is &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Optional AT control solution || available, but not mandatory&lt;br /&gt;
|-&lt;br /&gt;
| Low power || currently &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Read this table literally:&lt;br /&gt;
&lt;br /&gt;
* if you want the shortest successful path today, choose &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
* if you are evaluating the USB backend, focus on the device profile and USB descriptors first&lt;br /&gt;
* do not plan on &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt; bring-up yet&lt;br /&gt;
&lt;br /&gt;
== 2. Main Configuration Switches ==&lt;br /&gt;
&lt;br /&gt;
For most users, the main configuration changes are these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;makefile&amp;quot;&amp;gt;&lt;br /&gt;
CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE =y&lt;br /&gt;
CONFIG_NETHUB_LOWPOWER_ENABLE          =y&lt;br /&gt;
CONFIG_NETHUB_PROFILE_USB              =n&lt;br /&gt;
CONFIG_NETHUB_PROFILE_SDIO             =y&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* set &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_SDIO=y&amp;lt;/code&amp;gt; for the current default interface&lt;br /&gt;
* set &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_USB=y&amp;lt;/code&amp;gt; only when you want to evaluate the USB profile&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n&amp;lt;/code&amp;gt; means &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; will not participate in the build&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE=y&amp;lt;/code&amp;gt; is currently meaningful only on &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additional current default facts in &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_AT_USE_VCHAN=n&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MR_TTY=n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3. Wi-Fi Backend Selection ==&lt;br /&gt;
&lt;br /&gt;
Default configuration:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_WL80211&amp;lt;/code&amp;gt; disabled&lt;br /&gt;
* &amp;lt;code&amp;gt;fhost&amp;lt;/code&amp;gt; selected&lt;br /&gt;
&lt;br /&gt;
If you want &amp;lt;code&amp;gt;wl80211&amp;lt;/code&amp;gt;, enable this in &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;makefile&amp;quot;&amp;gt;&lt;br /&gt;
CONFIG_WL80211=y&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fhost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wl80211&amp;lt;/code&amp;gt; are mutually exclusive&lt;br /&gt;
* current NetHub supports both device-side Wi-Fi backends&lt;br /&gt;
&lt;br /&gt;
== 4. Device Build and Flash ==&lt;br /&gt;
&lt;br /&gt;
Build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd examples/wifi/nethub&lt;br /&gt;
&lt;br /&gt;
# BL616&lt;br /&gt;
make CHIP=bl616 BOARD=bl616dk&lt;br /&gt;
&lt;br /&gt;
# BL616CL&lt;br /&gt;
make CHIP=bl616cl BOARD=bl616cldk&lt;br /&gt;
&lt;br /&gt;
# BL618DG&lt;br /&gt;
make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=ap&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flash example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd examples/wifi/nethub&lt;br /&gt;
make flash CHIP=bl618dg COMX=/dev/ttyUSB0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 5. Hardware Interface Pins ==&lt;br /&gt;
&lt;br /&gt;
The pin tables below are the current default mappings used by the in-tree BSP board helpers.&lt;br /&gt;
&lt;br /&gt;
Reference sources in the repository:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/board/bl616dk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/board/bl616cldk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/board/bl618dgdk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 5.1 Default SDIO Pins ===&lt;br /&gt;
&lt;br /&gt;
These are the current &amp;lt;code&amp;gt;board_sdh_gpio_init()&amp;lt;/code&amp;gt; mappings used by the BSP.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin Function !! BL616 / BL618 (&amp;lt;code&amp;gt;bl616dk&amp;lt;/code&amp;gt;) !! BL618DG (&amp;lt;code&amp;gt;bl618dgdk&amp;lt;/code&amp;gt;) !! BL616CL (&amp;lt;code&amp;gt;bl616cldk&amp;lt;/code&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO10&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO43&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO6&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT3&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO11&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO44&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO7&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_CMD&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO12&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO45&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO8&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_CLK&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO13&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO46&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO9&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO14&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO47&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO10&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO15&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO48&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO11&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* this table shows the current default 4-bit SDIO wiring used by the NetHub SDIO data-path&lt;br /&gt;
* 1-line mode is also supported; if you use 1-line mode, keep &amp;lt;code&amp;gt;CMD&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CLK&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;DAT0&amp;lt;/code&amp;gt; first&lt;br /&gt;
* the BSP configures these pins with &amp;lt;code&amp;gt;GPIO_FUNC_SDH | GPIO_ALTERNATE | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 5.2 Default USB Pins ===&lt;br /&gt;
&lt;br /&gt;
The current USB profile uses the board&#039;s default USB differential pair.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Chip / Board family !! Default USB pins in current BSP !! Current BSP behavior !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| BL616 / BL618 (&amp;lt;code&amp;gt;bl616dk&amp;lt;/code&amp;gt;) || board default USB port path || current BSP enables USB clock in &amp;lt;code&amp;gt;board.c&amp;lt;/code&amp;gt;, but does not expose a dedicated &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; helper || treat this as the board&#039;s fixed default USB routing in the current example&lt;br /&gt;
|-&lt;br /&gt;
| BL616CL (&amp;lt;code&amp;gt;bl616cldk&amp;lt;/code&amp;gt;) || &amp;lt;code&amp;gt;GPIO32&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GPIO33&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; configures the pair as analog pins || current BSP documents the pair, not separate &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; labels&lt;br /&gt;
|-&lt;br /&gt;
| BL618DG (&amp;lt;code&amp;gt;bl618dgdk&amp;lt;/code&amp;gt;) || &amp;lt;code&amp;gt;GPIO40&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GPIO41&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; configures the pair as analog pins || current BSP documents the pair, not separate &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; labels&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* for &amp;lt;code&amp;gt;BL616CL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;, the BSP helper only tells us the USB pair used by the board, not which pin is &amp;lt;code&amp;gt;D+&amp;lt;/code&amp;gt; and which pin is &amp;lt;code&amp;gt;D-&amp;lt;/code&amp;gt;&lt;br /&gt;
* if you are wiring a custom board and need explicit &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; polarity, confirm it from the board schematic or chip or package documentation&lt;br /&gt;
&lt;br /&gt;
== 6. Host Bring-Up Guidance ==&lt;br /&gt;
&lt;br /&gt;
For the current in-tree host Linux reference stack, use:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub/README.md&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Today that host stack is primarily the &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; reference flow.&lt;br /&gt;
&lt;br /&gt;
For USB projects, keep expectations aligned with current code status:&lt;br /&gt;
&lt;br /&gt;
* device-side &amp;lt;code&amp;gt;ECM + ACM&amp;lt;/code&amp;gt; backend exists&lt;br /&gt;
* host-side transport flattening into the same &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; behavior as SDIO is not fully documented or aligned in-tree yet&lt;br /&gt;
&lt;br /&gt;
== 7. USER Virtual Channel ==&lt;br /&gt;
&lt;br /&gt;
If you need private application messages between host and device, read:&lt;br /&gt;
&lt;br /&gt;
* [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;br /&gt;
&lt;br /&gt;
Current reality:&lt;br /&gt;
&lt;br /&gt;
* the current in-tree end-to-end USER virtual channel follows the default &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; interface&lt;br /&gt;
* the public device API is transport-neutral by design&lt;br /&gt;
* the in-tree implementation behind it is still SDIO-backed today&lt;br /&gt;
&lt;br /&gt;
== 8. Low-Power Note ==&lt;br /&gt;
&lt;br /&gt;
Low power is currently supported only on &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you build for other chips, &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt; automatically turns &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE&amp;lt;/code&amp;gt; off. In practice, you usually only need to keep this option enabled when building for &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== 9. Where to Go Next ==&lt;br /&gt;
&lt;br /&gt;
* overall entry: [[NetHub|NetHub.md]]&lt;br /&gt;
* architecture: [[NetHubArchitecture|NetHubArchitecture.md]]&lt;br /&gt;
* USER virtual channel: [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHub&amp;diff=283</id>
		<title>NetHub</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHub&amp;diff=283"/>
		<updated>2026-04-24T14:20:25Z</updated>

		<summary type="html">&lt;p&gt;张良：​Sync NetHub docs from local Markdown (2026-04-24 wording update)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub =&lt;br /&gt;
&lt;br /&gt;
NetHub bridges device-side Wi-Fi capability to a selected host-link backend.&lt;br /&gt;
&lt;br /&gt;
The current solution targets Wi-Fi SoCs such as &amp;lt;code&amp;gt;BL616 / BL618 / BL616CL / BL618DG&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Current Status ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Item !! Current status&lt;br /&gt;
|-&lt;br /&gt;
| Default interface || &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USB data-path || device-side &amp;lt;code&amp;gt;USB ECM&amp;lt;/code&amp;gt; backend implemented&lt;br /&gt;
|-&lt;br /&gt;
| USB control transport || device-side &amp;lt;code&amp;gt;USB ACM&amp;lt;/code&amp;gt; transport plumbing implemented&lt;br /&gt;
|-&lt;br /&gt;
| SPI || not implemented&lt;br /&gt;
|-&lt;br /&gt;
| USER virtual channel || default interface is &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Low power || currently &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only&lt;br /&gt;
|-&lt;br /&gt;
| Optional ATModule control solution || available, but not mandatory&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Document Guide ==&lt;br /&gt;
&lt;br /&gt;
Use these documents according to what you need:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Document !! Focus&lt;br /&gt;
|-&lt;br /&gt;
| [[NetHubQuickBringup|NetHubQuickBringup.md]] || default interface, main configuration switches, build and flash, SDIO and USB pins&lt;br /&gt;
|-&lt;br /&gt;
| [[NetHubArchitecture|NetHubArchitecture.md]] || internal layering, public APIs, support matrix, and host-link differences&lt;br /&gt;
|-&lt;br /&gt;
| [[NetHubVirtualChannel|NetHubVirtualChannel.md]] || USER virtual channel scope, prerequisites, APIs, and limits&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Key Points ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; is the current default interface and the current in-tree reference path.&lt;br /&gt;
* &amp;lt;code&amp;gt;USB&amp;lt;/code&amp;gt; device-side backend is implemented with &amp;lt;code&amp;gt;ECM + ACM&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt; is still a stub and is not ready for bring-up.&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub&amp;lt;/code&amp;gt; core exposes data-path, control-path, and virtual-channel facades without directly depending on &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The optional &amp;lt;code&amp;gt;ATModule + bflbwifid + bflbwifictrl&amp;lt;/code&amp;gt; flow is available, but it is not required.&lt;br /&gt;
&lt;br /&gt;
== In-Repo Reference Directories ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;examples/wifi/nethub&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Local Documentation Source ==&lt;br /&gt;
&lt;br /&gt;
The in-repo documentation source is:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;examples/wifi/nethub/docs/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Online Wiki ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.bouffalolab.com/index.php?title=NetHub NetHub]&lt;br /&gt;
* [https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup NetHubQuickBringup]&lt;br /&gt;
* [https://docs.bouffalolab.com/index.php?title=NetHubArchitecture NetHubArchitecture]&lt;br /&gt;
* [https://docs.bouffalolab.com/index.php?title=NetHubVirtualChannel NetHubVirtualChannel]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubVirtualChannel&amp;diff=282</id>
		<title>NetHubVirtualChannel</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubVirtualChannel&amp;diff=282"/>
		<updated>2026-04-24T13:48:39Z</updated>

		<summary type="html">&lt;p&gt;张良：​Sync NetHub docs from local Markdown (2026-04-24)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub USER Virtual Channel =&lt;br /&gt;
&lt;br /&gt;
This document describes the current NetHub USER virtual-channel support.&lt;br /&gt;
&lt;br /&gt;
== 1. Concept ==&lt;br /&gt;
&lt;br /&gt;
USER virtual channel is a logical message channel carried on the active host link.&lt;br /&gt;
&lt;br /&gt;
It is not a separate physical interface. The public API is designed to be transport-neutral, while the current in-tree implementation is still centered on the SDIO reference path.&lt;br /&gt;
&lt;br /&gt;
Common logical types are:&lt;br /&gt;
&lt;br /&gt;
***** &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt;&lt;br /&gt;
****** private customer or application data&lt;br /&gt;
***** &amp;lt;code&amp;gt;AT&amp;lt;/code&amp;gt;&lt;br /&gt;
****** control payloads&lt;br /&gt;
***** &amp;lt;code&amp;gt;SYSTEM&amp;lt;/code&amp;gt;&lt;br /&gt;
****** internal coordination messages&lt;br /&gt;
&lt;br /&gt;
== 2. Current Support Status ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Area !! Current status&lt;br /&gt;
|-&lt;br /&gt;
| Device API surface || transport-neutral by design&lt;br /&gt;
|-&lt;br /&gt;
| Device in-tree implementation || currently in &amp;lt;code&amp;gt;backend/host/sdio/virtualchan.c&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Host userspace library || currently aligned with &amp;lt;code&amp;gt;mr_sdio.ko + netlink&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| End-to-end USER vchan reference path || &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USB || device-side ACM transport exists, but in-tree host &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; alignment is not finished&lt;br /&gt;
|-&lt;br /&gt;
| SPI || not supported&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 3. Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Before using the current in-tree USER virtual-channel path, confirm:&lt;br /&gt;
&lt;br /&gt;
***** device side is built with &amp;lt;code&amp;gt;CONFIG_NETHUB=y&amp;lt;/code&amp;gt;&lt;br /&gt;
***** device side enables &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN=y&amp;lt;/code&amp;gt;&lt;br /&gt;
***** the selected bring-up path is the current SDIO reference flow&lt;br /&gt;
***** host side has loaded &amp;lt;code&amp;gt;mr_sdio.ko&amp;lt;/code&amp;gt;&lt;br /&gt;
***** the host-device link is already working&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
***** USER and AT are parallel logical channels&lt;br /&gt;
***** customer private data should stay on the &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt; type&lt;br /&gt;
***** documentation should not claim that USB and SPI already share the same finished end-to-end virtual-channel stack&lt;br /&gt;
&lt;br /&gt;
== 4. Device-Side API ==&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
&lt;br /&gt;
***** &amp;lt;code&amp;gt;components/net/nethub/include/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Common APIs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        int nethub_vchan_user_send(const void *data, uint16_t len);&lt;br /&gt;
        int nethub_vchan_user_recv_register(nethub_vchan_recv_cb_t recv_cb, void *cb_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 5. Host-Side API ==&lt;br /&gt;
&lt;br /&gt;
Header:&lt;br /&gt;
&lt;br /&gt;
***** &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub/virtualchan/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initialization and cleanup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        int nethub_vchan_init(void);&lt;br /&gt;
        int nethub_vchan_deinit(void);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
USER channel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        typedef void (*nethub_vchan_recv_callback_t)(const void *data, size_t len);&lt;br /&gt;
&lt;br /&gt;
        int nethub_vchan_user_send(const void *data, size_t len);&lt;br /&gt;
        int nethub_vchan_user_register_callback(nethub_vchan_recv_callback_t callback);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optional state query:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        typedef struct {&lt;br /&gt;
            nethub_vchan_link_state_t link_state;&lt;br /&gt;
            nethub_vchan_host_state_t host_state;&lt;br /&gt;
        } nethub_vchan_state_snapshot_t;&lt;br /&gt;
&lt;br /&gt;
        int nethub_vchan_get_state_snapshot(nethub_vchan_state_snapshot_t *snapshot);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optional link event callback:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        int nethub_vchan_register_link_event_callback(&lt;br /&gt;
            nethub_vchan_link_event_callback_t callback,&lt;br /&gt;
            void *user_data);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 6. Typical Usage Order ==&lt;br /&gt;
&lt;br /&gt;
##### &amp;lt;code&amp;gt;nethub_vchan_init()&amp;lt;/code&amp;gt;&lt;br /&gt;
##### &amp;lt;code&amp;gt;nethub_vchan_user_register_callback()&amp;lt;/code&amp;gt;&lt;br /&gt;
##### &amp;lt;code&amp;gt;nethub_vchan_user_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
##### &amp;lt;code&amp;gt;nethub_vchan_deinit()&amp;lt;/code&amp;gt; when finished&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
        #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        #include &amp;quot;nethub_vchan.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        static void user_rx_cb(const void *data, size_t len)&lt;br /&gt;
        {&lt;br /&gt;
            printf(&amp;quot;recv USER data: %.*s&lt;br /&gt;
&amp;quot;, (int)len, (const char *)data);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        int main(void)&lt;br /&gt;
        {&lt;br /&gt;
            const char *msg = &amp;quot;hello from host&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
            if (nethub_vchan_init() != 0) {&lt;br /&gt;
                return -1;&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            nethub_vchan_user_register_callback(user_rx_cb);&lt;br /&gt;
            nethub_vchan_user_send(msg, strlen(msg));&lt;br /&gt;
&lt;br /&gt;
            nethub_vchan_deinit();&lt;br /&gt;
            return 0;&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 7. Limits and Notes ==&lt;br /&gt;
&lt;br /&gt;
***** maximum payload length per message is &amp;lt;code&amp;gt;1500&amp;lt;/code&amp;gt; bytes&lt;br /&gt;
***** USER virtual channel is packet-oriented, not a byte stream&lt;br /&gt;
***** the current in-tree end-to-end path is SDIO-based&lt;br /&gt;
***** if the device side does not enable &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN&amp;lt;/code&amp;gt;, the current in-tree USER virtual-channel path will not work&lt;br /&gt;
***** if control traffic and USER traffic coexist, keep private application traffic on &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt; and do not reuse the &amp;lt;code&amp;gt;AT&amp;lt;/code&amp;gt; type&lt;br /&gt;
&lt;br /&gt;
== 8. Related Pages ==&lt;br /&gt;
&lt;br /&gt;
***** [[NetHub|NetHub.md]]&lt;br /&gt;
***** [[NetHubQuickBringup|NetHubQuickBringup.md]]&lt;br /&gt;
***** [[NetHubArchitecture|NetHubArchitecture.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubArchitecture&amp;diff=281</id>
		<title>NetHubArchitecture</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubArchitecture&amp;diff=281"/>
		<updated>2026-04-24T13:48:37Z</updated>

		<summary type="html">&lt;p&gt;张良：​Sync NetHub docs from local Markdown (2026-04-24)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub Architecture =&lt;br /&gt;
&lt;br /&gt;
This document summarizes the current NetHub architecture across the device-side module, the optional host control stack, and the current support limits.&lt;br /&gt;
&lt;br /&gt;
== 1. High-Level Model ==&lt;br /&gt;
&lt;br /&gt;
NetHub runs on the device and bridges already-available Wi-Fi capability onto one selected host-link profile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Wi-Fi backend + lwIP&lt;br /&gt;
       |&lt;br /&gt;
       v&lt;br /&gt;
     nethub&lt;br /&gt;
  +-----------+&lt;br /&gt;
  | data path |&lt;br /&gt;
  | filter    |&lt;br /&gt;
  | ctrlpath  |&lt;br /&gt;
  | vchan     |&lt;br /&gt;
  +-----------+&lt;br /&gt;
       |&lt;br /&gt;
       v&lt;br /&gt;
host-link profile&lt;br /&gt;
(SDIO / USB / SPI)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important boundary:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub&amp;lt;/code&amp;gt; core does not directly depend on &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; is an optional example consumer of the NetHub control path&lt;br /&gt;
&lt;br /&gt;
== 2. Current Support Matrix ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Area !! SDIO !! USB !! SPI&lt;br /&gt;
|-&lt;br /&gt;
| Device-side profile || yes || yes || yes&lt;br /&gt;
|-&lt;br /&gt;
| Device-side data path || yes || yes, through &amp;lt;code&amp;gt;USB ECM&amp;lt;/code&amp;gt; || no&lt;br /&gt;
|-&lt;br /&gt;
| Device-side control transport plumbing || yes || yes, through &amp;lt;code&amp;gt;USB ACM&amp;lt;/code&amp;gt; || no&lt;br /&gt;
|-&lt;br /&gt;
| Current in-tree host Linux reference path || yes || not yet the main reference path || no&lt;br /&gt;
|-&lt;br /&gt;
| End-to-end USER virtual channel || yes || not yet aligned in-tree || no&lt;br /&gt;
|-&lt;br /&gt;
| Recommended today || yes || evaluation only || no&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 3. Device-Side Layers ==&lt;br /&gt;
&lt;br /&gt;
Public headers:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub/include/nethub_filter.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Internal layers:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bootstrap/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;core/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;profile/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/wifi/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/sdio/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/usb/&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;backend/host/spi/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Main public APIs:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_bootstrap()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_shutdown()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_get_status()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_set_active_wifi_channel()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_ctrl_upld_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_ctrl_dnld_register()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_vchan_user_send()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_vchan_user_recv_register()&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub_set_wifi_rx_filter()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 4. Data Plane ==&lt;br /&gt;
&lt;br /&gt;
The data plane is the main NetHub function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
host payload -&amp;gt; host-link backend -&amp;gt; nethub -&amp;gt; active Wi-Fi endpoint&lt;br /&gt;
Wi-Fi RX     -&amp;gt; nethub filter     -&amp;gt; local / host / both&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Device-side Wi-Fi is already owned by the Wi-Fi backend. NetHub mainly wires the host-link side to that Wi-Fi backend.&lt;br /&gt;
&lt;br /&gt;
== 5. Control Path ==&lt;br /&gt;
&lt;br /&gt;
NetHub exposes a stable control-path facade:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_ctrl_upld_send(uint8_t *data_buff, uint32_t data_size);&lt;br /&gt;
int nethub_ctrl_dnld_register(nethub_ctrl_rx_cb_t dnld_cb, void *cbpri_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That facade is implemented per profile.&lt;br /&gt;
&lt;br /&gt;
Current interpretation:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;: implemented in-tree&lt;br /&gt;
* &amp;lt;code&amp;gt;USB&amp;lt;/code&amp;gt;: device-side ACM transport plumbing implemented&lt;br /&gt;
* &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt;: not implemented&lt;br /&gt;
&lt;br /&gt;
Optional AT solution:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=y&amp;lt;/code&amp;gt;&lt;br /&gt;
** example enables &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; plus host &amp;lt;code&amp;gt;bflbwifid / bflbwifictrl&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n&amp;lt;/code&amp;gt;&lt;br /&gt;
** data-plane-only products can omit the example control chain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CONFIG_NETHUB_AT_USE_VCHAN&amp;lt;/code&amp;gt; should be documented carefully as an example or legacy SDIO control-path convention, not as a finished transport-wide selector.&lt;br /&gt;
&lt;br /&gt;
== 6. Virtual Channel ==&lt;br /&gt;
&lt;br /&gt;
NetHub also exposes a logical virtual-channel API:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int nethub_vchan_user_send(const void *data, uint16_t len);&lt;br /&gt;
int nethub_vchan_user_recv_register(nethub_vchan_recv_cb_t recv_cb, void *cb_arg);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
API intent:&lt;br /&gt;
&lt;br /&gt;
* stable logical message API across host-link types&lt;br /&gt;
&lt;br /&gt;
Current backend reality:&lt;br /&gt;
&lt;br /&gt;
* the in-tree implementation is still SDIO-backed&lt;br /&gt;
* the host userspace &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; library is also SDIO-based today&lt;br /&gt;
* therefore the current end-to-end USER virtual-channel story is the SDIO reference path&lt;br /&gt;
&lt;br /&gt;
== 7. Host-Side Optional Stack ==&lt;br /&gt;
&lt;br /&gt;
When the optional AT control solution is used, the typical host-side stack is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bflbwifictrl -&amp;gt; bflbwifid -&amp;gt; libbflbwifi -&amp;gt; tty or vchan backend&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* this is not required for NetHub data-plane-only products&lt;br /&gt;
* the in-tree host Linux reference stack is still centered on the SDIO path&lt;br /&gt;
&lt;br /&gt;
== 8. Low-Power Scope ==&lt;br /&gt;
&lt;br /&gt;
Current low-power support is &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only.&lt;br /&gt;
&lt;br /&gt;
The example configuration automatically disables &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE&amp;lt;/code&amp;gt; on other chips.&lt;br /&gt;
&lt;br /&gt;
== 9. Recommended Reading ==&lt;br /&gt;
&lt;br /&gt;
* [[NetHub|NetHub.md]]&lt;br /&gt;
* [[NetHubQuickBringup|NetHubQuickBringup.md]]&lt;br /&gt;
* [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup&amp;diff=280</id>
		<title>NetHubQuickBringup</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup&amp;diff=280"/>
		<updated>2026-04-24T13:48:35Z</updated>

		<summary type="html">&lt;p&gt;张良：​Sync NetHub docs from local Markdown (2026-04-24)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub Quick Start =&lt;br /&gt;
&lt;br /&gt;
This document is for customers using NetHub for the first time. The goal is to get you to the currently supported bring-up path as quickly as possible.&lt;br /&gt;
&lt;br /&gt;
[[文件:Nethub_sdio_quickstart_demo.gif | NetHub SDIO Quick Start Demo]]&lt;br /&gt;
&lt;br /&gt;
== 1. Start with the Current Support Matrix ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Item !! Current status&lt;br /&gt;
|-&lt;br /&gt;
| Recommended end-to-end reference path || &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USB profile || device-side backend implemented with &amp;lt;code&amp;gt;USB ECM + USB ACM&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| SPI profile || not implemented&lt;br /&gt;
|-&lt;br /&gt;
| USER virtual channel || current in-tree end-to-end path is &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Optional AT control solution || available, but not required for data-only use cases&lt;br /&gt;
|-&lt;br /&gt;
| Low power || currently &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Read this table literally:&lt;br /&gt;
&lt;br /&gt;
* if you want the shortest successful path today, choose &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
* if you are evaluating the new USB device-side backend, focus on the device profile and USB descriptors first&lt;br /&gt;
* do not plan on &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt; bring-up yet&lt;br /&gt;
&lt;br /&gt;
== 2. Decide Whether You Need Only Data or Data Plus Control ==&lt;br /&gt;
&lt;br /&gt;
NetHub core always focuses on the data plane first.&lt;br /&gt;
&lt;br /&gt;
* data-only products&lt;br /&gt;
** keep &amp;lt;code&amp;gt;nethub&amp;lt;/code&amp;gt;&lt;br /&gt;
** do not depend on &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt;&lt;br /&gt;
** host users simply use the exposed netdev path&lt;br /&gt;
* data plus AT-style control products&lt;br /&gt;
** optionally enable the example composition built around &amp;lt;code&amp;gt;ATModule + bflbwifid + bflbwifictrl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The important boundary is:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub&amp;lt;/code&amp;gt; core does not directly depend on &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt; is an optional example control consumer of the NetHub control-path facade&lt;br /&gt;
&lt;br /&gt;
== 3. Choose the Host-Link Profile ==&lt;br /&gt;
&lt;br /&gt;
The profile is selected at build time through exactly one &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_*&amp;lt;/code&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
=== 3.1 SDIO ===&lt;br /&gt;
&lt;br /&gt;
Recommended today.&lt;br /&gt;
&lt;br /&gt;
What you get:&lt;br /&gt;
&lt;br /&gt;
* current in-tree reference data path&lt;br /&gt;
* current in-tree host Linux stack&lt;br /&gt;
* current in-tree USER virtual-channel path&lt;br /&gt;
&lt;br /&gt;
=== 3.2 USB ===&lt;br /&gt;
&lt;br /&gt;
Use this when you specifically want the device-side USB backend.&lt;br /&gt;
&lt;br /&gt;
Current device-side behavior:&lt;br /&gt;
&lt;br /&gt;
* data path through &amp;lt;code&amp;gt;USB CDC ECM&amp;lt;/code&amp;gt;&lt;br /&gt;
* control transport plumbing through &amp;lt;code&amp;gt;USB CDC ACM&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Current limitation:&lt;br /&gt;
&lt;br /&gt;
* the in-tree host Linux docs and &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; wrapper are still centered on the SDIO reference path&lt;br /&gt;
&lt;br /&gt;
=== 3.3 SPI ===&lt;br /&gt;
&lt;br /&gt;
Not implemented yet.&lt;br /&gt;
&lt;br /&gt;
== 4. Choose the Wi-Fi Backend ==&lt;br /&gt;
&lt;br /&gt;
Default configuration:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_WL80211&amp;lt;/code&amp;gt; disabled&lt;br /&gt;
* &amp;lt;code&amp;gt;fhost&amp;lt;/code&amp;gt; selected&lt;br /&gt;
&lt;br /&gt;
If you want &amp;lt;code&amp;gt;wl80211&amp;lt;/code&amp;gt;, enable this in &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;makefile&amp;quot;&amp;gt;&lt;br /&gt;
CONFIG_WL80211=y&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fhost&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;wl80211&amp;lt;/code&amp;gt; are mutually exclusive&lt;br /&gt;
* current NetHub supports both device-side Wi-Fi backends&lt;br /&gt;
&lt;br /&gt;
== 5. Device Build and Flash ==&lt;br /&gt;
&lt;br /&gt;
Build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd examples/wifi/nethub&lt;br /&gt;
&lt;br /&gt;
# BL616&lt;br /&gt;
make CHIP=bl616 BOARD=bl616dk&lt;br /&gt;
&lt;br /&gt;
# BL616CL&lt;br /&gt;
make CHIP=bl616cl BOARD=bl616cldk&lt;br /&gt;
&lt;br /&gt;
# BL618DG&lt;br /&gt;
make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=ap&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flash example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd examples/wifi/nethub&lt;br /&gt;
make flash CHIP=bl618dg COMX=/dev/ttyUSB0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 6. Important Configuration Switches ==&lt;br /&gt;
&lt;br /&gt;
Main configuration file:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;examples/wifi/nethub/defconfig&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Important switches:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_SDIO=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_USB=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_SPI=y&amp;lt;/code&amp;gt;&lt;br /&gt;
** choose exactly one profile per build&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=y&amp;lt;/code&amp;gt;&lt;br /&gt;
** enable the optional example AT control solution&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN=y&amp;lt;/code&amp;gt;&lt;br /&gt;
** required for the current in-tree SDIO virtual-channel path&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE=y&amp;lt;/code&amp;gt;&lt;br /&gt;
** currently meaningful only on &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
About &amp;lt;code&amp;gt;CONFIG_NETHUB_AT_USE_VCHAN&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* it still exists in the example configuration&lt;br /&gt;
* it is best treated as an example or legacy SDIO control-path switch&lt;br /&gt;
* do not document it as the core selector for all NetHub interfaces&lt;br /&gt;
&lt;br /&gt;
Current default example facts:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_SDIO=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_PROFILE_USB=n&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MR_VIRTUALCHAN=y&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_NETHUB_AT_USE_VCHAN=n&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;CONFIG_MR_TTY=n&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 7. Hardware Interface Pins ==&lt;br /&gt;
&lt;br /&gt;
The pin tables below are the current default mappings used by the in-tree BSP board helpers.&lt;br /&gt;
&lt;br /&gt;
Reference sources in the repository:&lt;br /&gt;
&lt;br /&gt;
* SDIO/USB pins&lt;br /&gt;
** &amp;lt;code&amp;gt;bsp/board/bl616dk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;bsp/board/bl616cldk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;bsp/board/bl618dgdk/board_gpio.c&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 7.1 Default SDIO Pins ===&lt;br /&gt;
&lt;br /&gt;
These are the current &amp;lt;code&amp;gt;board_sdh_gpio_init()&amp;lt;/code&amp;gt; mappings used by the BSP.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Pin Function !! BL616 / BL618 (&amp;lt;code&amp;gt;bl616dk&amp;lt;/code&amp;gt;) !! BL618DG (&amp;lt;code&amp;gt;bl618dgdk&amp;lt;/code&amp;gt;) !! BL616CL (&amp;lt;code&amp;gt;bl616cldk&amp;lt;/code&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT2&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO10&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO43&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO6&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT3&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO11&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO44&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO7&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_CMD&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO12&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO45&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO8&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_CLK&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO13&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO46&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO9&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT0&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO14&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO47&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO10&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SDIO_DAT1&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO15&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO48&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;GPIO11&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* this is the current 4-bit SDIO reference wiring used by the NetHub SDIO path&lt;br /&gt;
* the BSP configures these pins with `GPIO_FUNC_SDH | GPIO_ALTERNATE | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_1`&lt;br /&gt;
* if you are doing first bring-up, use this exact mapping first before trying a custom board layout&lt;br /&gt;
&lt;br /&gt;
=== 7.2 Default USB Pins ===&lt;br /&gt;
&lt;br /&gt;
The current USB profile uses the board&#039;s default USB differential pair.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Chip / Board family !! Default USB pins in current BSP !! Current BSP behavior !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| BL616 / BL618 (&amp;lt;code&amp;gt;bl616dk&amp;lt;/code&amp;gt;) || board default USB port path || current BSP enables USB clock in &amp;lt;code&amp;gt;board.c&amp;lt;/code&amp;gt;, but does not expose a dedicated &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; helper || treat this as the board&#039;s fixed default USB routing in the current example&lt;br /&gt;
|-&lt;br /&gt;
| BL616CL (&amp;lt;code&amp;gt;bl616cldk&amp;lt;/code&amp;gt;) || &amp;lt;code&amp;gt;GPIO32&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GPIO33&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; configures the pair as analog pins || current BSP documents the pair, not separate &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; labels&lt;br /&gt;
|-&lt;br /&gt;
| BL618DG (&amp;lt;code&amp;gt;bl618dgdk&amp;lt;/code&amp;gt;) || &amp;lt;code&amp;gt;GPIO40&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GPIO41&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;board_usb_gpio_init()&amp;lt;/code&amp;gt; configures the pair as analog pins || current BSP documents the pair, not separate &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; labels&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* for &amp;lt;code&amp;gt;BL616CL&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;, the BSP helper only tells us the USB pair used by the board, not which pin is &amp;lt;code&amp;gt;D+&amp;lt;/code&amp;gt; and which pin is &amp;lt;code&amp;gt;D-&amp;lt;/code&amp;gt;&lt;br /&gt;
* if you are wiring a custom board and need explicit &amp;lt;code&amp;gt;DP&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;DM&amp;lt;/code&amp;gt; polarity, confirm it from the board schematic or chip/package documentation&lt;br /&gt;
* for the current in-tree NetHub reference flow, USB is device-side bring-up work, while the full host reference stack is still centered on SDIO&lt;br /&gt;
&lt;br /&gt;
== 8. Host Bring-Up Guidance ==&lt;br /&gt;
&lt;br /&gt;
For the current in-tree host Linux reference stack, use:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub/README.md&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Today that host stack is primarily the &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; reference flow.&lt;br /&gt;
&lt;br /&gt;
For USB projects, keep expectations aligned with current code status:&lt;br /&gt;
&lt;br /&gt;
* device-side &amp;lt;code&amp;gt;ECM + ACM&amp;lt;/code&amp;gt; backend exists&lt;br /&gt;
* host-side transport flattening into the same &amp;lt;code&amp;gt;nethub_vchan&amp;lt;/code&amp;gt; behavior as SDIO is not fully documented or aligned in-tree yet&lt;br /&gt;
&lt;br /&gt;
== 9. USER Virtual Channel Guidance ==&lt;br /&gt;
&lt;br /&gt;
If you need private application messages between host and device:&lt;br /&gt;
&lt;br /&gt;
* device API: &amp;lt;code&amp;gt;components/net/nethub/include/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
* host API: &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub/virtualchan/nethub_vchan.h&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Current reality:&lt;br /&gt;
&lt;br /&gt;
* end-to-end in-tree USER virtual channel is the &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; path&lt;br /&gt;
* the public device API is transport-neutral by design&lt;br /&gt;
* the in-tree implementation behind it is still SDIO-backed today&lt;br /&gt;
&lt;br /&gt;
== 10. Low-Power Note ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CONFIG_NETHUB_LOWPOWER_ENABLE&amp;lt;/code&amp;gt; is currently supported only on &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt;. The example configuration automatically disables it on other chips.&lt;br /&gt;
&lt;br /&gt;
== 11. Where to Go Next ==&lt;br /&gt;
&lt;br /&gt;
* overall entry: [[NetHub|NetHub.md]]&lt;br /&gt;
* architecture: [[NetHubArchitecture|NetHubArchitecture.md]]&lt;br /&gt;
* USER virtual channel: [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=NetHub&amp;diff=279</id>
		<title>NetHub</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=NetHub&amp;diff=279"/>
		<updated>2026-04-24T13:48:34Z</updated>

		<summary type="html">&lt;p&gt;张良：​Sync NetHub docs from local Markdown (2026-04-24)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= NetHub =&lt;br /&gt;
&lt;br /&gt;
NetHub bridges device-side Wi-Fi capability to a selected host-link backend.&lt;br /&gt;
&lt;br /&gt;
The current solution targets Wi-Fi SoCs such as &amp;lt;code&amp;gt;BL616 / BL618 / BL616CL / BL618DG&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Current Status ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Item !! Current status&lt;br /&gt;
|-&lt;br /&gt;
| Reference bring-up path || &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| USB data path || device-side &amp;lt;code&amp;gt;USB ECM&amp;lt;/code&amp;gt; backend implemented&lt;br /&gt;
|-&lt;br /&gt;
| USB control transport || device-side &amp;lt;code&amp;gt;USB ACM&amp;lt;/code&amp;gt; transport plumbing implemented&lt;br /&gt;
|-&lt;br /&gt;
| SPI || not implemented&lt;br /&gt;
|-&lt;br /&gt;
| USER virtual channel || currently end-to-end in-tree on &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Low power || currently &amp;lt;code&amp;gt;BL618DG&amp;lt;/code&amp;gt; only&lt;br /&gt;
|-&lt;br /&gt;
| ATModule dependency || optional example composition only; not a NetHub core dependency&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation Guide ==&lt;br /&gt;
&lt;br /&gt;
* [[NetHubQuickBringup|NetHubQuickBringup.md]]&lt;br /&gt;
** first-time bring-up and current support limits&lt;br /&gt;
* [[NetHubArchitecture|NetHubArchitecture.md]]&lt;br /&gt;
** current device and host architecture, profile boundaries, and APIs&lt;br /&gt;
* [[NetHubVirtualChannel|NetHubVirtualChannel.md]]&lt;br /&gt;
** current USER virtual-channel usage and limits&lt;br /&gt;
&lt;br /&gt;
== Current Conclusions ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;SDIO&amp;lt;/code&amp;gt; is the current in-tree reference path.&lt;br /&gt;
* &amp;lt;code&amp;gt;USB&amp;lt;/code&amp;gt; device-side backend exists now and provides &amp;lt;code&amp;gt;ECM + ACM&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;SPI&amp;lt;/code&amp;gt; is still a stub.&lt;br /&gt;
* &amp;lt;code&amp;gt;nethub&amp;lt;/code&amp;gt; core exposes data-plane, control-path, and virtual-channel facades without directly depending on &amp;lt;code&amp;gt;ATModule&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The optional &amp;lt;code&amp;gt;ATModule + bflbwifid + bflbwifictrl&amp;lt;/code&amp;gt; flow is an example composition, not a hard requirement for NetHub data-path use cases.&lt;br /&gt;
&lt;br /&gt;
== In-Repo Reference Directories ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;examples/wifi/nethub&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;components/net/nethub&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bsp/common/msg_router/linux_host/userspace/nethub&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Local Documentation Source ==&lt;br /&gt;
&lt;br /&gt;
The in-repo documentation source is:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;examples/wifi/nethub/docs/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Online Wiki ==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.bouffalolab.com/index.php?title=NetHub NetHub]&lt;br /&gt;
* [https://docs.bouffalolab.com/index.php?title=NetHubQuickBringup NetHubQuickBringup]&lt;br /&gt;
* [https://docs.bouffalolab.com/index.php?title=NetHubArchitecture NetHubArchitecture]&lt;br /&gt;
* [https://docs.bouffalolab.com/index.php?title=NetHubVirtualChannel NetHubVirtualChannel]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=278</id>
		<title>DebuggingBouffaloLabChipsWithGDB</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=278"/>
		<updated>2026-04-10T01:05:38Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 通过CKLink调试DVK light开发板 =&lt;br /&gt;
&lt;br /&gt;
==== 通过USB连接到PC ====&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVK Light CKLinkLite.jpg| 600像素 | BL616DVKLight_CKLinkLite]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 进行GDB调试 ====&lt;br /&gt;
&lt;br /&gt;
这里以Ubuntu为例，分别运行如下两条命令&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DebugServerConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;riscv64-unknown-elf-gdb *.elf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVKLight_CKLinkLite.gif| BL616DVKLight_CKLinkLite]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=%E9%A6%96%E9%A1%B5&amp;diff=277</id>
		<title>首页</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E9%A6%96%E9%A1%B5&amp;diff=277"/>
		<updated>2026-04-09T07:06:24Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Getting Started =&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bouffalolab/bouffalo_sdk 如何获取SDK]&lt;br /&gt;
* [[如何在Ubuntu上搭建编译环境]]&lt;br /&gt;
* [[如何在Windows上搭建编译环境]]&lt;br /&gt;
* [[如何获取开发板]]&lt;br /&gt;
* [[烧录固件到开发板]]&lt;br /&gt;
* [[DebuggingBouffaloLabChipsWithGDB|如何调试博流开发板]]&lt;br /&gt;
&lt;br /&gt;
= Bouffalo SDK =&lt;br /&gt;
&#039;&#039;&#039;BouffaloSDK&#039;&#039;&#039; 是 Bouffalo Lab 提供的 IOT 和 MCU 软件开发包，支持博流智能所有系列芯片，也是 &#039;&#039;&#039;bl_mcu_sdk&#039;&#039;&#039; 和 &#039;&#039;&#039;bl_iot_sdk&#039;&#039;&#039; 的结合体。&lt;br /&gt;
&lt;br /&gt;
[[文件:BouffaloSDK.png|无框|600x600像素]]&lt;br /&gt;
&lt;br /&gt;
= Peripherals =&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;32%&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
*[[I2S]]&lt;br /&gt;
*[[I2C]]&lt;br /&gt;
*[[CVBS]]&lt;br /&gt;
*[[Watchdog]]&lt;br /&gt;
*[[GSM/GPRS]]&lt;br /&gt;
*[[Codec]]&lt;br /&gt;
*[[PCIe]]&lt;br /&gt;
*[[GPIO]]&lt;br /&gt;
*[[eMMC]]&lt;br /&gt;
|width=&amp;quot;32%&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
*[[WiFi]]&lt;br /&gt;
*[[LED]]&lt;br /&gt;
*[[Serial port]]&lt;br /&gt;
*[[PWM]]&lt;br /&gt;
*[[SPI]]&lt;br /&gt;
*[[USB OTG]]&lt;br /&gt;
*[[LCD]]&lt;br /&gt;
*[[CPU]]&lt;br /&gt;
*[[Network]]&lt;br /&gt;
|width=&amp;quot;32%&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
*[[Bluetooth]]&lt;br /&gt;
*[[HDMI]]&lt;br /&gt;
*[[Camera]]&lt;br /&gt;
*[[Memory]]&lt;br /&gt;
*[[RTC]]&lt;br /&gt;
*[[EEPROM]]&lt;br /&gt;
*[[MIPI-DSI]]&lt;br /&gt;
*[[NPU]]&lt;br /&gt;
*[[VPU]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Products =&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
* [[BL602]]&lt;br /&gt;
* [[BL702]]&lt;br /&gt;
* [[BL618]]&lt;br /&gt;
* [[BL606P]]&lt;br /&gt;
|width=&amp;quot;50%&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
* [[BL702L]]&lt;br /&gt;
* [[BL616]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Develop Boards =&lt;br /&gt;
* BL602EVB&lt;br /&gt;
&lt;br /&gt;
= Application Notes =&lt;br /&gt;
* [[NetHub]]&lt;br /&gt;
* [[BL616低功耗开发手册]]&lt;br /&gt;
* [[USB Wi-Fi用户手册]]&lt;br /&gt;
&lt;br /&gt;
= Demos =&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|width=&amp;quot;32%&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
*[[Demo:FreeRTOS]]&lt;br /&gt;
* [[Demo:wifi sta]]&lt;br /&gt;
* [[Demo:boot2_isp]]&lt;br /&gt;
* [[Demo:helloworld]]&lt;br /&gt;
* [[Demo:smartconfig ble]]&lt;br /&gt;
|width=&amp;quot;32%&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
*[[Demo:DMA]]&lt;br /&gt;
* [[Demo:Btble]]&lt;br /&gt;
* [[Demo:coremark]]&lt;br /&gt;
* [[Demo:littlefs]]&lt;br /&gt;
* [[Demo:posix freertos]]&lt;br /&gt;
|width=&amp;quot;32%&amp;quot; valign=&amp;quot;top&amp;quot; align=&amp;quot;left&amp;quot;|&lt;br /&gt;
*[[Demo:Flash]]&lt;br /&gt;
* [[Demo:Basical case]]&lt;br /&gt;
* [[Demo:dsp]]&lt;br /&gt;
* [[Demo:cks]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=%E4%BD%BF%E7%94%A8GDB%E8%B0%83%E8%AF%95&amp;diff=276</id>
		<title>使用GDB调试</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E4%BD%BF%E7%94%A8GDB%E8%B0%83%E8%AF%95&amp;diff=276"/>
		<updated>2026-04-09T07:05:28Z</updated>

		<summary type="html">&lt;p&gt;张良：​张良移动页面使用GDB调试至DebuggingBouffaloLabChipsWithGDB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#重定向 [[DebuggingBouffaloLabChipsWithGDB]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=275</id>
		<title>DebuggingBouffaloLabChipsWithGDB</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=275"/>
		<updated>2026-04-09T07:05:28Z</updated>

		<summary type="html">&lt;p&gt;张良：​张良移动页面使用GDB调试至DebuggingBouffaloLabChipsWithGDB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 通过CKLink调试DVK light开发板 =&lt;br /&gt;
&lt;br /&gt;
==== 通过USB连接到PC ====&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVK Light CKLinkLite.jpg| 600像素 | BL616DVKLight_CKLinkLite]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 进行GDB调试 ====&lt;br /&gt;
&lt;br /&gt;
这里以Ubuntu为例，此时应该可以看到 &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; 设备（以实际为准）&lt;br /&gt;
&lt;br /&gt;
分别运行如下两条命令&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DebugServerConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;riscv64-unknown-elf-gdb *.elf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVKLight_CKLinkLite.gif| BL616DVKLight_CKLinkLite]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=274</id>
		<title>DebuggingBouffaloLabChipsWithGDB</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=274"/>
		<updated>2026-04-09T07:03:23Z</updated>

		<summary type="html">&lt;p&gt;张良：​/* 进行GDB调试 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 通过CKLink调试DVK light开发板 =&lt;br /&gt;
&lt;br /&gt;
==== 通过USB连接到PC ====&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVK Light CKLinkLite.jpg| 600像素 | BL616DVKLight_CKLinkLite]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 进行GDB调试 ====&lt;br /&gt;
&lt;br /&gt;
这里以Ubuntu为例，此时应该可以看到 &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; 设备（以实际为准）&lt;br /&gt;
&lt;br /&gt;
分别运行如下两条命令&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DebugServerConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;riscv64-unknown-elf-gdb *.elf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVKLight_CKLinkLite.gif| BL616DVKLight_CKLinkLite]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=273</id>
		<title>DebuggingBouffaloLabChipsWithGDB</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=273"/>
		<updated>2026-04-09T07:02:34Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 通过CKLink调试DVK light开发板 =&lt;br /&gt;
&lt;br /&gt;
==== 通过USB连接到PC ====&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVK Light CKLinkLite.jpg| 600像素 | BL616DVKLight_CKLinkLite]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 进行GDB调试 ====&lt;br /&gt;
&lt;br /&gt;
这里以Ubuntu为例，此时应该可以看到 &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; 设备（以实际为准）&lt;br /&gt;
分别运行如下两条命令&lt;br /&gt;
&amp;lt;code&amp;gt;DebugServerConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;riscv64-unknown-elf-gdb *.elf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVKLight_CKLinkLite.gif| BL616DVKLight_CKLinkLite]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:BL616DVK_Light_CKLinkLite.jpg&amp;diff=272</id>
		<title>文件:BL616DVK Light CKLinkLite.jpg</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:BL616DVK_Light_CKLinkLite.jpg&amp;diff=272"/>
		<updated>2026-04-09T07:00:05Z</updated>

		<summary type="html">&lt;p&gt;张良：​BL616DVKLight_CKLinkLite.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 摘要 ==&lt;br /&gt;
BL616DVKLight_CKLinkLite.jpg&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=271</id>
		<title>DebuggingBouffaloLabChipsWithGDB</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=271"/>
		<updated>2026-04-09T06:58:21Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 通过CKLink调试DVK light开发板 =&lt;br /&gt;
&lt;br /&gt;
==== 通过USB连接到PC ====&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVK Light_CKLinkLite.jpg | BL616DVK Light_CKLinkLite]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 进行GDB调试 ====&lt;br /&gt;
&lt;br /&gt;
这里以Ubuntu为例，此时应该可以看到 &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; 设备（以实际为准）&lt;br /&gt;
分别运行如下两条命令&lt;br /&gt;
&amp;lt;code&amp;gt;DebugServerConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;riscv64-unknown-elf-gdb *.elf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVKLight_CKLinkLite.gif| BL616DVKLight_CKLinkLite]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:BL616DVKLight_CKLinkLite.gif&amp;diff=270</id>
		<title>文件:BL616DVKLight CKLinkLite.gif</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:BL616DVKLight_CKLinkLite.gif&amp;diff=270"/>
		<updated>2026-04-09T06:57:24Z</updated>

		<summary type="html">&lt;p&gt;张良：​BL616DVKLight_CKLinkLite.gif&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 摘要 ==&lt;br /&gt;
BL616DVKLight_CKLinkLite.gif&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=269</id>
		<title>DebuggingBouffaloLabChipsWithGDB</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=269"/>
		<updated>2026-04-09T06:55:42Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 通过CKLink调试DVK light开发板 =&lt;br /&gt;
&lt;br /&gt;
==== 通过USB连接到PC ====&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVK Light_CKLinkLite.jpg | BL616DVK Light_CKLinkLite]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 进行GDB调试 ====&lt;br /&gt;
&lt;br /&gt;
这里以Ubuntu为例，此时应该可以看到 &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; 设备（以实际为准）&lt;br /&gt;
分别运行如下两条命令&lt;br /&gt;
&amp;lt;code&amp;gt;DebugServerConsole&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;riscv64-unknown-elf-gdb *.elf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVK Light_CKLinkLite.gif | BL616DVK Light_CKLinkLite]]&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:BL616DVK_Light_CKLinkLite.jpg.jpg&amp;diff=268</id>
		<title>文件:BL616DVK Light CKLinkLite.jpg.jpg</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E6%96%87%E4%BB%B6:BL616DVK_Light_CKLinkLite.jpg.jpg&amp;diff=268"/>
		<updated>2026-04-09T06:54:55Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;BL616DVK Light_CKLinkLite.jpg&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=267</id>
		<title>DebuggingBouffaloLabChipsWithGDB</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=DebuggingBouffaloLabChipsWithGDB&amp;diff=267"/>
		<updated>2026-04-09T06:49:53Z</updated>

		<summary type="html">&lt;p&gt;张良：​创建页面，内容为“  通过CKLink调试DVK light开发板”&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
通过CKLink调试DVK light开发板&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=Windows_wsl_bringup&amp;diff=266</id>
		<title>Windows wsl bringup</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=Windows_wsl_bringup&amp;diff=266"/>
		<updated>2026-04-09T02:22:22Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. Build and Flash the Device Firmware ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -C &amp;quot;your_email@example.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 cd examples/wifi/nethub&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;# BL616&#039;&#039;&lt;br /&gt;
 make CHIP=bl616 BOARD=bl616dk&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;# BL616CL&#039;&#039;&lt;br /&gt;
 make CHIP=bl616cl BOARD=bl616cldk&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;# BL618DG&#039;&#039;&lt;br /&gt;
 make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=ap&lt;br /&gt;
Flash example:&lt;br /&gt;
 cd examples/wifi/nethub&lt;br /&gt;
 make flash CHIP=bl618dg COMX=/dev/ttyUSB0&lt;br /&gt;
&lt;br /&gt;
 make flash CHIP=bl616cl COMX=/dev/ttyUSB0&lt;br /&gt;
&lt;br /&gt;
 make flash CHIP=bl616cl COMX=COM5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
export PATH=$HOME/work/toolchain_riscv_thead_linux64/bin:$PATH&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=Windows_wsl_bringup&amp;diff=265</id>
		<title>Windows wsl bringup</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=Windows_wsl_bringup&amp;diff=265"/>
		<updated>2026-04-08T03:49:13Z</updated>

		<summary type="html">&lt;p&gt;张良：​/* 1. Build and Flash the Device Firmware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. Build and Flash the Device Firmware ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ssh-keygen -t rsa -b 4096 -C &amp;quot;your_email@example.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 cd examples/wifi/nethub&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;# BL616&#039;&#039;&lt;br /&gt;
 make CHIP=bl616 BOARD=bl616dk&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;# BL616CL&#039;&#039;&lt;br /&gt;
 make CHIP=bl616cl BOARD=bl616cldk&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;# BL618DG&#039;&#039;&lt;br /&gt;
 make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=ap&lt;br /&gt;
Flash example:&lt;br /&gt;
 cd examples/wifi/nethub&lt;br /&gt;
 make flash CHIP=bl618dg COMX=/dev/ttyUSB0&lt;br /&gt;
&lt;br /&gt;
 make flash CHIP=bl616cl COMX=/dev/ttyUSB0&lt;br /&gt;
&lt;br /&gt;
 make flash CHIP=bl616cl COMX=COM5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
git clone git@code.bouffalolab.com:liangzhang/bouffalo_sdk_rel.git&lt;br /&gt;
&lt;br /&gt;
git clone git@code.bouffalolab.com:bouffalo_sw/toolchain_riscv_thead_linux64.git&lt;br /&gt;
&lt;br /&gt;
export PATH=$HOME/work/toolchain_riscv_thead_linux64/bin:$PATH&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=Windows_wsl_bringup&amp;diff=264</id>
		<title>Windows wsl bringup</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=Windows_wsl_bringup&amp;diff=264"/>
		<updated>2026-04-08T03:45:27Z</updated>

		<summary type="html">&lt;p&gt;张良：​/* 2. Build and Flash the Device Firmware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. Build and Flash the Device Firmware ==&lt;br /&gt;
 cd examples/wifi/nethub&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;# BL616&#039;&#039;&lt;br /&gt;
 make CHIP=bl616 BOARD=bl616dk&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;# BL616CL&#039;&#039;&lt;br /&gt;
 make CHIP=bl616cl BOARD=bl616cldk&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;# BL618DG&#039;&#039;&lt;br /&gt;
 make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=ap&lt;br /&gt;
Flash example:&lt;br /&gt;
 cd examples/wifi/nethub&lt;br /&gt;
 make flash CHIP=bl618dg COMX=/dev/ttyUSB0&lt;br /&gt;
&lt;br /&gt;
 make flash CHIP=bl616cl COMX=/dev/ttyUSB0&lt;br /&gt;
&lt;br /&gt;
 make flash CHIP=bl616cl COMX=COM5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
git clone git@code.bouffalolab.com:liangzhang/bouffalo_sdk_rel.git&lt;br /&gt;
&lt;br /&gt;
git clone git@code.bouffalolab.com:bouffalo_sw/toolchain_riscv_thead_linux64.git&lt;br /&gt;
&lt;br /&gt;
export PATH=$HOME/work/toolchain_riscv_thead_linux64/bin:$PATH&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=Windows_wsl_bringup&amp;diff=263</id>
		<title>Windows wsl bringup</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=Windows_wsl_bringup&amp;diff=263"/>
		<updated>2026-04-08T03:32:53Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Build and Flash the Device Firmware ==&lt;br /&gt;
 cd examples/wifi/nethub&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;# BL616&#039;&#039;&lt;br /&gt;
 make CHIP=bl616 BOARD=bl616dk&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;# BL616CL&#039;&#039;&lt;br /&gt;
 make CHIP=bl616cl BOARD=bl616cldk&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;# BL618DG&#039;&#039;&lt;br /&gt;
 make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=ap&lt;br /&gt;
Flash example:&lt;br /&gt;
 cd examples/wifi/nethub&lt;br /&gt;
 make flash CHIP=bl618dg COMX=/dev/ttyUSB0&lt;br /&gt;
&lt;br /&gt;
 make flash CHIP=bl616cl COMX=/dev/ttyUSB0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
git clone git@code.bouffalolab.com:liangzhang/bouffalo_sdk_rel.git&lt;br /&gt;
&lt;br /&gt;
git clone git@code.bouffalolab.com:bouffalo_sw/toolchain_riscv_thead_linux64.git&lt;br /&gt;
&lt;br /&gt;
export PATH=$HOME/work/toolchain_riscv_thead_linux64/bin:$PATH&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=Windows_wsl_bringup&amp;diff=262</id>
		<title>Windows wsl bringup</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=Windows_wsl_bringup&amp;diff=262"/>
		<updated>2026-04-08T03:30:36Z</updated>

		<summary type="html">&lt;p&gt;张良：​创建页面，内容为“  git clone git@code.bouffalolab.com:liangzhang/bouffalo_sdk_rel.git  git clone git@code.bouffalolab.com:bouffalo_sw/toolchain_riscv_thead_linux64.git  export PATH=$HOME/work/toolchain_riscv_thead_linux64/bin:$PATH”&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
git clone git@code.bouffalolab.com:liangzhang/bouffalo_sdk_rel.git&lt;br /&gt;
&lt;br /&gt;
git clone git@code.bouffalolab.com:bouffalo_sw/toolchain_riscv_thead_linux64.git&lt;br /&gt;
&lt;br /&gt;
export PATH=$HOME/work/toolchain_riscv_thead_linux64/bin:$PATH&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=%E7%83%A7%E5%BD%95%E5%9B%BA%E4%BB%B6%E5%88%B0%E5%BC%80%E5%8F%91%E6%9D%BF&amp;diff=261</id>
		<title>烧录固件到开发板</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E7%83%A7%E5%BD%95%E5%9B%BA%E4%BB%B6%E5%88%B0%E5%BC%80%E5%8F%91%E6%9D%BF&amp;diff=261"/>
		<updated>2026-04-01T11:00:28Z</updated>

		<summary type="html">&lt;p&gt;张良：​/* 查看运行log */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= 如何烧录到DVK light开发板 =&lt;br /&gt;
&lt;br /&gt;
==== 通过USB连接到PC ====&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVK Light.jpg | BL616DVK_light | 400px]]&lt;br /&gt;
&lt;br /&gt;
这里以Ubuntu为例，此时应该可以看到 &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; 设备（以实际为准）&lt;br /&gt;
&lt;br /&gt;
==== 设备进入烧录模式 ====&lt;br /&gt;
按住 &amp;lt;code&amp;gt;BOOT&amp;lt;/code&amp;gt; 键，trigger 一下 &amp;lt;code&amp;gt;reset&amp;lt;/code&amp;gt; 按键，设备即进入烧录模式&lt;br /&gt;
&lt;br /&gt;
==== 编译并烧录 ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd examples/wifi/sta/wifi_tcp&lt;br /&gt;
make CHIP=bl616 BOARD=bl616dk&lt;br /&gt;
make flash CHIP=bl616 COMX=/dev/ttyACM0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 查看运行log ====&lt;br /&gt;
通过串口终端查看运行的log即可，默认波特率2M（刚烧录完需要手动按一下Reset按键）&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
	<entry>
		<id>https://docs.bouffalolab.com/index.php?title=%E7%83%A7%E5%BD%95%E5%9B%BA%E4%BB%B6%E5%88%B0%E5%BC%80%E5%8F%91%E6%9D%BF&amp;diff=260</id>
		<title>烧录固件到开发板</title>
		<link rel="alternate" type="text/html" href="https://docs.bouffalolab.com/index.php?title=%E7%83%A7%E5%BD%95%E5%9B%BA%E4%BB%B6%E5%88%B0%E5%BC%80%E5%8F%91%E6%9D%BF&amp;diff=260"/>
		<updated>2026-04-01T10:59:24Z</updated>

		<summary type="html">&lt;p&gt;张良：​&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= 如何烧录到DVK light开发板 =&lt;br /&gt;
&lt;br /&gt;
==== 通过USB连接到PC ====&lt;br /&gt;
&lt;br /&gt;
[[文件:BL616DVK Light.jpg | BL616DVK_light | 400px]]&lt;br /&gt;
&lt;br /&gt;
这里以Ubuntu为例，此时应该可以看到 &amp;lt;code&amp;gt;/dev/ttyACM0&amp;lt;/code&amp;gt; 设备（以实际为准）&lt;br /&gt;
&lt;br /&gt;
==== 设备进入烧录模式 ====&lt;br /&gt;
按住 &amp;lt;code&amp;gt;BOOT&amp;lt;/code&amp;gt; 键，trigger 一下 &amp;lt;code&amp;gt;reset&amp;lt;/code&amp;gt; 按键，设备即进入烧录模式&lt;br /&gt;
&lt;br /&gt;
==== 编译并烧录 ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd examples/wifi/sta/wifi_tcp&lt;br /&gt;
make CHIP=bl616 BOARD=bl616dk&lt;br /&gt;
make flash CHIP=bl616 COMX=/dev/ttyACM0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 查看运行log ====&lt;br /&gt;
通过串口终端查看运行的log即可，默认波特率2M&lt;/div&gt;</summary>
		<author><name>张良</name></author>
	</entry>
</feed>