Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/tinyusb
Submodule tinyusb updated 97 files
+1 −1 .circleci/config.yml
+1 −12 .circleci/config2.yml
+1 −10 .github/actions/setup_toolchain/action.yml
+12 −4 .github/actions/setup_toolchain/download/action.yml
+9 −0 .github/actions/setup_toolchain/toolchain.json
+139 −31 .github/workflows/build.yml
+2 −0 .github/workflows/build_util.yml
+4 −3 .github/workflows/ci_set_matrix.py
+0 −130 .github/workflows/hil_test.yml
+5 −5 .idea/cmake.xml
+14 −0 .idea/debugServers/esp32s2.xml
+1 −1 .idea/debugServers/rp2350.xml
+1 −1 .idea/debugServers/rt1060.xml
+1 −1 .idea/debugServers/rt1064.xml
+1 −1 .idea/debugServers/sam21.xml
+1 −1 .idea/debugServers/sam51.xml
+13 −0 .idea/debugServers/stm32f769.xml
+13 −0 .idea/debugServers/stm32h563.xml
+13 −0 .idea/debugServers/stm32h743.xml
+5 −8 README.rst
+0 −0 docs/contributing/code_of_conduct.rst
+0 −0 docs/contributing/code_of_conduct.rst
+61 −59 docs/contributing/porting.rst
+167 −167 docs/info/changelog.rst
+0 −0 docs/info/contributors.rst
+0 −0 docs/info/contributors.rst
+38 −38 docs/reference/getting_started.rst
+1 −1 examples/build_system/cmake/cpu/cortex-m0.cmake
+2 −2 examples/build_system/make/cpu/cortex-m4.mk
+83 −118 examples/device/cdc_msc/src/msc_disk.c
+7 −22 examples/device/msc_dual_lun/src/msc_disk_dual.c
+4 −8 examples/host/cdc_msc_hid/src/msc_app.c
+1 −1 examples/host/msc_file_explorer/Makefile
+23 −13 hw/bsp/BoardPresets.json
+1 −1 hw/bsp/broadcom_32bit/family.mk
+1 −1 hw/bsp/broadcom_64bit/family.mk
+2 −0 hw/bsp/ch32v20x/boards/ch32v203c_r0_1v0/board.h
+2 −0 hw/bsp/ch32v20x/boards/ch32v203g_r0_1v0/board.h
+2 −0 hw/bsp/ch32v20x/boards/nanoch32v203/board.h
+2 −2 hw/bsp/ch32v20x/family.c
+4 −3 hw/bsp/espressif/boards/espressif_p4_function_ev/board.h
+8 −2 hw/bsp/espressif/boards/espressif_s2_devkitc/board.h
+1 −1 hw/bsp/espressif/boards/espressif_s3_devkitc/board.h
+5 −0 hw/bsp/espressif/boards/espressif_s3_devkitm/board.h
+4 −4 hw/bsp/espressif/boards/family.c
+1 −1 hw/bsp/espressif/family.cmake
+1 −1 hw/bsp/kinetis_k32l2/boards/frdm_k32l2a4s/board.mk
+1 −1 hw/bsp/lpc15/family.mk
+1 −1 hw/bsp/lpc17/family.mk
+1 −1 hw/bsp/lpc18/family.mk
+1 −1 hw/bsp/lpc40/family.mk
+3 −3 hw/bsp/lpc43/family.mk
+2 −0 hw/bsp/rp2040/boards/raspberry_pi_pico_w/board.cmake
+70 −0 hw/bsp/rp2040/boards/raspberry_pi_pico_w/board.h
+7 −0 hw/bsp/rp2040/skip_ci.txt
+2 −5 hw/bsp/stm32f2/boards/stm32f207nucleo/board.mk
+9 −4 hw/bsp/stm32f2/family.mk
+1 −3 hw/bsp/stm32f3/boards/stm32f303disco/board.mk
+10 −8 hw/bsp/stm32f3/family.mk
+0 −1 hw/bsp/stm32f4/family.mk
+5 −5 hw/bsp/stm32h7/boards/stm32h743eval/board.h
+2 −2 hw/bsp/stm32h7/family.c
+1 −3 hw/bsp/stm32h7/family.mk
+1 −2 hw/bsp/stm32l0/boards/stm32l052dap52/board.mk
+1 −3 hw/bsp/stm32l0/boards/stm32l0538disco/board.mk
+9 −10 hw/bsp/stm32l0/family.mk
+1 −3 hw/bsp/stm32u5/boards/b_u585i_iot2a/board.mk
+1 −3 hw/bsp/stm32u5/boards/stm32u545nucleo/board.mk
+1 −3 hw/bsp/stm32u5/boards/stm32u575eval/board.mk
+1 −3 hw/bsp/stm32u5/boards/stm32u575nucleo/board.mk
+1 −3 hw/bsp/stm32u5/boards/stm32u5a5nucleo/board.mk
+7 −0 hw/bsp/stm32u5/family.mk
+13 −8 hw/bsp/stm32wb/family.mk
+3 −2 src/class/msc/msc_device.c
+2 −4 src/common/tusb_debug.h
+1 −15 src/host/hcd.h
+116 −111 src/host/hub.c
+6 −2 src/host/hub.h
+498 −482 src/host/usbh.c
+20 −1 src/host/usbh.h
+1 −1 src/host/usbh_pvt.h
+1 −6 src/portable/chipidea/ci_hs/hcd_ci_hs.c
+6 −5 src/portable/ehci/ehci.c
+13 −12 src/portable/mentor/musb/hcd_musb.c
+1 −0 src/portable/nxp/khci/hcd_khci.c
+1 −0 src/portable/nxp/lpc17_40/hcd_lpc17_40.c
+4 −3 src/portable/ohci/ohci.c
+3 −3 src/portable/raspberrypi/pio_usb/hcd_pio_usb.c
+4 −3 src/portable/renesas/rusb2/hcd_rusb2.c
+52 −52 src/portable/synopsys/dwc2/dcd_dwc2.c
+10 −7 src/portable/synopsys/dwc2/dwc2_common.c
+480 −481 src/portable/synopsys/dwc2/dwc2_type.h
+193 −128 src/portable/synopsys/dwc2/hcd_dwc2.c
+6 −0 src/portable/template/hcd_template.c
+1 −1 src/tusb_option.h
+60 −43 test/hil/hil_test.py
+19 −3 test/hil/tinyusb.json
+6 −1 tools/build.py
+6 −4 tools/get_deps.py
33 changes: 21 additions & 12 deletions shared-module/usb/core/Device.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,33 +154,42 @@ mp_obj_t common_hal_usb_core_device_get_manufacturer(usb_core_device_obj_t *self


mp_int_t common_hal_usb_core_device_get_bus(usb_core_device_obj_t *self) {
hcd_devtree_info_t devtree;
hcd_devtree_get_info(self->device_address, &devtree);
return devtree.rhport;
tuh_bus_info_t bus_info;
if (!tuh_bus_info_get(self->device_address, &bus_info)) {
return 0;
}
return bus_info.rhport;
}

mp_obj_t common_hal_usb_core_device_get_port_numbers(usb_core_device_obj_t *self) {
hcd_devtree_info_t devtree;
hcd_devtree_get_info(self->device_address, &devtree);
if (devtree.hub_addr == 0) {
tuh_bus_info_t bus_info;
if (!tuh_bus_info_get(self->device_address, &bus_info)) {
return mp_const_none;
}
if (bus_info.hub_addr == 0) {
return mp_const_none;
}
// USB allows for 5 hubs deep chaining. So we're at most 5 ports deep.
mp_obj_t ports[5];
size_t port_count = 0;
while (devtree.hub_addr != 0 && port_count < MP_ARRAY_SIZE(ports)) {
tuh_bus_info_t current_bus_info = bus_info;
while (current_bus_info.hub_addr != 0 && port_count < MP_ARRAY_SIZE(ports)) {
// Reverse the order of the ports so most downstream comes last.
ports[MP_ARRAY_SIZE(ports) - 1 - port_count] = MP_OBJ_NEW_SMALL_INT(devtree.hub_port);
ports[MP_ARRAY_SIZE(ports) - 1 - port_count] = MP_OBJ_NEW_SMALL_INT(current_bus_info.hub_port);
port_count++;
hcd_devtree_get_info(devtree.hub_addr, &devtree);
if (!tuh_bus_info_get(current_bus_info.hub_addr, &current_bus_info)) {
break;
}
}
return mp_obj_new_tuple(port_count, ports + (MP_ARRAY_SIZE(ports) - port_count));
}

mp_int_t common_hal_usb_core_device_get_speed(usb_core_device_obj_t *self) {
hcd_devtree_info_t devtree;
hcd_devtree_get_info(self->device_address, &devtree);
switch (devtree.speed) {
tuh_bus_info_t bus_info;
if (!tuh_bus_info_get(self->device_address, &bus_info)) {
return 0;
}
switch (bus_info.speed) {
case TUSB_SPEED_HIGH:
return PYUSB_SPEED_HIGH;
case TUSB_SPEED_FULL:
Expand Down
Loading