Skip to content

Commit 3849966

Browse files
sakumisuRbb666
authored andcommitted
update(cherryusb): update to v1.5.2
Signed-off-by: sakumisu <[email protected]>
1 parent 1ce9fa6 commit 3849966

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+955
-697
lines changed

components/drivers/usb/cherryusb/Kconfig.rttpkg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,14 @@ if PKG_USING_CHERRYUSB
465465

466466
choice
467467
prompt "Version"
468-
default PKG_USING_CHERRYUSB_V010500
468+
default PKG_USING_CHERRYUSB_V010502
469469
help
470470
Select the package version
471471

472472
config PKG_USING_CHERRYUSB_LATEST_VERSION
473473
bool "latest"
474+
config PKG_USING_CHERRYUSB_V010502
475+
bool "v1.5.2"
474476
config PKG_USING_CHERRYUSB_V010501
475477
bool "v1.5.1"
476478
config PKG_USING_CHERRYUSB_V010500
@@ -488,6 +490,7 @@ if PKG_USING_CHERRYUSB
488490
config PKG_CHERRYUSB_VER
489491
string
490492
default "latest" if PKG_USING_CHERRYUSB_LATEST_VERSION
493+
default "v1.5.2" if PKG_USING_CHERRYUSB_V010502
491494
default "v1.5.1" if PKG_USING_CHERRYUSB_V010501
492495
default "v1.5.0" if PKG_USING_CHERRYUSB_V010500
493496
default "v1.4.3" if PKG_USING_CHERRYUSB_V010403

