| Age | Commit message (Collapse) | Author |
|
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
optimize usbhs controller port
|
|
musb_fifo_flush() selected the CSR side for device role, which is opposite to
the host direction. Now IN endpoints (host RX) flush RXCSR, OUT endpoints (host
TX) flush TXCSR, and EP0 writes the FLUSHFIFO bit in the csr0 high byte, so a
timed-out/killed bulk OUT no longer leaves TXPKTRDY and the FIFO uncleaned.
|
|
burst freature support
|
|
float and update demo
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
|
|
in isr
Signed-off-by: Zhihong Chen <[email protected]>
|
|
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
is USB_REQUEST_DIR_IN
Signed-off-by: sakumisu <[email protected]>
|
|
Report an error through USB_LOG_ERR when SystemCoreClock does not match
any supported 48/96/144/192/240 MHz divider case, instead of silently
leaving the USBFS prescaler unconfigured.
|
|
- usb_glue_nation.c: match usb_dc_low_level_init/deinit to the (void)
weak stubs in usb_dc_fsdev.c and guard on g_usbdev_bus[0] (the old
(uint8_t busid) signature read garbage at the no-arg call site)
- usb_glue_nation.c: drop NVIC_PriorityGroupConfig from the driver hook;
it reprograms SCB->AIRCR for the whole system, priority grouping now
stays with board/application startup code
- usb_glue_nation.c: derive the USBFS prescaler from SystemCoreClock at
runtime instead of a per-part compile-time table (fixes N32H475
landing in the 240 MHz branch; adapts to any configured PLLCLK)
- add docstrings to the functions touched by this diff
|
|
Add full-speed USB device (USBFS) support for the Nations N32H4x family
(N32H47x_48x and N32H49x), whose Synopsys USBFS core re-arranged the
register and bit-field layout of the STM32 version:
- usb_glue_nation.c: chip-level bring-up (48 MHz USB clock from PLL,
DM/DP GPIO with a weak overridable hook, NVIC USB_FS_LP_IRQn dispatch)
- usb_fsdev_reg.h: re-map USB_EPn/CNTR/ISTR/BTABLE/FN/DADDR register
layout and every affected bit macro for N32H4x (32-bit EP registers,
no BCDR; DP pull-up moved to CNTR.PU)
- usb_dc_fsdev.c: N32H4x power-on sequence (clear PD, wait, clear FRST)
and EP_ID position handling
- README: document the supported N32H4x parts
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: Zhihong Chen <[email protected]>
|
|
Signed-off-by: Zhihong Chen <[email protected]>
|
|
- Add weak usbh_msc_app_run() and usbh_msc_app_stop() callbacks to the
Zephyr MSC disk adapter.
- Invoke the application start callback after registering the disk and
the stop callback before unregistering it, allowing samples to mount
and unmount filesystems without modifying the CherryUSB class driver.
Signed-off-by: Zhihong Chen <[email protected]>
|
|
- The system workqueue may preempt a self-deleting thread after the
release work is submitted. Waiting for the thread with k_thread_join()
before freeing its TCB and stack prevents use-after-free corruption.
- Also handle release work allocation failure before aborting the thread.
Signed-off-by: Zhihong Chen <[email protected]>
|
|
* 添加usb device ncm功能
* fix(class/cdc/usbd_ncm): address review findings
- fix compile failure when CONFIG_USBDEV_CDC_NCM_USING_LWIP is disabled
- fix GET/SET_NTB_INPUT_SIZE operating on the OUT direction size, and
honor the negotiated IN limit in the transmit path
- set tx busy flag before submitting the transfer to avoid a race that
could block transmit permanently
- follow the ndp chain via wNextNdpIndex so chained datagrams are not
dropped, and access ntb fields with LE helpers instead of assuming a
little-endian target
- reject oversized frames instead of transmitting truncated ones
- register endpoints only once when initializing both interfaces
- wait for tx completion with a timeout in the demo instead of an
unbounded busy wait
- make usbd_cdc_ncm.h self-contained
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
CH32FS IP 的 SETUP 中断触发时,INT_ST 端点字段不总为 0(在 CH32L103 和
CH32V203 上实测约 50% 为 4,来自上一次批量事务的残留)。原代码
USB_SET_RX_CTRL(ep_idx, NAK) 会写错 UEP{ep_idx} 寄存器,导致 EP0
停留在 ACK 状态,Windows 存储栈挂载设备前会卡约 20 秒。
(可能影响所有使用 CH32FS IP 的 MCU,但仅在 CH32L103/CH32V203 上验证)
改为固定 NAK EP0(索引 0),并同时 NAK TX 和 RX。其中 TX NAK 一行对
CH32L103 是必需的,缺少会导致设备枚举失败(Windows 设备管理器 Code 10);
WCH CH32FS IP 的 MCU 官方 EVM 代码也都是同时两行 NAK,且官方 SETUP
处理代码同样固定使用 EP0(索引 0)。
同时在支持列表中加入 CH32L103(使用 USBFS)。CH32V20X 有两个 USB IP:
USBD(用 fsdev,与 F103 相同)和 USBFS(用 ch32fs),已在
port/ch32/README.md 中说明。
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
alloc fail
Signed-off-by: sakumisu <[email protected]>
|
|
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
AUDIO_FEEDBACK_TO_BUF_HS_INTERVAL/AUDIO_FEEDBACK_TO_BUF_FS_INTERVAL macros
Signed-off-by: Zhihong Chen <[email protected]>
|
|
parse_config_descriptor (#426)
* fix(usbh): check cur_ep against CONFIG_USBHOST_MAX_ENDPOINTS before writing ep[]
parse_config_descriptor() checks cur_ep_num (the interface descriptor's
self-declared bNumEndpoints) against CONFIG_USBHOST_MAX_ENDPOINTS when
the INTERFACE descriptor is parsed, but cur_ep (the actual write index,
incremented once per ENDPOINT sub-descriptor encountered in the byte
stream) is never bounds-checked in the USB_DESCRIPTOR_TYPE_ENDPOINT
case before the memcpy.
A non-conformant or malicious device can declare a small bNumEndpoints
while still emitting more ENDPOINT descriptors than declared in the
raw config descriptor byte stream, causing cur_ep to exceed
CONFIG_USBHOST_MAX_ENDPOINTS and the memcpy to write past the ep[]
array, past altsetting[], and potentially past the whole
usbh_configuration struct.
Add the same bounds check pattern already used for cur_iface and
cur_alt_setting two cases above, applied to cur_ep before the memcpy.
* Allow interfaces to use configured capacity
Endpoint counts are quantities, so a declaration equal to the endpoint array capacity is valid. The per-index guard still rejects descriptors that contain more endpoint records than the storage can hold.
Constraint: Preserve the new cur_ep index guard
Confidence: high
Scope-risk: narrow
Tested: Real parser matrix for declared/actual 3/3, 4/4, 5/5, and 3/5; MinGW and WSL GCC13 ASan+UBSan
Not-tested: Physical USB device enumeration
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|