| 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]>
|
|
or deinit
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
usbh_kill_urb() derived both the channel to mask and the channel to flush from
the endpoint number ((urb->ep->bEndpointAddress & 0x0f) and bEndpointAddress
itself), which only holds when the channel number equals the endpoint number.
When MUSB_SIFLI_EP_MAP is in use the channel is assigned by
sifli_ep_map_alloc(): the SiFli 52/56 host channels are pooled per direction
(IN ch1..ch4, OUT ch5..ch7), so e.g. EP1 OUT lives on ch5 and EP2 OUT on ch6.
Masking by endpoint number therefore clears the interrupt enable of an
unrelated channel and leaves the aborted channel's interrupt armed, and
musb_fifo_flush() is asked to clean the FIFO of a different endpoint than the
one the URB was using.
Take the channel from pipe->chidx, which is the channel the URB was submitted
on, and rebuild the byte musb_fifo_flush() expects (direction in bit7, channel
in bits 6:0). Non-mapped MUSB ports keep their previous behaviour.
EP0 is unaffected either way: with chidx 0 and bEndpointAddress 0 both forms
resolve to bit 0 and byte 0.
|
|
The data channels re-arm their interrupt enable in their own
musb_bulk_urb_init()/musb_intr_urb_init()/musb_iso_urb_init(), but the EP0
path never did: TXIE.EP0 was only ever set once, in usb_hc_init().
usbh_kill_urb() masks the interrupt of the channel that owns the abandoned
URB, and EP0 always lives on channel 0, so aborting a single control transfer
clears TXIE.EP0 for good. Every later control transfer then completes in the
hardware but never raises an EP0 interrupt, so usbh_submit_urb() runs into
errout_timeout (-USB_ERR_TIMEOUT) and enumeration can never succeed again
until the next usb_hc_init().
Seen on a host that lost its peer in the middle of enumeration (phone reboot
or re-plug): one control transfer timed out during the port reset and every
following one repeated "Failed to get device descriptor, errorcode:-14"
forever, until the board was rebooted.
Arming TXIE.EP0 here keeps EP0 symmetric with the data channels, so a single
timed-out control transfer no longer disables EP0 for the rest of the session.
|
|
first then can disable ep, refs: #462
Signed-off-by: sakumisu <[email protected]>
|
|
this
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
On the SiFli 52/56 series the MUSB host channels are direction-limited (ch2-ch4 are IN-only, ch5-ch7 are OUT-only, ch1 can do both; ch0 is EP0), but the first-free channel allocation is direction-blind and can assign a channel that cannot carry the transfer.
Allocate channels through a per-direction endpoint map instead: each (direction, endpoint number) pair keeps a dedicated channel from the correct pool while its URBs are in flight, and the slot is freed when the pipe is released. Busy and map-failure collisions are logged.
Fixes USB tethering transfer failures with phones whose RNDIS data endpoints are EP1 IN + EP1 OUT (e.g. OPPO) or numbered above 7 (e.g. EP14/EP15; numbers 1-15 all work since they only live in the 4-bit TEP field). The generic musb_pipe_alloc() path is kept for other MUSB ports.
|
|
|
|
packet feature
|
|
|
|
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]>
|
|
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
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
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: Zhihong Chen <[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 中说明。
|
|
alloc fail
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
Signed-off-by: sakumisu <[email protected]>
|
|
��USBHS支持 (#422)
* 1、usb_hc.h中struct usbh_urb结构体添加defined(__CC_ARM)判断,MDK AC5编译器不支持struct usbh_iso_frame_packet iso_packet[0]只支持struct usbh_iso_frame_packet *iso_packet
2、usb_glue_nation.c中添加N32H49X和N32H7XX系列MCU的USBHS支持
* 回退对usb_hc.h的修改
|
|
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]>
|