NetHubQuickBringup:修订间差异

来自Bouffalo Lab Docs
跳转到导航 跳转到搜索
张良留言 | 贡献
Sync NetHub docs from local Markdown (2026-04-24)
张良留言 | 贡献
Sync NetHub docs from local Markdown (2026-04-24 wording update)
第1行: 第1行:
= NetHub Quick Start =
= NetHub Quick Start =


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.
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.


[[文件:Nethub_sdio_quickstart_demo.gif | NetHub SDIO Quick Start Demo]]
[[文件:Nethub_sdio_quickstart_demo.gif | NetHub SDIO Quick Start Demo]]


== 1. Start with the Current Support Matrix ==
== 1. Current Support Matrix ==


{| class="wikitable"
{| class="wikitable"
第11行: 第11行:
! Item !! Current status
! Item !! Current status
|-
|-
| Recommended end-to-end reference path || <code>SDIO</code>
| Default interface || <code>SDIO</code>
|-
|-
| USB profile || device-side backend implemented with <code>USB ECM + USB ACM</code>
| USB profile || device-side backend implemented with <code>USB ECM + USB ACM</code>
第17行: 第17行:
| SPI profile || not implemented
| SPI profile || not implemented
|-
|-
| USER virtual channel || current in-tree end-to-end path is <code>SDIO</code>
| USER virtual channel || default interface is <code>SDIO</code>
|-
|-
| Optional AT control solution || available, but not required for data-only use cases
| Optional AT control solution || available, but not mandatory
|-
|-
| Low power || currently <code>BL618DG</code> only
| Low power || currently <code>BL618DG</code> only
第27行: 第27行:


* if you want the shortest successful path today, choose <code>SDIO</code>
* if you want the shortest successful path today, choose <code>SDIO</code>
* if you are evaluating the new USB device-side backend, focus on the device profile and USB descriptors first
* if you are evaluating the USB backend, focus on the device profile and USB descriptors first
* do not plan on <code>SPI</code> bring-up yet
* do not plan on <code>SPI</code> bring-up yet


== 2. Decide Whether You Need Only Data or Data Plus Control ==
== 2. Main Configuration Switches ==


NetHub core always focuses on the data plane first.
For most users, the main configuration changes are these:


* data-only products
<syntaxhighlight lang="makefile">
** keep <code>nethub</code>
CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE =y
** do not depend on <code>ATModule</code>
CONFIG_NETHUB_LOWPOWER_ENABLE          =y
** host users simply use the exposed netdev path
CONFIG_NETHUB_PROFILE_USB              =n
* data plus AT-style control products
CONFIG_NETHUB_PROFILE_SDIO            =y
** optionally enable the example composition built around <code>ATModule + bflbwifid + bflbwifictrl</code>
</syntaxhighlight>


The important boundary is:
Notes:


* <code>nethub</code> core does not directly depend on <code>ATModule</code>
* set <code>CONFIG_NETHUB_PROFILE_SDIO=y</code> for the current default interface
* <code>ATModule</code> is an optional example control consumer of the NetHub control-path facade
* set <code>CONFIG_NETHUB_PROFILE_USB=y</code> only when you want to evaluate the USB profile
* <code>CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n</code> means <code>ATModule</code> will not participate in the build
* <code>CONFIG_NETHUB_LOWPOWER_ENABLE=y</code> is currently meaningful only on <code>BL618DG</code>


== 3. Choose the Host-Link Profile ==
Additional current default facts in <code>examples/wifi/nethub/defconfig</code>:


The profile is selected at build time through exactly one <code>CONFIG_NETHUB_PROFILE_*</code> option.
* <code>CONFIG_MR_VIRTUALCHAN=y</code>
 
* <code>CONFIG_NETHUB_AT_USE_VCHAN=n</code>
=== 3.1 SDIO ===
* <code>CONFIG_MR_TTY=n</code>
 
Recommended today.
 
What you get:
 
* current in-tree reference data path
* current in-tree host Linux stack
* current in-tree USER virtual-channel path
 
=== 3.2 USB ===
 
Use this when you specifically want the device-side USB backend.
 
Current device-side behavior:
 
* data path through <code>USB CDC ECM</code>
* control transport plumbing through <code>USB CDC ACM</code>
 
Current limitation:
 
* the in-tree host Linux docs and <code>nethub_vchan</code> wrapper are still centered on the SDIO reference path
 
=== 3.3 SPI ===
 
Not implemented yet.


== 4. Choose the Wi-Fi Backend ==
== 3. Wi-Fi Backend Selection ==


Default configuration:
Default configuration:
第95行: 第72行:
* current NetHub supports both device-side Wi-Fi backends
* current NetHub supports both device-side Wi-Fi backends


== 5. Device Build and Flash ==
== 4. Device Build and Flash ==


Build:
Build:
第119行: 第96行:
</syntaxhighlight>
</syntaxhighlight>


== 6. Important Configuration Switches ==
== 5. Hardware Interface Pins ==
 
Main configuration file:
 
* <code>examples/wifi/nethub/defconfig</code>
 
Important switches:
 
* <code>CONFIG_NETHUB=y</code>
* <code>CONFIG_NETHUB_PROFILE_SDIO=y</code>
* <code>CONFIG_NETHUB_PROFILE_USB=y</code>
* <code>CONFIG_NETHUB_PROFILE_SPI=y</code>
** choose exactly one profile per build
* <code>CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=y</code>
** enable the optional example AT control solution
* <code>CONFIG_MR_VIRTUALCHAN=y</code>
** required for the current in-tree SDIO virtual-channel path
* <code>CONFIG_NETHUB_LOWPOWER_ENABLE=y</code>
** currently meaningful only on <code>BL618DG</code>
 
About <code>CONFIG_NETHUB_AT_USE_VCHAN</code>:
 
* it still exists in the example configuration
* it is best treated as an example or legacy SDIO control-path switch
* do not document it as the core selector for all NetHub interfaces
 
Current default example facts:
 
* <code>CONFIG_NETHUB_PROFILE_SDIO=y</code>
* <code>CONFIG_NETHUB_PROFILE_USB=n</code>
* <code>CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=y</code>
* <code>CONFIG_MR_VIRTUALCHAN=y</code>
* <code>CONFIG_NETHUB_AT_USE_VCHAN=n</code>
* <code>CONFIG_MR_TTY=n</code>
 
== 7. Hardware Interface Pins ==


The pin tables below are the current default mappings used by the in-tree BSP board helpers.
The pin tables below are the current default mappings used by the in-tree BSP board helpers.
第160行: 第102行:
Reference sources in the repository:
Reference sources in the repository:


* SDIO/USB pins
* <code>bsp/board/bl616dk/board_gpio.c</code>
** <code>bsp/board/bl616dk/board_gpio.c</code>
* <code>bsp/board/bl616cldk/board_gpio.c</code>
** <code>bsp/board/bl616cldk/board_gpio.c</code>
* <code>bsp/board/bl618dgdk/board_gpio.c</code>
** <code>bsp/board/bl618dgdk/board_gpio.c</code>


=== 7.1 Default SDIO Pins ===
=== 5.1 Default SDIO Pins ===


These are the current <code>board_sdh_gpio_init()</code> mappings used by the BSP.
These are the current <code>board_sdh_gpio_init()</code> mappings used by the BSP.
第188行: 第129行:
Notes:
Notes:


* this is the current 4-bit SDIO reference wiring used by the NetHub SDIO path
* this table shows the current default 4-bit SDIO wiring used by the NetHub SDIO data-path
* the BSP configures these pins with `GPIO_FUNC_SDH | GPIO_ALTERNATE | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_1`
* 1-line mode is also supported; if you use 1-line mode, keep <code>CMD</code>, <code>CLK</code>, and <code>DAT0</code> first
* if you are doing first bring-up, use this exact mapping first before trying a custom board layout
* the BSP configures these pins with <code>GPIO_FUNC_SDH | GPIO_ALTERNATE | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_1</code>


=== 7.2 Default USB Pins ===
=== 5.2 Default USB Pins ===


The current USB profile uses the board's default USB differential pair.
The current USB profile uses the board's default USB differential pair.
第210行: 第151行:


* for <code>BL616CL</code> and <code>BL618DG</code>, the BSP helper only tells us the USB pair used by the board, not which pin is <code>D+</code> and which pin is <code>D-</code>
* for <code>BL616CL</code> and <code>BL618DG</code>, the BSP helper only tells us the USB pair used by the board, not which pin is <code>D+</code> and which pin is <code>D-</code>
* if you are wiring a custom board and need explicit <code>DP</code> / <code>DM</code> polarity, confirm it from the board schematic or chip/package documentation
* if you are wiring a custom board and need explicit <code>DP</code> / <code>DM</code> polarity, confirm it from the board schematic or chip or package documentation
* 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


== 8. Host Bring-Up Guidance ==
== 6. Host Bring-Up Guidance ==


For the current in-tree host Linux reference stack, use:
For the current in-tree host Linux reference stack, use:
第226行: 第166行:
* host-side transport flattening into the same <code>nethub_vchan</code> behavior as SDIO is not fully documented or aligned in-tree yet
* host-side transport flattening into the same <code>nethub_vchan</code> behavior as SDIO is not fully documented or aligned in-tree yet


== 9. USER Virtual Channel Guidance ==
== 7. USER Virtual Channel ==


If you need private application messages between host and device:
If you need private application messages between host and device, read:


* device API: <code>components/net/nethub/include/nethub_vchan.h</code>
* [[NetHubVirtualChannel|NetHubVirtualChannel.md]]
* host API: <code>bsp/common/msg_router/linux_host/userspace/nethub/virtualchan/nethub_vchan.h</code>


Current reality:
Current reality:


* end-to-end in-tree USER virtual channel is the <code>SDIO</code> path
* the current in-tree end-to-end USER virtual channel follows the default <code>SDIO</code> interface
* the public device API is transport-neutral by design
* the public device API is transport-neutral by design
* the in-tree implementation behind it is still SDIO-backed today
* the in-tree implementation behind it is still SDIO-backed today


== 10. Low-Power Note ==
== 8. Low-Power Note ==
 
Low power is currently supported only on <code>BL618DG</code>.


<code>CONFIG_NETHUB_LOWPOWER_ENABLE</code> is currently supported only on <code>BL618DG</code>. The example configuration automatically disables it on other chips.
If you build for other chips, <code>examples/wifi/nethub/defconfig</code> automatically turns <code>CONFIG_NETHUB_LOWPOWER_ENABLE</code> off. In practice, you usually only need to keep this option enabled when building for <code>BL618DG</code>.


== 11. Where to Go Next ==
== 9. Where to Go Next ==


* overall entry: [[NetHub|NetHub.md]]
* overall entry: [[NetHub|NetHub.md]]
* architecture: [[NetHubArchitecture|NetHubArchitecture.md]]
* architecture: [[NetHubArchitecture|NetHubArchitecture.md]]
* USER virtual channel: [[NetHubVirtualChannel|NetHubVirtualChannel.md]]
* USER virtual channel: [[NetHubVirtualChannel|NetHubVirtualChannel.md]]

2026年4月24日 (五) 14:20的版本

NetHub Quick Start

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.

NetHub SDIO Quick Start Demo

1. Current Support Matrix

Item Current status
Default interface SDIO
USB profile device-side backend implemented with USB ECM + USB ACM
SPI profile not implemented
USER virtual channel default interface is SDIO
Optional AT control solution available, but not mandatory
Low power currently BL618DG only

Read this table literally:

  • if you want the shortest successful path today, choose SDIO
  • if you are evaluating the USB backend, focus on the device profile and USB descriptors first
  • do not plan on SPI bring-up yet

2. Main Configuration Switches

For most users, the main configuration changes are these:

CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE =y
CONFIG_NETHUB_LOWPOWER_ENABLE          =y
CONFIG_NETHUB_PROFILE_USB              =n
CONFIG_NETHUB_PROFILE_SDIO             =y

Notes:

  • set CONFIG_NETHUB_PROFILE_SDIO=y for the current default interface
  • set CONFIG_NETHUB_PROFILE_USB=y only when you want to evaluate the USB profile
  • CONFIG_NETHUB_CTRLCHANNEL_USE_ATMODULE=n means ATModule will not participate in the build
  • CONFIG_NETHUB_LOWPOWER_ENABLE=y is currently meaningful only on BL618DG

Additional current default facts in examples/wifi/nethub/defconfig:

  • CONFIG_MR_VIRTUALCHAN=y
  • CONFIG_NETHUB_AT_USE_VCHAN=n
  • CONFIG_MR_TTY=n

3. Wi-Fi Backend Selection

Default configuration:

  • CONFIG_WL80211 disabled
  • fhost selected

If you want wl80211, enable this in examples/wifi/nethub/defconfig:

CONFIG_WL80211=y

Notes:

  • fhost and wl80211 are mutually exclusive
  • current NetHub supports both device-side Wi-Fi backends

4. Device Build and Flash

Build:

cd examples/wifi/nethub

# BL616
make CHIP=bl616 BOARD=bl616dk

# BL616CL
make CHIP=bl616cl BOARD=bl616cldk

# BL618DG
make CHIP=bl618dg BOARD=bl618dgdk CPU_ID=ap

Flash example:

cd examples/wifi/nethub
make flash CHIP=bl618dg COMX=/dev/ttyUSB0

5. Hardware Interface Pins

The pin tables below are the current default mappings used by the in-tree BSP board helpers.

Reference sources in the repository:

  • bsp/board/bl616dk/board_gpio.c
  • bsp/board/bl616cldk/board_gpio.c
  • bsp/board/bl618dgdk/board_gpio.c

5.1 Default SDIO Pins

These are the current board_sdh_gpio_init() mappings used by the BSP.

Pin Function BL616 / BL618 (bl616dk) BL618DG (bl618dgdk) BL616CL (bl616cldk)
SDIO_DAT2 GPIO10 GPIO43 GPIO6
SDIO_DAT3 GPIO11 GPIO44 GPIO7
SDIO_CMD GPIO12 GPIO45 GPIO8
SDIO_CLK GPIO13 GPIO46 GPIO9
SDIO_DAT0 GPIO14 GPIO47 GPIO10
SDIO_DAT1 GPIO15 GPIO48 GPIO11

Notes:

  • this table shows the current default 4-bit SDIO wiring used by the NetHub SDIO data-path
  • 1-line mode is also supported; if you use 1-line mode, keep CMD, CLK, and DAT0 first
  • the BSP configures these pins with GPIO_FUNC_SDH | GPIO_ALTERNATE | GPIO_PULLUP | GPIO_SMT_EN | GPIO_DRV_1

5.2 Default USB Pins

The current USB profile uses the board's default USB differential pair.

Chip / Board family Default USB pins in current BSP Current BSP behavior Notes
BL616 / BL618 (bl616dk) board default USB port path current BSP enables USB clock in board.c, but does not expose a dedicated board_usb_gpio_init() helper treat this as the board's fixed default USB routing in the current example
BL616CL (bl616cldk) GPIO32, GPIO33 board_usb_gpio_init() configures the pair as analog pins current BSP documents the pair, not separate DP / DM labels
BL618DG (bl618dgdk) GPIO40, GPIO41 board_usb_gpio_init() configures the pair as analog pins current BSP documents the pair, not separate DP / DM labels

Notes:

  • for BL616CL and BL618DG, the BSP helper only tells us the USB pair used by the board, not which pin is D+ and which pin is D-
  • if you are wiring a custom board and need explicit DP / DM polarity, confirm it from the board schematic or chip or package documentation

6. Host Bring-Up Guidance

For the current in-tree host Linux reference stack, use:

  • bsp/common/msg_router/linux_host/userspace/nethub/README.md

Today that host stack is primarily the SDIO reference flow.

For USB projects, keep expectations aligned with current code status:

  • device-side ECM + ACM backend exists
  • host-side transport flattening into the same nethub_vchan behavior as SDIO is not fully documented or aligned in-tree yet

7. USER Virtual Channel

If you need private application messages between host and device, read:

Current reality:

  • the current in-tree end-to-end USER virtual channel follows the default SDIO interface
  • the public device API is transport-neutral by design
  • the in-tree implementation behind it is still SDIO-backed today

8. Low-Power Note

Low power is currently supported only on BL618DG.

If you build for other chips, examples/wifi/nethub/defconfig automatically turns CONFIG_NETHUB_LOWPOWER_ENABLE off. In practice, you usually only need to keep this option enabled when building for BL618DG.

9. Where to Go Next