components/drivers/usb/cherryusb/README_zh.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ CherryUSB 是一个小而美的、可移植性高的、用于嵌入式系统(
4040
- 长度无限制,方便对接硬件 DMA 并且发挥 DMA 的优势
4141
- 分包过程在中断中执行
4242

43+
性能展示:https://cherryusb.cherry-embedded.org/show/
44+
4345
## 目录结构
4446

4547
| 目录名 | 描述 |
@@ -103,7 +105,7 @@ CherryUSB Host 协议栈当前实现以下功能:
103105
- 支持阻塞式传输和异步传输
104106
- 支持复合设备
105107
- 支持多级 HUB,最高可拓展到 7 级(目前测试 1拖 10 没有问题,仅支持 dwc2/ehci/xhci/rp2040)
106-
- 支持 Communication Device Class (CDC_ACM, CDC_ECM)
108+
- 支持 Communication Device Class (CDC_ACM, CDC_ECM, CDC_NCM)
107109
- 支持 Human Interface Device (HID)
108110
- 支持 Mass Storage Class (MSC)
109111
- Support USB Video CLASS (UVC1.0、UVC1.5)
@@ -141,7 +143,7 @@ CherryUSB Host 协议栈资源占用说明(GCC 10.2 with -O2,关闭 log)
141143
#define CONFIG_USBHOST_MAX_EXTHUBS 1
142144
#define CONFIG_USBHOST_MAX_EHPORTS 4
143145
#define CONFIG_USBHOST_MAX_INTERFACES 8
144-
#define CONFIG_USBHOST_MAX_INTF_ALTSETTINGS 8
146+
#define CONFIG_USBHOST_MAX_INTF_ALTSETTINGS 2
145147
#define CONFIG_USBHOST_MAX_ENDPOINTS 4
146148
```
147149

@@ -187,24 +189,25 @@ TODO
187189

188190
## 示例仓库
189191

190-
| Manufacturer | CHIP or Series | USB IP| Repo Url | Support version | Support status |
192+
| Manufacturer | CHIP or Series | USB IP| Repo Url | Support version | Note |
191193
|:--------------------:|:------------------:|:-----:|:--------:|:------------------:|:-------------:|
192-
|Bouffalolab | BL702/BL616/BL808 | bouffalolab/ehci|[bouffalo_sdk](https://github.com/CherryUSB/bouffalo_sdk)|<= latest | Long-term |
193-
|ST | STM32F1x/STM32F4/STM32H7 | fsdev/dwc2 |[stm32_repo](https://github.com/CherryUSB/cherryusb_stm32)|<= latest | Long-term |
194-
|HPMicro | HPM6000/HPM5000 | hpm/ehci |[hpm_sdk](https://github.com/CherryUSB/hpm_sdk)|<= latest | Long-term |
195-
|Essemi | ES32F36xx | musb |[es32f369_repo](https://github.com/CherryUSB/cherryusb_es32)|<= latest | Long-term |
196-
|Phytium | e2000 | pusb2/xhci |[phytium_repo](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk)|>=1.4.0 | Long-term |
197-
|Artinchip | d12x/d13x/d21x | aic/ehci/ohci |[luban-lite](https://gitee.com/artinchip/luban-lite)|<= latest | Long-term |
198-
|Espressif | esp32s2/esp32s3/esp32p4 | dwc2 |[esp32_repo](https://github.com/CherryUSB/cherryusb_esp32)|<= latest | Long-term |
199-
|NXP | mcx | kinetis/chipidea/ehci |[nxp_mcx_repo](https://github.com/CherryUSB/cherryusb_mcx)|<= latest | Long-term |
200-
|Kendryte | k230 | dwc2 |[k230_repo](https://github.com/CherryUSB/k230_sdk)|v1.2.0 | Long-term |
201-
|Actionstech | ATS30xx | dwc2 |[action_zephyr_repo](https://github.com/CherryUSB/lv_port_actions_technology/tree/master/action_technology_sdk)|>=1.4.0 | Long-term |
202-
|Nationstech | n32h4x | dwc2 |[nation_repo](https://github.com/CherryUSB/cherryusb_nation)|>=1.5.0 | Long-term |
203-
|Raspberry pi | rp2040/rp2350 | rp2040 |[pico-examples](https://github.com/CherryUSB/pico-examples)|<= latest | Long-term |
204-
|AllwinnerTech | F1C100S/F1C200S | musb |[cherryusb_rtt_f1c100s](https://github.com/CherryUSB/cherryusb_rtt_f1c100s)|<= latest | the same with musb |
205-
|Bekencorp | bk7256/bk7258 | musb |[bk_idk](https://github.com/CherryUSB/bk_idk)| v0.7.0 | the same with musb |
206-
|Sophgo | cv18xx | dwc2 |[cvi_alios_open](https://github.com/CherryUSB/cvi_alios_open)| v0.7.0 | TBD |
207-
|WCH | CH32V307/ch58x | ch32_usbfs/ch32_usbhs/ch58x |[wch_repo](https://github.com/CherryUSB/cherryusb_wch)|<= v0.10.2/>=v1.5.0 | TBD |
194+
|Bouffalolab | BL702/BL616/BL808 | bouffalolab/ehci|[bouffalo_sdk](https://github.com/CherryUSB/bouffalo_sdk)|<= latest | Official |
195+
|ST | STM32F1x/STM32F4/STM32H7 | fsdev/dwc2 |[stm32_repo](https://github.com/CherryUSB/cherryusb_stm32)|<= latest | Community |
196+
|HPMicro | HPM6000/HPM5000 | hpm/ehci |[hpm_sdk](https://github.com/CherryUSB/hpm_sdk)|<= latest | Official |
197+
|Essemi | ES32F36xx | musb |[es32f369_repo](https://github.com/CherryUSB/cherryusb_es32)|<= latest | Official |
198+
|Phytium | e2000 | pusb2/xhci |[phytium_repo](https://gitee.com/phytium_embedded/phytium-free-rtos-sdk)|>=1.4.0 | Official |
199+
|Artinchip | d12x/d13x/d21x | aic/ehci/ohci |[luban-lite](https://gitee.com/artinchip/luban-lite)|<= latest | Official |
200+
|Espressif | esp32s2/esp32s3/esp32p4 | dwc2 |[esp32_repo](https://github.com/CherryUSB/cherryusb_esp32)|<= latest | Official ongoing |
201+
|Kendryte | k230 | dwc2 |[k230_repo](https://github.com/CherryUSB/k230_sdk)|v1.2.0 | Official |
202+
|Actionstech | ATS30xx | dwc2 |[action_zephyr_repo](https://github.com/CherryUSB/lv_port_actions_technology/tree/master/action_technology_sdk)|>=1.4.0 | Official |
203+
|SiFli | SF32LB5x | musb |[SiFli_sdk](https://github.com/OpenSiFli/SiFli-SDK)|>=1.5.0 | Official |
204+
|NXP | mcx | kinetis/chipidea/ehci |[nxp_mcx_repo](https://github.com/CherryUSB/cherryusb_mcx)|<= latest | Community |
205+
|Nationstech | n32h4x | dwc2 |[nation_repo](https://github.com/CherryUSB/cherryusb_nation)|>=1.5.0 | Official ongoing |
206+
|Raspberry pi | rp2040/rp2350 | rp2040 |[pico-sdk](https://github.com/CherryUSB/pico-sdk)|<= latest | Official ongoing |
207+
|AllwinnerTech | F1C100S/F1C200S | musb |[cherryusb_rtt_f1c100s](https://github.com/CherryUSB/cherryusb_rtt_f1c100s)|<= latest | no more update |
208+
|Bekencorp | bk7256/bk7258 | musb |[bk_idk](https://github.com/CherryUSB/bk_idk)| v0.7.0 | Official |
209+
|Sophgo | cv18xx | dwc2 |[cvi_alios_open](https://github.com/CherryUSB/cvi_alios_open)| v0.7.0 | Official |
210+
|WCH | CH32V307/ch58x | ch32_usbfs/ch32_usbhs/ch58x |[wch_repo](https://github.com/CherryUSB/cherryusb_wch)|<= v0.10.2/>=v1.5.0 | no more update |
208211

209212
## 软件包支持
210213

@@ -228,5 +231,4 @@ CherryUSB 微信群:与我联系后邀请加入
228231

229232
感谢以下企业支持(顺序不分先后):
230233

231-
<img src="docs/assets/bouffalolab.jpg" width="100" height="80"/> <img src="docs/assets/hpmicro.jpg" width="100" height="80" /> <img src="docs/assets/eastsoft.jpg" width="100" height="80" /> <img src="docs/assets/rtthread.jpg" width="100" height="80" /> <img src="docs/assets/sophgo.jpg" width="100" height="80" /> <img src="docs/assets/phytium.jpg" width="100" height="80" /> <img src="docs/assets/thead.jpg" width="100" height="80" /> <img src="docs/assets/nuvoton.jpg" width="100" height="80" /> <img src="docs/assets/artinchip.jpg" width="100" height="80" /> <img src="docs/assets/bekencorp.jpg" width="100" height="80" /> <img src="docs/assets/nxp.png" width="100" height="80" /> <img src="docs/assets/espressif.png" width="100" height="80" /> <img src="docs/assets/canaan.jpg" width="100" height="80" />
232-
<img src="docs/assets/actions.jpg" width="100" height="80" /> <img src="docs/assets/nationstech.jpg" width="100" height="80" />
234+
<img src="docs/assets/bouffalolab.jpg" width="100" height="80"/> <img src="docs/assets/hpmicro.jpg" width="100" height="80" /> <img src="docs/assets/eastsoft.jpg" width="100" height="80" /> <img src="docs/assets/rtthread.jpg" width="100" height="80" /> <img src="docs/assets/sophgo.jpg" width="100" height="80" /> <img src="docs/assets/phytium.jpg" width="100" height="80" /> <img src="docs/assets/thead.jpg" width="100" height="80" /> <img src="docs/assets/nuvoton.jpg" width="100" height="80" /> <img src="docs/assets/artinchip.jpg" width="100" height="80" /> <img src="docs/assets/bekencorp.jpg" width="100" height="80" /> <img src="docs/assets/nxp.png" width="100" height="80" /> <img src="docs/assets/espressif.png" width="100" height="80" /> <img src="docs/assets/canaan.jpg" width="100" height="80" /> <img src="docs/assets/actions.jpg" width="100" height="80" /> <img src="docs/assets/sifli.jpg" width="100" height="80" /> <img src="docs/assets/nationstech.jpg" width="100" height="80" />

components/drivers/usb/cherryusb/SConscript

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ if GetDepend(['RT_CHERRYUSB_DEVICE']):
9090
if GetDepend(['RT_CHERRYUSB_DEVICE_BL']):
9191
src += Glob('port/bouffalolab/usb_dc_bl.c')
9292
if GetDepend(['RT_CHERRYUSB_DEVICE_HPM']):
93+
path += [cwd + '/port/hpmicro']
9394
src += Glob('port/hpmicro/usb_dc_hpm.c')
9495
src += Glob('port/hpmicro/usb_glue_hpm.c')
9596
if GetDepend(['RT_CHERRYUSB_DEVICE_AIC']):
@@ -184,6 +185,7 @@ if GetDepend(['RT_CHERRYUSB_HOST']):
184185
src += Glob('port/ehci/usb_hc_ehci.c')
185186
src += Glob('port/ehci/usb_glue_bouffalo.c')
186187
if GetDepend(['RT_CHERRYUSB_HOST_EHCI_HPM']):
188+
path += [cwd + '/port/hpmicro']
187189
src += Glob('port/ehci/usb_hc_ehci.c')
188190
src += Glob('port/hpmicro/usb_hc_hpm.c')
189191
src += Glob('port/hpmicro/usb_glue_hpm.c')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
VERSION_MAJOR = 1
22
VERSION_MINOR = 5
3-
PATCHLEVEL = 1
3+
PATCHLEVEL = 2
44
VERSION_TWEAK = 0
55
EXTRAVERSION = 0

components/drivers/usb/cherryusb/cherryusb_config_template.h

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
#define CONFIG_USBHOST_MAX_EXTHUBS 1
155155
#define CONFIG_USBHOST_MAX_EHPORTS 4
156156
#define CONFIG_USBHOST_MAX_INTERFACES 8
157-
#define CONFIG_USBHOST_MAX_INTF_ALTSETTINGS 8
157+
#define CONFIG_USBHOST_MAX_INTF_ALTSETTINGS 2
158158
#define CONFIG_USBHOST_MAX_ENDPOINTS 4
159159

160160
#define CONFIG_USBHOST_MAX_CDC_ACM_CLASS 4
@@ -250,22 +250,11 @@
250250
/* ================ USB Device Port Configuration ================*/
251251

252252
#ifndef CONFIG_USBDEV_MAX_BUS
253-
#define CONFIG_USBDEV_MAX_BUS 1 // for now, bus num must be 1 except hpm ip
254-
#endif
255-
256-
#ifndef CONFIG_USBDEV_EP_NUM
257-
#define CONFIG_USBDEV_EP_NUM 8
253+
#define CONFIG_USBDEV_MAX_BUS 1
258254
#endif
259255

260256
// #define CONFIG_USBDEV_SOF_ENABLE
261257

262-
/* When your chip hardware supports high-speed and wants to initialize it in high-speed mode,
263-
* the relevant IP will configure the internal or external high-speed PHY according to CONFIG_USB_HS.
264-
*
265-
* in xxx32 chips, only pb14/pb15 can support hs mode, pa11/pa12 is not supported(only a few supports, but we ignore them).
266-
*/
267-
// #define CONFIG_USB_HS
268-
269258
/* ---------------- FSDEV Configuration ---------------- */
270259
//#define CONFIG_USBDEV_FSDEV_PMA_ACCESS 2 // maybe 1 or 2, many chips may have a difference
271260

@@ -276,22 +265,19 @@
276265
// #define CONFIG_USB_DWC2_DMA_ENABLE
277266

278267
/* ---------------- MUSB Configuration ---------------- */
268+
#define CONFIG_USB_MUSB_EP_NUM 8
279269
// #define CONFIG_USB_MUSB_SUNXI
280270

281271
/* ================ USB Host Port Configuration ==================*/
282272
#ifndef CONFIG_USBHOST_MAX_BUS
283273
#define CONFIG_USBHOST_MAX_BUS 1
284274
#endif
285275

286-
#ifndef CONFIG_USBHOST_PIPE_NUM
287-
#define CONFIG_USBHOST_PIPE_NUM 10
288-
#endif
289-
290276
/* ---------------- EHCI Configuration ---------------- */
291277

292278
#define CONFIG_USB_EHCI_HCCR_OFFSET (0x0)
293279
#define CONFIG_USB_EHCI_FRAME_LIST_SIZE 1024
294-
#define CONFIG_USB_EHCI_QH_NUM CONFIG_USBHOST_PIPE_NUM
280+
#define CONFIG_USB_EHCI_QH_NUM 10
295281
#define CONFIG_USB_EHCI_QTD_NUM (CONFIG_USB_EHCI_QH_NUM * 3)
296282
#define CONFIG_USB_EHCI_ITD_NUM 4
297283
// #define CONFIG_USB_EHCI_HCOR_RESERVED_DISABLE
@@ -302,16 +288,27 @@
302288

303289
/* ---------------- OHCI Configuration ---------------- */
304290
#define CONFIG_USB_OHCI_HCOR_OFFSET (0x0)
305-
#define CONFIG_USB_OHCI_ED_NUM CONFIG_USBHOST_PIPE_NUM
291+
#define CONFIG_USB_OHCI_ED_NUM 10
306292
#define CONFIG_USB_OHCI_TD_NUM 3
307293
// #define CONFIG_USB_OHCI_DESC_DCACHE_ENABLE
308294

309295
/* ---------------- XHCI Configuration ---------------- */
310296
#define CONFIG_USB_XHCI_HCCR_OFFSET (0x0)
311297

298+
/* ---------------- DWC2 Configuration ---------------- */
299+
// nothing to define
300+
312301
/* ---------------- MUSB Configuration ---------------- */
302+
#define CONFIG_USB_MUSB_PIPE_NUM 8
313303
// #define CONFIG_USB_MUSB_SUNXI
314304

305+
/* When your chip hardware supports high-speed and wants to initialize it in high-speed mode,
306+
* the relevant IP will configure the internal or external high-speed PHY according to CONFIG_USB_HS.
307+
*
308+
* in xxx32 chips, only pb14/pb15 can support hs mode, pa11/pa12 is not supported(only a few supports, but we ignore them).
309+
*/
310+
// #define CONFIG_USB_HS
311+
315312
#ifndef usb_phyaddr2ramaddr
316313
#define usb_phyaddr2ramaddr(addr) (addr)
317314
#endif

components/drivers/usb/cherryusb/class/cdc/usbh_cdc_ecm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static int usbh_cdc_ecm_connect(struct usbh_hubport *hport, uint8_t intf)
121121
}
122122

123123
memset(mac_buffer, 0, 12);
124-
ret = usbh_get_string_desc(cdc_ecm_class->hport, mac_str_idx, (uint8_t *)mac_buffer);
124+
ret = usbh_get_string_desc(cdc_ecm_class->hport, mac_str_idx, (uint8_t *)mac_buffer, 12);
125125
if (ret < 0) {
126126
return ret;
127127
}

components/drivers/usb/cherryusb/class/cdc/usbh_cdc_ncm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static int usbh_cdc_ncm_connect(struct usbh_hubport *hport, uint8_t intf)
148148
}
149149

150150
memset(mac_buffer, 0, 12);
151-
ret = usbh_get_string_desc(cdc_ncm_class->hport, mac_str_idx, (uint8_t *)mac_buffer);
151+
ret = usbh_get_string_desc(cdc_ncm_class->hport, mac_str_idx, (uint8_t *)mac_buffer, 12);
152152
if (ret < 0) {
153153
return ret;
154154
}

components/drivers/usb/cherryusb/class/hub/usbh_hub.c

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,15 @@ static int parse_hub_descriptor(struct usb_hub_descriptor *desc, uint16_t length
179179
USB_LOG_ERR("unexpected descriptor 0x%02x\r\n", desc->bDescriptorType);
180180
return -2;
181181
} else {
182-
USB_LOG_RAW("Hub Descriptor:\r\n");
183-
USB_LOG_RAW("bLength: 0x%02x \r\n", desc->bLength);
184-
USB_LOG_RAW("bDescriptorType: 0x%02x \r\n", desc->bDescriptorType);
185-
USB_LOG_RAW("bNbrPorts: 0x%02x \r\n", desc->bNbrPorts);
186-
USB_LOG_RAW("wHubCharacteristics: 0x%04x \r\n", desc->wHubCharacteristics);
187-
USB_LOG_RAW("bPwrOn2PwrGood: 0x%02x \r\n", desc->bPwrOn2PwrGood);
188-
USB_LOG_RAW("bHubContrCurrent: 0x%02x \r\n", desc->bHubContrCurrent);
189-
USB_LOG_RAW("DeviceRemovable: 0x%02x \r\n", desc->DeviceRemovable);
190-
USB_LOG_RAW("PortPwrCtrlMask: 0x%02x \r\n", desc->PortPwrCtrlMask);
182+
USB_LOG_DBG("Hub Descriptor:\r\n");
183+
USB_LOG_DBG("bLength: 0x%02x \r\n", desc->bLength);
184+
USB_LOG_DBG("bDescriptorType: 0x%02x \r\n", desc->bDescriptorType);
185+
USB_LOG_DBG("bNbrPorts: 0x%02x \r\n", desc->bNbrPorts);
186+
USB_LOG_DBG("wHubCharacteristics: 0x%04x \r\n", desc->wHubCharacteristics);
187+
USB_LOG_DBG("bPwrOn2PwrGood: 0x%02x \r\n", desc->bPwrOn2PwrGood);
188+
USB_LOG_DBG("bHubContrCurrent: 0x%02x \r\n", desc->bHubContrCurrent);
189+
USB_LOG_DBG("DeviceRemovable: 0x%02x \r\n", desc->DeviceRemovable);
190+
USB_LOG_DBG("PortPwrCtrlMask: 0x%02x \r\n", desc->PortPwrCtrlMask);
191191
}
192192
return 0;
193193
}
@@ -203,14 +203,14 @@ static int parse_hub_ss_descriptor(struct usb_hub_ss_descriptor *desc, uint16_t
203203
USB_LOG_ERR("unexpected descriptor 0x%02x\r\n", desc->bDescriptorType);
204204
return -2;
205205
} else {
206-
USB_LOG_RAW("SuperSpeed Hub Descriptor:\r\n");
207-
USB_LOG_RAW("bLength: 0x%02x \r\n", desc->bLength);
208-
USB_LOG_RAW("bDescriptorType: 0x%02x \r\n", desc->bDescriptorType);
209-
USB_LOG_RAW("bNbrPorts: 0x%02x \r\n", desc->bNbrPorts);
210-
USB_LOG_RAW("wHubCharacteristics: 0x%04x \r\n", desc->wHubCharacteristics);
211-
USB_LOG_RAW("bPwrOn2PwrGood: 0x%02x \r\n", desc->bPwrOn2PwrGood);
212-
USB_LOG_RAW("bHubContrCurrent: 0x%02x \r\n", desc->bHubContrCurrent);
213-
USB_LOG_RAW("DeviceRemovable: 0x%02x \r\n", desc->DeviceRemovable);
206+
USB_LOG_DBG("SuperSpeed Hub Descriptor:\r\n");
207+
USB_LOG_DBG("bLength: 0x%02x \r\n", desc->bLength);
208+
USB_LOG_DBG("bDescriptorType: 0x%02x \r\n", desc->bDescriptorType);
209+
USB_LOG_DBG("bNbrPorts: 0x%02x \r\n", desc->bNbrPorts);
210+
USB_LOG_DBG("wHubCharacteristics: 0x%04x \r\n", desc->wHubCharacteristics);
211+
USB_LOG_DBG("bPwrOn2PwrGood: 0x%02x \r\n", desc->bPwrOn2PwrGood);
212+
USB_LOG_DBG("bHubContrCurrent: 0x%02x \r\n", desc->bHubContrCurrent);
213+
USB_LOG_DBG("DeviceRemovable: 0x%02x \r\n", desc->DeviceRemovable);
214214
}
215215
return 0;
216216
}
@@ -403,7 +403,7 @@ static int usbh_hub_connect(struct usbh_hubport *hport, uint8_t intf)
403403

404404
for (uint8_t port = 0; port < hub->nports; port++) {
405405
ret = usbh_hub_get_portstatus(hub, port + 1, &port_status);
406-
USB_LOG_INFO("port %u, status:0x%02x, change:0x%02x\r\n", port + 1, port_status.wPortStatus, port_status.wPortChange);
406+
USB_LOG_DBG("port %u, status:0x%03x, change:0x%02x\r\n", port + 1, port_status.wPortStatus, port_status.wPortChange);
407407
if (ret < 0) {
408408
return ret;
409409
}
@@ -497,7 +497,7 @@ static void usbh_hub_events(struct usbh_hub *hub)
497497
portstatus = port_status.wPortStatus;
498498
portchange = port_status.wPortChange;
499499

500-
USB_LOG_DBG("port %u, status:0x%02x, change:0x%02x\r\n", port + 1, portstatus, portchange);
500+
USB_LOG_DBG("port %u, status:0x%03x, change:0x%02x\r\n", port + 1, portstatus, portchange);
501501

502502
/* First, clear all change bits */
503503
mask = 1;
@@ -532,7 +532,7 @@ static void usbh_hub_events(struct usbh_hub *hub)
532532
portstatus = port_status.wPortStatus;
533533
portchange = port_status.wPortChange;
534534

535-
USB_LOG_DBG("Port %u, status:0x%02x, change:0x%02x\r\n", port + 1, portstatus, portchange);
535+
USB_LOG_DBG("Port %u, status:0x%03x, change:0x%02x\r\n", port + 1, portstatus, portchange);
536536

537537
if (!(portchange & HUB_PORT_STATUS_C_CONNECTION) &&
538538
((portstatus & HUB_PORT_STATUS_CONNECTION) == connection)) {
@@ -562,7 +562,7 @@ static void usbh_hub_events(struct usbh_hub *hub)
562562
if (portstatus & HUB_PORT_STATUS_CONNECTION) {
563563
ret = usbh_hub_set_feature(hub, port + 1, HUB_PORT_FEATURE_RESET);
564564
if (ret < 0) {
565-
USB_LOG_ERR("Failed to reset port %u,errorcode:%d\r\n", port, ret);
565+
USB_LOG_ERR("Failed to reset port %u, errorcode: %d\r\n", port + 1, ret);
566566
continue;
567567
}
568568

@@ -576,11 +576,15 @@ static void usbh_hub_events(struct usbh_hub *hub)
576576

577577
portstatus = port_status.wPortStatus;
578578
portchange = port_status.wPortChange;
579+
580+
USB_LOG_DBG("Port %u, status:0x%03x, change:0x%02x\r\n", port + 1, portstatus, portchange);
581+
579582
if (!(portstatus & HUB_PORT_STATUS_RESET) && (portstatus & HUB_PORT_STATUS_ENABLE)) {
580583
if (portchange & HUB_PORT_STATUS_C_RESET) {
581584
ret = usbh_hub_clear_feature(hub, port + 1, HUB_PORT_FEATURE_C_RESET);
582585
if (ret < 0) {
583-
USB_LOG_ERR("Failed to clear port %u reset change, errorcode: %d\r\n", port, ret);
586+
USB_LOG_ERR("Failed to clear port %u reset change, errorcode: %d\r\n", port + 1, ret);
587+
continue;
584588
}
585589
}
586590

0 commit comments

Comments
 (0)