From db60fa1c63ae58c205e43e144253dab6815bb2d1 Mon Sep 17 00:00:00 2001 From: Matthew Tran Date: Sun, 19 Nov 2023 18:26:40 -0800 Subject: add CH32V20x USB OTG/FS driver --- docs/reference/dependencies.rst | 1 + docs/reference/supported.rst | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'docs/reference') diff --git a/docs/reference/dependencies.rst b/docs/reference/dependencies.rst index 6ba6692e9..3a98594ff 100644 --- a/docs/reference/dependencies.rst +++ b/docs/reference/dependencies.rst @@ -55,6 +55,7 @@ hw/mcu/st/stm32u5xx_hal_driver https://github.com/STMicroelectronics/ hw/mcu/st/stm32wbxx_hal_driver https://github.com/STMicroelectronics/stm32wbxx_hal_driver.git 2c5f06638be516c1b772f768456ba637f077bac8 stm32wb hw/mcu/ti https://github.com/hathach/ti_driver.git 143ed6cc20a7615d042b03b21e070197d473e6e5 msp430 msp432e4 tm4c123 hw/mcu/wch/ch32f20x https://github.com/openwch/ch32f20x.git 77c4095087e5ed2c548ec9058e655d0b8757663b ch32f20x +hw/mcu/wch/ch32v20x https://github.com/openwch/ch32v20x.git de6d68c654340d7f27b00cebbfc9aa2740a1abc2 ch32v20x hw/mcu/wch/ch32v307 https://github.com/openwch/ch32v307.git 17761f5cf9dbbf2dcf665b7c04934188add20082 ch32v307 lib/CMSIS_5 https://github.com/ARM-software/CMSIS_5.git 20285262657d1b482d132d20d755c8c330d55c1f imxrt kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx mm32 msp432e4 nrf ra saml2xstm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32g0 stm32g4 stm32h7 stm32l0 stm32l1 stm32l4 stm32l5 stm32u5 stm32wb lib/FreeRTOS-Kernel https://github.com/FreeRTOS/FreeRTOS-Kernel.git 4ff01a7a4a51f53b44496aefee1e3c0071b7b173 all diff --git a/docs/reference/supported.rst b/docs/reference/supported.rst index 7e7be25a4..3ca203e88 100644 --- a/docs/reference/supported.rst +++ b/docs/reference/supported.rst @@ -128,9 +128,9 @@ Supported MCUs +--------------+-----------------------+--------+------+-----------+-------------------+--------------+ | ValentyUSB | eptri | ✔ | ✖ | ✖ | eptri | | +--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| WCH | CH32V307 | ✔ | | ✔ | ch32v307 | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | CH32F20x | ✔ | | ✔ | ch32f205 | | +| WCH | CH32F20x | ✔ | | ✔ | ch32f205 | | +| | CH32V20x | ✔ | | ✖ | ch32v20x | | +| | CH32V307 | ✔ | | ✔ | ch32v307 | | +--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -- cgit v1.3.1 From 3175aaa0eb32e334b3b55824e93b647da3b69a44 Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 24 May 2024 20:17:53 +0700 Subject: increase version as pre-releases, still need more clean up before actual relesae --- README.rst | 38 +++++++++++++----------- docs/info/changelog.rst | 66 +++++++++++++++++++++++++++++++++++++++++ docs/reference/dependencies.rst | 32 ++++++++++---------- hw/bsp/ch32v20x/family.c | 2 -- src/tusb_option.h | 8 ++--- tools/gen_doc.py | 4 +-- tools/make_release.py | 3 ++ 7 files changed, 112 insertions(+), 41 deletions(-) (limited to 'docs/reference') diff --git a/README.rst b/README.rst index 043095887..b5f9fc149 100644 --- a/README.rst +++ b/README.rst @@ -123,40 +123,44 @@ Following CPUs are supported, check out `Supported Devices`_ for comprehensive l +--------------+------------------------------------------------------------+ | Infineon | XMC4500 | +--------------+------------------------------------------------------------+ -| MicroChip | - SAM: D11, D21, D51, E5x, G55, L2x, E7x, S7x, V7x | -| | - PIC: 24, 32mm, 32mk, 32mx, 32mz, dsPIC33 | -+--------------+-----+------------------------------------------------------+ +| | SAM: D11, D21, D51, E5x, G55, L2x, E7x, S7x, V7x | +| MicroChip | | +| | PIC: 24, 32mm, 32mk, 32mx, 32mz, dsPIC33 | ++--------------+------------------------------------------------------------+ | Mind Montion | mm32 | +--------------+------------------------------------------------------------+ | NordicSemi | nRF52833, nRF52840, nRF5340 | +--------------+------------------------------------------------------------+ | Nuvoton | NUC 120, 121, 125, 126, 505 | -+--------------+---------+--------------------------------------------------+ -| NXP | iMXRT | RT10xx, RT11xx | -| +---------+--------------------------------------------------+ -| | Kinetis | KL, K32L2 | -| +---------+--------------------------------------------------+ -| | LPC | 11u, 13, 15, 17, 18, 40, 43, 51u, 54, 55 | -| +---------+--------------------------------------------------+ -| | MCX | A15, N9 | -+--------------+---------+--------------------------------------------------+ ++--------------+------------------------------------------------------------+ +| NXP | iMXRT: RT10xx, RT11xx | +| | | +| | Kinetis: KL, K32L2 | +| | | +| | LPC: 11u, 13, 15, 17, 18, 40, 43, 51u, 54, 55 | +| | | +| | MCX: A15, N9 | ++--------------+------------------------------------------------------------+ | Raspberry Pi | RP2040 | +--------------+-----+------------------------------------------------------+ -| Renesas | RX | 63N, 65N, 72N | -+--------------+-----+------------------------------------------------------+ -| | RA | 4M1, 4M3, 6M1, 6M5 | +| Renesas | RA: 4M1, 4M3, 6M1, 6M5 | +| | | +| | RX: 63N, 65N, 72N | +--------------+-----+------------------------------------------------------+ | Silabs | EFM32GG12 | +--------------+------------------------------------------------------------+ | Sony | CXD56 | +--------------+------------------------------------------------------------+ -| ST STM32 | F0, F1, F2, F3, F4, F7, H7, G0, G4, L0, L1, L4, L4+ U5, WB | +| ST STM32 | F0, F1, F2, F3, F4, F7, H5, H7, G0, G4, L0, L1, L4, L4+, | +| | U5, WB | +--------------+------------------------------------------------------------+ | TI | MSP430, MSP432E4, TM4C123 | +--------------+------------------------------------------------------------+ | ValentyUSB | eptri | +--------------+------------------------------------------------------------+ -| WCH | CH32F20x, CH32V20x, CH32V307 | +| WCH | CH32F: F20x | +| | | +| | CH32V: V20x, V307 | +--------------+------------------------------------------------------------+ License diff --git a/docs/info/changelog.rst b/docs/info/changelog.rst index b359ebb44..f7ccb39b9 100644 --- a/docs/info/changelog.rst +++ b/docs/info/changelog.rst @@ -2,6 +2,72 @@ Changelog ********* +0.17.0 (WIP) +============ + +General +------- + +- Improved continuous integration: build both cmake and make. Make use of circleci to build arm-clang + + +Controller Driver (DCD & HCD) +----------------------------- + +- WCH CH32 + + - Added support for USB OTG/FS and FSDev Driver. Update CH32V307 to allow manual select FS or HS driver. + - Fixed various bugs in CH32v307 usbhs driver: endpoint handling and data transfer management. + +- Fixed race conditions and other bugs in dcd_nrf5x and other drivers. +- Implemented hcd abort transfer for Max3421 and rp2040 +- Added DWC2 Test Mode support. +- stm32 fsdev: ISO EP buffer allocation improvements, implement dcd_edpt_close_all() +- Added support for STM32G4 and STM32U5 microcontrollers. + +Device Stack +------------ + +- Added tud_deinit() to deinitialize TinyUSB device stack. +- Added support for generic SOF callback. + +- Audio + + - Add audio_test_freertos & audio_4_channel_mic_freertos + - Improved support for Audio Class 2.0 (UAC2) with various bug fixes. + +- HID + + - Added missing key codes for keypad + - Added HID Lighting and Illumination functionality + +- Vendor: Added empty transfers for tud_vendor_n_write() +- MSC: Added support for SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL + +- CDC + + - Add option to make CDC TX buffer persistent + - Add missing capability bit for CDC ACM serial break support + +- Net + + - Rewrite of NCM device driver + - removed obsolete tud_network_link_state_cb() + +- Enhanced CDC class with better handling of large data transmissions. +- Fixed issues in the HID class for more reliable device enumeration. +- Video Added support for USB Video Class (UVC) with MJPEG. +- USBTMC Added notification support + +Host Stack +---------- + +- Added tuh_deinit() to deinitialize TinyUSB host stack. +- Added support for new USB mass storage class APIs. +- Enhanced stability of CDC-ACM devices during enumeration. +- Improved error handling and retry mechanisms for unstable devices. +- Added support for multiple interfaces in UVC. + 0.16.0 ====== diff --git a/docs/reference/dependencies.rst b/docs/reference/dependencies.rst index 3a98594ff..fd895519e 100644 --- a/docs/reference/dependencies.rst +++ b/docs/reference/dependencies.rst @@ -4,21 +4,21 @@ Dependencies MCU low-level peripheral driver and external libraries for building TinyUSB examples -======================================== ============================================================== ======================================== ======================================================================================================================================================================================================= +======================================== ============================================================== ======================================== ========================================================================================================================================================================================================================================================================================================================== Local Path Repo Commit Required by -======================================== ============================================================== ======================================== ======================================================================================================================================================================================================= +======================================== ============================================================== ======================================== ========================================================================================================================================================================================================================================================================================================================== hw/mcu/allwinner https://github.com/hathach/allwinner_driver.git 8e5e89e8e132c0fd90e72d5422e5d3d68232b756 fc100s hw/mcu/bridgetek/ft9xx/ft90x-sdk https://github.com/BRTSG-FOSS/ft90x-sdk.git 91060164afe239fcb394122e8bf9eb24d3194eb1 brtmm90x hw/mcu/broadcom https://github.com/adafruit/broadcom-peripherals.git 08370086080759ed54ac1136d62d2ad24c6fa267 broadcom_32bit broadcom_64bit hw/mcu/gd/nuclei-sdk https://github.com/Nuclei-Software/nuclei-sdk.git 7eb7bfa9ea4fbeacfafe1d5f77d5a0e6ed3922e7 gd32vf103 hw/mcu/infineon/mtb-xmclib-cat3 https://github.com/Infineon/mtb-xmclib-cat3.git daf5500d03cba23e68c2f241c30af79cd9d63880 xmc4000 -hw/mcu/microchip https://github.com/hathach/microchip_driver.git 9e8b37e307d8404033bb881623a113931e1edf27 sam3x samd11 samd21 samd51 same5x same7x saml2x samg -hw/mcu/mindmotion/mm32sdk https://github.com/hathach/mm32sdk.git 0b79559eb411149d36e073c1635c620e576308d4 mm32 -hw/mcu/nordic/nrfx https://github.com/NordicSemiconductor/nrfx.git 2527e3c8449cfd38aee41598e8af8492f410ed15 nrf +hw/mcu/microchip https://github.com/hathach/microchip_driver.git 9e8b37e307d8404033bb881623a113931e1edf27 sam3x samd11 samd21 samd51 samd5x_e5x same5x same7x saml2x samg +hw/mcu/mindmotion/mm32sdk https://github.com/hathach/mm32sdk.git b93e856211060ae825216c6a1d6aa347ec758843 mm32 +hw/mcu/nordic/nrfx https://github.com/NordicSemiconductor/nrfx.git 7c47cc0a56ce44658e6da2458e86cd8783ccc4a2 nrf hw/mcu/nuvoton https://github.com/majbthrd/nuc_driver.git 2204191ec76283371419fbcec207da02e1bc22fa nuc -hw/mcu/nxp/lpcopen https://github.com/hathach/nxp_lpcopen.git 84e0bd3e43910aaf71eefd62075cf57495418312 lpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43 -hw/mcu/nxp/mcux-sdk https://github.com/hathach/mcux-sdk.git 950819b7de9b32f92c3edf396bc5ffb8d66e7009 kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx imxrt -hw/mcu/raspberry_pi/Pico-PIO-USB https://github.com/sekigon-gonnoc/Pico-PIO-USB.git d00a10a8c425d0d40f81b87169102944b01f3bb3 rp2040 +hw/mcu/nxp/lpcopen https://github.com/hathach/nxp_lpcopen.git 04bfe7a5f6ee74a89a28ad618d3367dcfcfb7d83 lpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43 +hw/mcu/nxp/mcux-sdk https://github.com/hathach/mcux-sdk.git 144f1eb7ea8c06512e12f12b27383601c0272410 kinetis_k kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx imxrt +hw/mcu/raspberry_pi/Pico-PIO-USB https://github.com/sekigon-gonnoc/Pico-PIO-USB.git 0f747aaa0c16f750bdfa2ba37ec25d6c8e1bc117 rp2040 hw/mcu/renesas/fsp https://github.com/renesas/fsp.git d52e5a6a59b7c638da860c2bb309b6e78e752ff8 ra hw/mcu/renesas/rx https://github.com/kkitayam/rx_device.git 706b4e0cf485605c32351e2f90f5698267996023 rx hw/mcu/silabs/cmsis-dfp-efm32gg12b https://github.com/cmsis-packs/cmsis-dfp-efm32gg12b.git f1c31b7887669cb230b3ea63f9b56769078960bc efm32 @@ -28,15 +28,16 @@ hw/mcu/st/cmsis_device_f1 https://github.com/STMicroelectronics/ hw/mcu/st/cmsis_device_f2 https://github.com/STMicroelectronics/cmsis_device_f2.git 182fcb3681ce116816feb41b7764f1b019ce796f stm32f2 hw/mcu/st/cmsis_device_f3 https://github.com/STMicroelectronics/cmsis_device_f3.git 5e4ee5ed7a7b6c85176bb70a9fd3c72d6eb99f1b stm32f3 hw/mcu/st/cmsis_device_f4 https://github.com/STMicroelectronics/cmsis_device_f4.git 2615e866fa48fe1ff1af9e31c348813f2b19e7ec stm32f4 -hw/mcu/st/cmsis_device_f7 https://github.com/STMicroelectronics/cmsis_device_f7.git fc676ef1ad177eb874eaa06444d3d75395fc51f4 stm32f7 +hw/mcu/st/cmsis_device_f7 https://github.com/STMicroelectronics/cmsis_device_f7.git 25b0463439303b7a38f0d27b161f7d2f3c096e79 stm32f7 hw/mcu/st/cmsis_device_g0 https://github.com/STMicroelectronics/cmsis_device_g0.git 3a23e1224417f3f2d00300ecd620495e363f2094 stm32g0 hw/mcu/st/cmsis_device_g4 https://github.com/STMicroelectronics/cmsis_device_g4.git ce822adb1dc552b3aedd13621edbc7fdae124878 stm32g4 +hw/mcu/st/cmsis_device_h5 https://github.com/STMicroelectronics/cmsis_device_h5.git cd2d1d579743de57b88ccaf61a968b9c05848ffc stm32h5 hw/mcu/st/cmsis_device_h7 https://github.com/STMicroelectronics/cmsis_device_h7.git 60dc2c913203dc8629dc233d4384dcc41c91e77f stm32h7 -hw/mcu/st/cmsis_device_l0 https://github.com/STMicroelectronics/cmsis_device_l0.git 06748ca1f93827befdb8b794402320d94d02004f stm32l0 +hw/mcu/st/cmsis_device_l0 https://github.com/STMicroelectronics/cmsis_device_l0.git 69cd5999fd40ae6e546d4905b21635c6ca1bcb92 stm32l0 hw/mcu/st/cmsis_device_l1 https://github.com/STMicroelectronics/cmsis_device_l1.git 7f16ec0a1c4c063f84160b4cc6bf88ad554a823e stm32l1 hw/mcu/st/cmsis_device_l4 https://github.com/STMicroelectronics/cmsis_device_l4.git 6ca7312fa6a5a460b5a5a63d66da527fdd8359a6 stm32l4 hw/mcu/st/cmsis_device_l5 https://github.com/STMicroelectronics/cmsis_device_l5.git d922865fc0326a102c26211c44b8e42f52c1e53d stm32l5 -hw/mcu/st/cmsis_device_u5 https://github.com/STMicroelectronics/cmsis_device_u5.git 06d7edade7167b0eafdd550bf77cfc4fa98eae2e stm32u5 +hw/mcu/st/cmsis_device_u5 https://github.com/STMicroelectronics/cmsis_device_u5.git 5ad9797c54ec3e55eff770fc9b3cd4a1aefc1309 stm32u5 hw/mcu/st/cmsis_device_wb https://github.com/STMicroelectronics/cmsis_device_wb.git 9c5d1920dd9fabbe2548e10561d63db829bb744f stm32wb hw/mcu/st/stm32f0xx_hal_driver https://github.com/STMicroelectronics/stm32f0xx_hal_driver.git 0e95cd88657030f640a11e690a8a5186c7712ea5 stm32f0 hw/mcu/st/stm32f1xx_hal_driver https://github.com/STMicroelectronics/stm32f1xx_hal_driver.git 1dd9d3662fb7eb2a7f7d3bc0a4c1dc7537915a29 stm32f1 @@ -46,6 +47,7 @@ hw/mcu/st/stm32f4xx_hal_driver https://github.com/STMicroelectronics/ hw/mcu/st/stm32f7xx_hal_driver https://github.com/STMicroelectronics/stm32f7xx_hal_driver.git f7ffdf6bf72110e58b42c632b0a051df5997e4ee stm32f7 hw/mcu/st/stm32g0xx_hal_driver https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git e911b12c7f67084d7f6b76157a4c0d4e2ec3779c stm32g0 hw/mcu/st/stm32g4xx_hal_driver https://github.com/STMicroelectronics/stm32g4xx_hal_driver.git 8b4518417706d42eef5c14e56a650005abf478a8 stm32g4 +hw/mcu/st/stm32h5xx_hal_driver https://github.com/STMicroelectronics/stm32h5xx_hal_driver.git 2cf77de584196d619cec1b4586c3b9e2820a254e stm32h5 hw/mcu/st/stm32h7xx_hal_driver https://github.com/STMicroelectronics/stm32h7xx_hal_driver.git d8461b980b59b1625207d8c4f2ce0a9c2a7a3b04 stm32h7 hw/mcu/st/stm32l0xx_hal_driver https://github.com/STMicroelectronics/stm32l0xx_hal_driver.git fbdacaf6f8c82a4e1eb9bd74ba650b491e97e17b stm32l0 hw/mcu/st/stm32l1xx_hal_driver https://github.com/STMicroelectronics/stm32l1xx_hal_driver.git 44efc446fa69ed8344e7fd966e68ed11043b35d9 stm32l1 @@ -53,13 +55,13 @@ hw/mcu/st/stm32l4xx_hal_driver https://github.com/STMicroelectronics/ hw/mcu/st/stm32l5xx_hal_driver https://github.com/STMicroelectronics/stm32l5xx_hal_driver.git 675c32a75df37f39d50d61f51cb0dcf53f07e1cb stm32l5 hw/mcu/st/stm32u5xx_hal_driver https://github.com/STMicroelectronics/stm32u5xx_hal_driver.git 4d93097a67928e9377e655ddd14622adc31b9770 stm32u5 hw/mcu/st/stm32wbxx_hal_driver https://github.com/STMicroelectronics/stm32wbxx_hal_driver.git 2c5f06638be516c1b772f768456ba637f077bac8 stm32wb -hw/mcu/ti https://github.com/hathach/ti_driver.git 143ed6cc20a7615d042b03b21e070197d473e6e5 msp430 msp432e4 tm4c123 +hw/mcu/ti https://github.com/hathach/ti_driver.git 143ed6cc20a7615d042b03b21e070197d473e6e5 msp430 msp432e4 tm4c hw/mcu/wch/ch32f20x https://github.com/openwch/ch32f20x.git 77c4095087e5ed2c548ec9058e655d0b8757663b ch32f20x hw/mcu/wch/ch32v20x https://github.com/openwch/ch32v20x.git de6d68c654340d7f27b00cebbfc9aa2740a1abc2 ch32v20x hw/mcu/wch/ch32v307 https://github.com/openwch/ch32v307.git 17761f5cf9dbbf2dcf665b7c04934188add20082 ch32v307 -lib/CMSIS_5 https://github.com/ARM-software/CMSIS_5.git 20285262657d1b482d132d20d755c8c330d55c1f imxrt kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx mm32 msp432e4 nrf ra saml2xstm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32g0 stm32g4 stm32h7 stm32l0 stm32l1 stm32l4 stm32l5 stm32u5 stm32wb -lib/FreeRTOS-Kernel https://github.com/FreeRTOS/FreeRTOS-Kernel.git 4ff01a7a4a51f53b44496aefee1e3c0071b7b173 all +lib/CMSIS_5 https://github.com/ARM-software/CMSIS_5.git 20285262657d1b482d132d20d755c8c330d55c1f imxrt kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx mm32 msp432e4 nrf ra saml2xlpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43stm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32g0 stm32g4 stm32h5stm32h7 stm32l0 stm32l1 stm32l4 stm32l5 stm32u5 stm32wbsam3x samd11 samd21 samd51 samd5x_e5x same5x same7x saml2x samgtm4c +lib/FreeRTOS-Kernel https://github.com/FreeRTOS/FreeRTOS-Kernel.git cc0e0707c0c748713485b870bb980852b210877f all lib/lwip https://github.com/lwip-tcpip/lwip.git 159e31b689577dbf69cf0683bbaffbd71fa5ee10 all lib/sct_neopixel https://github.com/gsteiert/sct_neopixel.git e73e04ca63495672d955f9268e003cffe168fcd8 lpc55 tools/uf2 https://github.com/microsoft/uf2.git 19615407727073e36d81bf239c52108ba92e7660 all -======================================== ============================================================== ======================================== ======================================================================================================================================================================================================= +======================================== ============================================================== ======================================== ========================================================================================================================================================================================================================================================================================================================== diff --git a/hw/bsp/ch32v20x/family.c b/hw/bsp/ch32v20x/family.c index a0a8c3f50..be654e543 100644 --- a/hw/bsp/ch32v20x/family.c +++ b/hw/bsp/ch32v20x/family.c @@ -124,8 +124,6 @@ void board_init(void) { __enable_irq(); board_delay(2); - - printf("SystemCoreClock = %ld\r\n", SystemCoreClock); } void board_led_write(bool state) { diff --git a/src/tusb_option.h b/src/tusb_option.h index 674c05e54..db8b94580 100644 --- a/src/tusb_option.h +++ b/src/tusb_option.h @@ -29,14 +29,12 @@ #include "common/tusb_compiler.h" -// Version is release as major.minor.revision eg 1.0.0. though there could be notable APIs before a new release. -// For notable API changes within a release, we increase the build number. +// Version is release as major.minor.revision eg 1.0.0 #define TUSB_VERSION_MAJOR 0 -#define TUSB_VERSION_MINOR 16 +#define TUSB_VERSION_MINOR 17 #define TUSB_VERSION_REVISION 0 -#define TUSB_VERSION_BUILD 3 -#define TUSB_VERSION_NUMBER (TUSB_VERSION_MAJOR << 24 | TUSB_VERSION_MINOR << 16 | TUSB_VERSION_REVISION << 8 | TUSB_VERSION_BUILD) +#define TUSB_VERSION_NUMBER (TUSB_VERSION_MAJOR * 10000 + TUSB_VERSION_MINOR * 100 + TUSB_VERSION_REVISION) #define TUSB_VERSION_STRING TU_STRING(TUSB_VERSION_MAJOR) "." TU_STRING(TUSB_VERSION_MINOR) "." TU_STRING(TUSB_VERSION_REVISION) //--------------------------------------------------------------------+ diff --git a/tools/gen_doc.py b/tools/gen_doc.py index c63294588..668c77ef6 100644 --- a/tools/gen_doc.py +++ b/tools/gen_doc.py @@ -7,9 +7,9 @@ from get_deps import deps_all TOP = Path(__file__).parent.parent.resolve() -########################################### +# ----------------------------------------- # Dependencies -########################################### +# ----------------------------------------- def gen_deps_doc(): deps_rst = Path(TOP) / "docs/reference/dependencies.rst" diff --git a/tools/make_release.py b/tools/make_release.py index 256ca8f21..126e07292 100644 --- a/tools/make_release.py +++ b/tools/make_release.py @@ -1,4 +1,5 @@ import re +import gen_doc version = '0.16.0' @@ -46,4 +47,6 @@ with open(f_library_json, 'w') as f: # docs/info/changelog.rst ################### +gen_doc.gen_deps_doc() + print("Update docs/info/changelog.rst") -- cgit v1.3.1 From 5f060a357d34257f5a742ebf78c5e4e0873c7a13 Mon Sep 17 00:00:00 2001 From: Okarss <104319900+Okarss@users.noreply.github.com> Date: Fri, 14 Jun 2024 21:23:17 +0300 Subject: Update the STM32 documentation --- README.rst | 5 +++-- docs/reference/supported.rst | 20 +++++++++++++++++--- src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c | 10 ++++++++-- src/portable/st/stm32_fsdev/fsdev_stm32.h | 2 +- 4 files changed, 29 insertions(+), 8 deletions(-) (limited to 'docs/reference') diff --git a/README.rst b/README.rst index b5f9fc149..1ae8c5375 100644 --- a/README.rst +++ b/README.rst @@ -151,8 +151,9 @@ Following CPUs are supported, check out `Supported Devices`_ for comprehensive l +--------------+------------------------------------------------------------+ | Sony | CXD56 | +--------------+------------------------------------------------------------+ -| ST STM32 | F0, F1, F2, F3, F4, F7, H5, H7, G0, G4, L0, L1, L4, L4+, | -| | U5, WB | +| ST STM32 | F0, F1, F2, F3, F4, F7, G0, G4, H5, H7, | +| | | +| | L0, L1, L4, L4+, L5, U5, WB | +--------------+------------------------------------------------------------+ | TI | MSP430, MSP432E4, TM4C123 | +--------------+------------------------------------------------------------+ diff --git a/docs/reference/supported.rst b/docs/reference/supported.rst index 3ca203e88..d0e0bf1af 100644 --- a/docs/reference/supported.rst +++ b/docs/reference/supported.rst @@ -104,11 +104,17 @@ Supported MCUs | +-----------------------+--------+------+-----------+-------------------+--------------+ | | F7 | ✔ | | ✔ | dwc2 | | | +-----------------------+--------+------+-----------+-------------------+--------------+ -| | H7 | ✔ | | ✔ | dwc2 | | +| | G0 | ✔ | ✖ | ✖ | stm32_fsdev | | | +-----------------------+--------+------+-----------+-------------------+--------------+ | | G4 | ✔ | ✖ | ✖ | stm32_fsdev | | | +-----------------------+--------+------+-----------+-------------------+--------------+ -| | L0, L1 | ✔ | ✖ | ✖ | stm32_fsdev | | +| | H5 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +-----------------------+--------+------+-----------+-------------------+--------------+ +| | H7 | ✔ | | ✔ | dwc2 | | +| +-----------------------+--------+------+-----------+-------------------+--------------+ +| | L0 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +-----------------------+--------+------+-----------+-------------------+--------------+ +| | L1 | ✔ | ✖ | ✖ | stm32_fsdev | | | +----+------------------+--------+------+-----------+-------------------+--------------+ | | L4 | 4x2, 4x3 | ✔ | ✖ | ✖ | stm32_fsdev | | | | +------------------+--------+------+-----------+-------------------+--------------+ @@ -116,8 +122,14 @@ Supported MCUs | +----+------------------+--------+------+-----------+-------------------+--------------+ | | L4+ | ✔ | | | dwc2 | | | +-----------------------+--------+------+-----------+-------------------+--------------+ -| | U5 | ✔ | | ✔ | dwc2 | | +| | L5 | ✔ | ✖ | ✖ | stm32_fsdev | | | +-----------------------+--------+------+-----------+-------------------+--------------+ +| | U5 | 535, 545 | ✔ | ✖ | ✖ | stm32_fsdev | | +| | +------------------+--------+------+-----------+-------------------+--------------+ +| | | 575, 585 | ✔ | | ✖ | dwc2 | | +| | +------------------+--------+------+-----------+-------------------+--------------+ +| | | 59x,5Ax,5Fx,5Gx | ✔ | | ✔ | dwc2 | | +| +----+------------------+--------+------+-----------+-------------------+--------------+ | | WBx5 | ✔ | | | stm32_fsdev | | +--------------+-----------------------+--------+------+-----------+-------------------+--------------+ | TI | MSP430 | ✔ | ✖ | ✖ | msp430x5xx | | @@ -129,7 +141,9 @@ Supported MCUs | ValentyUSB | eptri | ✔ | ✖ | ✖ | eptri | | +--------------+-----------------------+--------+------+-----------+-------------------+--------------+ | WCH | CH32F20x | ✔ | | ✔ | ch32f205 | | +| +-----------------------+--------+------+-----------+-------------------+--------------+ | | CH32V20x | ✔ | | ✖ | ch32v20x | | +| +-----------------------+--------+------+-----------+-------------------+--------------+ | | CH32V307 | ✔ | | ✔ | ch32v307 | | +--------------+-----------------------+--------+------+-----------+-------------------+--------------+ diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c index 9ce37f992..0ecb6ea05 100644 --- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c +++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c @@ -37,14 +37,20 @@ * It also should work with minimal changes for any ST MCU with an "USB A"/"PCD"/"HCD" peripheral. This * covers: * - * F04x, F072, F078, 070x6/B 1024 byte buffer + * F04x, F072, F078, F070x6/B 1024 byte buffer * F102, F103 512 byte buffer; no internal D+ pull-up (maybe many more changes?) * F302xB/C, F303xB/C, F373 512 byte buffer; no internal D+ pull-up * F302x6/8, F302xD/E2, F303xD/E 1024 byte buffer; no internal D+ pull-up + * G0 2048 byte buffer; 32-bit bus + * G4 1024 byte buffer + * H5 2048 byte buffer; 32-bit bus * L0x2, L0x3 1024 byte buffer * L1 512 byte buffer * L4x2, L4x3 1024 byte buffer - * G0 2048 byte buffer + * L5 1024 byte buffer + * U0 1024 byte buffer; 32-bit bus + * U535, U545 2048 byte buffer; 32-bit bus + * WB35, WB55 1024 byte buffer * * To use this driver, you must: * - If you are using a device with crystal-less USB, set up the clock recovery system (CRS) diff --git a/src/portable/st/stm32_fsdev/fsdev_stm32.h b/src/portable/st/stm32_fsdev/fsdev_stm32.h index b3fa11b88..524efc75f 100644 --- a/src/portable/st/stm32_fsdev/fsdev_stm32.h +++ b/src/portable/st/stm32_fsdev/fsdev_stm32.h @@ -161,7 +161,7 @@ #else #error You are using an untested or unimplemented STM32 variant. Please update the driver. - // This includes L1x0, L1x1, L1x2, L4x2 and L4x3, G1x1, G1x3, and G1x4 + // This includes U0 #endif // This checks if the device has "LPM" -- cgit v1.3.1 From 5083d1eb3399d605d64b3e30a784731f330e7774 Mon Sep 17 00:00:00 2001 From: Okarss <104319900+Okarss@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:12:44 +0300 Subject: Update Host mode information for FSDEV devices --- docs/reference/supported.rst | 13 +++++++------ src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'docs/reference') diff --git a/docs/reference/supported.rst b/docs/reference/supported.rst index d0e0bf1af..441c885ac 100644 --- a/docs/reference/supported.rst +++ b/docs/reference/supported.rst @@ -104,11 +104,11 @@ Supported MCUs | +-----------------------+--------+------+-----------+-------------------+--------------+ | | F7 | ✔ | | ✔ | dwc2 | | | +-----------------------+--------+------+-----------+-------------------+--------------+ -| | G0 | ✔ | ✖ | ✖ | stm32_fsdev | | +| | G0 | ✔ | | ✖ | stm32_fsdev | | | +-----------------------+--------+------+-----------+-------------------+--------------+ | | G4 | ✔ | ✖ | ✖ | stm32_fsdev | | | +-----------------------+--------+------+-----------+-------------------+--------------+ -| | H5 | ✔ | ✖ | ✖ | stm32_fsdev | | +| | H5 | ✔ | | ✖ | stm32_fsdev | | | +-----------------------+--------+------+-----------+-------------------+--------------+ | | H7 | ✔ | | ✔ | dwc2 | | | +-----------------------+--------+------+-----------+-------------------+--------------+ @@ -124,13 +124,13 @@ Supported MCUs | +-----------------------+--------+------+-----------+-------------------+--------------+ | | L5 | ✔ | ✖ | ✖ | stm32_fsdev | | | +-----------------------+--------+------+-----------+-------------------+--------------+ -| | U5 | 535, 545 | ✔ | ✖ | ✖ | stm32_fsdev | | +| | U5 | 535, 545 | ✔ | | ✖ | stm32_fsdev | | | | +------------------+--------+------+-----------+-------------------+--------------+ | | | 575, 585 | ✔ | | ✖ | dwc2 | | | | +------------------+--------+------+-----------+-------------------+--------------+ | | | 59x,5Ax,5Fx,5Gx | ✔ | | ✔ | dwc2 | | | +----+------------------+--------+------+-----------+-------------------+--------------+ -| | WBx5 | ✔ | | | stm32_fsdev | | +| | WBx5 | ✔ | ✖ | ✖ | stm32_fsdev | | +--------------+-----------------------+--------+------+-----------+-------------------+--------------+ | TI | MSP430 | ✔ | ✖ | ✖ | msp430x5xx | | | +-----------------------+--------+------+-----------+-------------------+--------------+ @@ -153,8 +153,9 @@ Table Legend = =================== ✔ Supported -⚠ WIP/partial support -✖ Not supported +⚠ Partial support +✖ Not supported by hardware +[empty] Unknown = =================== Supported Boards diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c index 0ecb6ea05..fb499fa18 100644 --- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c +++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c @@ -41,15 +41,15 @@ * F102, F103 512 byte buffer; no internal D+ pull-up (maybe many more changes?) * F302xB/C, F303xB/C, F373 512 byte buffer; no internal D+ pull-up * F302x6/8, F302xD/E2, F303xD/E 1024 byte buffer; no internal D+ pull-up - * G0 2048 byte buffer; 32-bit bus + * G0 2048 byte buffer; 32-bit bus; host mode * G4 1024 byte buffer - * H5 2048 byte buffer; 32-bit bus + * H5 2048 byte buffer; 32-bit bus; host mode * L0x2, L0x3 1024 byte buffer * L1 512 byte buffer * L4x2, L4x3 1024 byte buffer * L5 1024 byte buffer * U0 1024 byte buffer; 32-bit bus - * U535, U545 2048 byte buffer; 32-bit bus + * U535, U545 2048 byte buffer; 32-bit bus; host mode * WB35, WB55 1024 byte buffer * * To use this driver, you must: -- cgit v1.3.1 From 458be5dad8cad2819943a006c781a6bc508ea048 Mon Sep 17 00:00:00 2001 From: Okarss <104319900+Okarss@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:40:49 +0300 Subject: Fix the table --- docs/reference/supported.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/reference') diff --git a/docs/reference/supported.rst b/docs/reference/supported.rst index 441c885ac..8b1d99b41 100644 --- a/docs/reference/supported.rst +++ b/docs/reference/supported.rst @@ -123,7 +123,7 @@ Supported MCUs | | L4+ | ✔ | | | dwc2 | | | +-----------------------+--------+------+-----------+-------------------+--------------+ | | L5 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ +| +----+------------------+--------+------+-----------+-------------------+--------------+ | | U5 | 535, 545 | ✔ | | ✖ | stm32_fsdev | | | | +------------------+--------+------+-----------+-------------------+--------------+ | | | 575, 585 | ✔ | | ✖ | dwc2 | | -- cgit v1.3.1 From 7594d8e103b4df116c2f9fb038c414d729896518 Mon Sep 17 00:00:00 2001 From: Okarss <104319900+Okarss@users.noreply.github.com> Date: Fri, 21 Jun 2024 15:56:54 +0300 Subject: Fix the legend --- docs/reference/supported.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/reference') diff --git a/docs/reference/supported.rst b/docs/reference/supported.rst index 8b1d99b41..5a66b7428 100644 --- a/docs/reference/supported.rst +++ b/docs/reference/supported.rst @@ -151,12 +151,12 @@ Supported MCUs Table Legend ------------ -= =================== -✔ Supported -⚠ Partial support -✖ Not supported by hardware -[empty] Unknown -= =================== +========= ========================= +✔ Supported +⚠ Partial support +✖ Not supported by hardware +\[empty\] Unknown +========= ========================= Supported Boards ================ -- cgit v1.3.1 From 822ff7b316facf0bf0856dd4aa8418bd6aef18ea Mon Sep 17 00:00:00 2001 From: Okarss <104319900+Okarss@users.noreply.github.com> Date: Fri, 21 Jun 2024 16:23:28 +0300 Subject: Update for OTG_FS devices --- docs/reference/supported.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/reference') diff --git a/docs/reference/supported.rst b/docs/reference/supported.rst index 5a66b7428..edb6b69ca 100644 --- a/docs/reference/supported.rst +++ b/docs/reference/supported.rst @@ -118,9 +118,9 @@ Supported MCUs | +----+------------------+--------+------+-----------+-------------------+--------------+ | | L4 | 4x2, 4x3 | ✔ | ✖ | ✖ | stm32_fsdev | | | | +------------------+--------+------+-----------+-------------------+--------------+ -| | | 4x5, 4x6 | ✔ | | | dwc2 | | +| | | 4x5, 4x6 | ✔ | | ✖ | dwc2 | | | +----+------------------+--------+------+-----------+-------------------+--------------+ -| | L4+ | ✔ | | | dwc2 | | +| | L4+ | ✔ | | ✖ | dwc2 | | | +-----------------------+--------+------+-----------+-------------------+--------------+ | | L5 | ✔ | ✖ | ✖ | stm32_fsdev | | | +----+------------------+--------+------+-----------+-------------------+--------------+ -- cgit v1.3.1 From 215832397b1593e2df5609f92c9346c133a03774 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 19 Aug 2024 19:07:47 +0700 Subject: update doc, re-enable metro m7 for hil, only build make windows/macos on PR --- .github/workflows/build.yml | 5 +- README.rst | 4 +- docs/reference/supported.rst | 277 +++++++++++++++++++++---------------------- test/hil/rpi.json | 15 ++- 4 files changed, 149 insertions(+), 152 deletions(-) (limited to 'docs/reference') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fde9400a7..e4204ca3d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,7 +66,7 @@ jobs: build-system: 'cmake' toolchain: ${{ matrix.toolchain }} build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain].family) }} - one-per-family: ${{ github.event_name != 'pull_request' }} + one-per-family: ${{ github.event_name == 'push' }} # --------------------------------------- # Build CMake arm-gcc @@ -103,12 +103,13 @@ jobs: build-system: 'make' toolchain: ${{ matrix.toolchain }} build-args: ${{ toJSON(fromJSON(needs.set-matrix.outputs.json)[matrix.toolchain].family) }} - one-per-family: ${{ github.event_name != 'pull_request' }} + one-per-family: ${{ github.event_name == 'push' }} # --------------------------------------- # Build Make on Windows/MacOS # --------------------------------------- make-os: + if: github.event_name == 'pull_request' uses: ./.github/workflows/build_util.yml strategy: fail-fast: false diff --git a/README.rst b/README.rst index 422f23271..6dd0e2714 100644 --- a/README.rst +++ b/README.rst @@ -109,7 +109,9 @@ Following CPUs are supported, check out `Supported Devices`_ for comprehensive l +==============+============================================================+ | Allwinner | F1C100s/F1C200s | +--------------+------------------------------------------------------------+ -| Analog | MAX3421E (usb host shield) | +| Analog | max32: 650, 666, 690. max78002 | +| | | +| | max3421e (host) | +--------------+------------------------------------------------------------+ | Brigetek | FT90x | +--------------+------------------------------------------------------------+ diff --git a/docs/reference/supported.rst b/docs/reference/supported.rst index edb6b69ca..2bfa1b8d0 100644 --- a/docs/reference/supported.rst +++ b/docs/reference/supported.rst @@ -5,147 +5,142 @@ Supported Devices Supported MCUs ============== -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| Manufacturer | Family | Device | Host | Highspeed | Driver | Note | -+==============+=======================+========+======+===========+===================+==============+ -| Allwinner | F1C100s/F1C200s | ✔ | | ✔ | sunxi | musb variant | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| Analog | MAX3421E | | ✔ | ✖ | max3421 | via SPI | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| Brigetek | FT90x | ✔ | | ✔ | ft9xx | | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| Broadcom | BCM2711, BCM2837 | ✔ | | ✔ | dwc2 | | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| Dialog | DA1469x | ✔ | ✖ | ✖ | da146xx | | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| Espressif | ESP32 S2, S3 | ✔ | | ✖ | dwc2 or esp32sx | | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| GigaDevice | GD32VF103 | ✔ | | ✖ | dwc2 | | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| Infineon | XMC4500 | ✔ | | ✖ | dwc2 | | -+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+ -| MicroChip | SAM | D11, D21 | ✔ | | ✖ | samd | | -| | +-----------------+--------+------+-----------+-------------------+--------------+ -| | | D51, E5x | ✔ | | ✖ | samd | | -| | +-----------------+--------+------+-----------+-------------------+--------------+ -| | | G55 | ✔ | | ✖ | samg | | -| | +-----------------+--------+------+-----------+-------------------+--------------+ -| | | L21, L22 | ✔ | | ✖ | samd | | -| | +-----------------+--------+------+-----------+-------------------+--------------+ -| | | E70,S70,V70,V71 | ✔ | | ✔ | samx7x | | -| +-----+-----------------+--------+------+-----------+-------------------+--------------+ -| | PIC | 24 | ✔ | | | pic | ci_fs variant| -| | +-----------------+--------+------+-----------+-------------------+--------------+ -| | | 32 mm, mk, mx | ✔ | | | pic | ci_fs variant| -| | +-----------------+--------+------+-----------+-------------------+--------------+ -| | | dsPIC33 | ✔ | | | pic | ci_fs variant| -| | +-----------------+--------+------+-----------+-------------------+--------------+ -| | | 32mz | ✔ | | | pic32mz | musb variant | -+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+ -| Mind Montion | mm32 | ✔ | | ✖ | mm32f327x_otg | ci_fs variant| -+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+ -| NordicSemi | nRF52833, nRF52840 | ✔ | ✖ | ✖ | nrf5x | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | nRF5340 | ✔ | ✖ | ✖ | nrf5x | | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| Nuvoton | NUC120 | ✔ | ✖ | ✖ | nuc120 | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | NUC121/NUC125 | ✔ | ✖ | ✖ | nuc121 | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | NUC126 | ✔ | ✖ | ✖ | nuc121 | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | NUC505 | ✔ | | ✔ | nuc505 | | -+--------------+---------+-------------+--------+------+-----------+-------------------+--------------+ -| NXP | iMXRT | RT10xx | ✔ | ✔ | ✔ | ci_hs | | -| | +-------------+--------+------+-----------+-------------------+--------------+ -| | | RT11xx | ✔ | ✔ | ✔ | ci_hs | | -| +---------+-------------+--------+------+-----------+-------------------+--------------+ -| | Kinetis | KL | ✔ | ⚠ | ✖ | ci_fs, khci | | -| | +-------------+--------+------+-----------+-------------------+--------------+ -| | | K32L2 | ✔ | | ✖ | khci | ci_fs variant| -| +---------+-------------+--------+------+-----------+-------------------+--------------+ -| | LPC | 11u, 13, 15 | ✔ | ✖ | ✖ | lpc_ip3511 | | -| | +-------------+--------+------+-----------+-------------------+--------------+ -| | | 17, 40 | ✔ | ⚠ | ✖ | lpc17_40 | | -| | +-------------+--------+------+-----------+-------------------+--------------+ -| | | 18, 43 | ✔ | ✔ | ✔ | ci_hs | | -| | +-------------+--------+------+-----------+-------------------+--------------+ -| | | 51u | ✔ | ✖ | ✖ | lpc_ip3511 | | -| | +-------------+--------+------+-----------+-------------------+--------------+ -| | | 54 | ✔ | | ✔ | lpc_ip3511 | | -| | +-------------+--------+------+-----------+-------------------+--------------+ -| | | 55 | ✔ | | ✔ | lpc_ip3511 | | -| +---------+-------------+--------+------+-----------+-------------------+--------------+ -| | MCX | N9 | ✔ | | ✔ | ci_fs, ci_hs | | -+--------------+---------+-------------+--------+------+-----------+-------------------+--------------+ -| Raspberry Pi | RP2040 | ✔ | ✔ | ✖ | rp2040, pio_usb | | -+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+ -| Renesas | RX | 63N, 65N, 72N | ✔ | ✔ | ✖ | rusb2 | | -| +-----+-----------------+--------+------+-----------+-------------------+--------------+ -| | RA | 4M1, 4M3, 6M1 | ✔ | ✔ | ✖ | rusb2 | | -| | +-----------------+--------+------+-----------+-------------------+--------------+ -| | | 6M5 | ✔ | ✔ | ✔ | rusb2 | | -+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+ -| Silabs | EFM32GG12 | ✔ | | ✖ | dwc2 | | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| Sony | CXD56 | ✔ | ✖ | ✔ | cxd56 | | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| ST STM32 | F0 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +----+------------------+--------+------+-----------+-------------------+--------------+ -| | F1 | 102, 103 | ✔ | ✖ | ✖ | stm32_fsdev | | -| | +------------------+--------+------+-----------+-------------------+--------------+ -| | | 105, 107 | ✔ | | ✖ | dwc2 | | -| +----+------------------+--------+------+-----------+-------------------+--------------+ -| | F2 | ✔ | | ✔ | dwc2 | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | F3 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | F4 | ✔ | | ✔ | dwc2 | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | F7 | ✔ | | ✔ | dwc2 | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | G0 | ✔ | | ✖ | stm32_fsdev | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | G4 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | H5 | ✔ | | ✖ | stm32_fsdev | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | H7 | ✔ | | ✔ | dwc2 | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | L0 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | L1 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +----+------------------+--------+------+-----------+-------------------+--------------+ -| | L4 | 4x2, 4x3 | ✔ | ✖ | ✖ | stm32_fsdev | | -| | +------------------+--------+------+-----------+-------------------+--------------+ -| | | 4x5, 4x6 | ✔ | | ✖ | dwc2 | | -| +----+------------------+--------+------+-----------+-------------------+--------------+ -| | L4+ | ✔ | | ✖ | dwc2 | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | L5 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +----+------------------+--------+------+-----------+-------------------+--------------+ -| | U5 | 535, 545 | ✔ | | ✖ | stm32_fsdev | | -| | +------------------+--------+------+-----------+-------------------+--------------+ -| | | 575, 585 | ✔ | | ✖ | dwc2 | | -| | +------------------+--------+------+-----------+-------------------+--------------+ -| | | 59x,5Ax,5Fx,5Gx | ✔ | | ✔ | dwc2 | | -| +----+------------------+--------+------+-----------+-------------------+--------------+ -| | WBx5 | ✔ | ✖ | ✖ | stm32_fsdev | | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| TI | MSP430 | ✔ | ✖ | ✖ | msp430x5xx | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | MSP432E4 | ✔ | | ✖ | musb | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | TM4C123 | ✔ | | ✖ | musb | | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| ValentyUSB | eptri | ✔ | ✖ | ✖ | eptri | | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ -| WCH | CH32F20x | ✔ | | ✔ | ch32f205 | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | CH32V20x | ✔ | | ✖ | ch32v20x | | -| +-----------------------+--------+------+-----------+-------------------+--------------+ -| | CH32V307 | ✔ | | ✔ | ch32v307 | | -+--------------+-----------------------+--------+------+-----------+-------------------+--------------+ ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| Manufacturer | Family | Device | Host | Highspeed | Driver | Note | ++==============+=============================+========+======+===========+===================+===================+ +| Allwinner | F1C100s/F1C200s | ✔ | | ✔ | sunxi | musb variant | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| Analog | MAX3421E | | ✔ | ✖ | max3421 | via SPI | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | MAX32 650, 666, 690, | ✔ | | ✔ | musb | 1-dir ep | +| | MAX78002 | | | | | | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| Brigetek | FT90x | ✔ | | ✔ | ft9xx | 1-dir ep | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| Broadcom | BCM2711, BCM2837 | ✔ | | ✔ | dwc2 | | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| Dialog | DA1469x | ✔ | ✖ | ✖ | da146xx | | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| Espressif | ESP32 S2, S3 | ✔ | | ✖ | dwc2 or esp32sx | | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| GigaDevice | GD32VF103 | ✔ | | ✖ | dwc2 | | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| Infineon | XMC4500 | ✔ | | ✖ | dwc2 | | ++--------------+-----+-----------------------+--------+------+-----------+-------------------+-------------------+ +| MicroChip | SAM | D11, D21, L21, L22 | ✔ | | ✖ | samd | | +| | +-----------------------+--------+------+-----------+-------------------+-------------------+ +| | | D51, E5x | ✔ | | ✖ | samd | | +| | +-----------------------+--------+------+-----------+-------------------+-------------------+ +| | | G55 | ✔ | | ✖ | samg | 1-dir ep | +| | +-----------------------+--------+------+-----------+-------------------+-------------------+ +| | | E70,S70,V70,V71 | ✔ | | ✔ | samx7x | 1-dir ep | +| +-----+-----------------------+--------+------+-----------+-------------------+-------------------+ +| | PIC | 24 | ✔ | | | pic | ci_fs variant | +| | +-----------------------+--------+------+-----------+-------------------+-------------------+ +| | | 32 mm, mk, mx | ✔ | | | pic | ci_fs variant | +| | +-----------------------+--------+------+-----------+-------------------+-------------------+ +| | | dsPIC33 | ✔ | | | pic | ci_fs variant | +| | +-----------------------+--------+------+-----------+-------------------+-------------------+ +| | | 32mz | ✔ | | | pic32mz | musb variant | ++--------------+-----+-----------------------+--------+------+-----------+-------------------+-------------------+ +| Mind Montion | mm32 | ✔ | | ✖ | mm32f327x_otg | ci_fs variant | ++--------------+-----+-----------------------+--------+------+-----------+-------------------+-------------------+ +| NordicSemi | nRF 52833, 52840, 5340 | ✔ | ✖ | ✖ | nrf5x | only ep8 is ISO | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| Nuvoton | NUC120 | ✔ | ✖ | ✖ | nuc120 | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | NUC121/NUC125 | ✔ | ✖ | ✖ | nuc121 | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | NUC126 | ✔ | ✖ | ✖ | nuc121 | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | NUC505 | ✔ | | ✔ | nuc505 | | ++--------------+---------+-------------------+--------+------+-----------+-------------------+-------------------+ +| NXP | iMXRT | RT 10xx, 11xx | ✔ | ✔ | ✔ | ci_hs | | +| +---------+-------------------+--------+------+-----------+-------------------+-------------------+ +| | Kinetis | KL | ✔ | ⚠ | ✖ | ci_fs, khci | | +| | +-------------------+--------+------+-----------+-------------------+-------------------+ +| | | K32L2 | ✔ | | ✖ | khci | ci_fs variant | +| +---------+-------------------+--------+------+-----------+-------------------+-------------------+ +| | LPC | 11u, 13, 15 | ✔ | ✖ | ✖ | lpc_ip3511 | | +| | +-------------------+--------+------+-----------+-------------------+-------------------+ +| | | 17, 40 | ✔ | ⚠ | ✖ | lpc17_40 | | +| | +-------------------+--------+------+-----------+-------------------+-------------------+ +| | | 18, 43 | ✔ | ✔ | ✔ | ci_hs | | +| | +-------------------+--------+------+-----------+-------------------+-------------------+ +| | | 51u | ✔ | ✖ | ✖ | lpc_ip3511 | | +| | +-------------------+--------+------+-----------+-------------------+-------------------+ +| | | 54, 55 | ✔ | | ✔ | lpc_ip3511 | | +| +---------+-------------------+--------+------+-----------+-------------------+-------------------+ +| | MCX | N9 | ✔ | | ✔ | ci_fs, ci_hs | | ++--------------+---------+-------------------+--------+------+-----------+-------------------+-------------------+ +| Raspberry Pi | RP2040, RP2350 | ✔ | ✔ | ✖ | rp2040, pio_usb | | ++--------------+-----+-----------------------+--------+------+-----------+-------------------+-------------------+ +| Renesas | RX | 63N, 65N, 72N | ✔ | ✔ | ✖ | rusb2 | | +| +-----+-----------------------+--------+------+-----------+-------------------+-------------------+ +| | RA | 4M1, 4M3, 6M1 | ✔ | ✔ | ✖ | rusb2 | | +| | +-----------------------+--------+------+-----------+-------------------+-------------------+ +| | | 6M5 | ✔ | ✔ | ✔ | rusb2 | | ++--------------+-----+-----------------------+--------+------+-----------+-------------------+-------------------+ +| Silabs | EFM32GG12 | ✔ | | ✖ | dwc2 | | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| Sony | CXD56 | ✔ | ✖ | ✔ | cxd56 | | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| ST STM32 | F0 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +----+------------------------+--------+------+-----------+-------------------+-------------------+ +| | F1 | 102, 103 | ✔ | ✖ | ✖ | stm32_fsdev | | +| | +------------------------+--------+------+-----------+-------------------+-------------------+ +| | | 105, 107 | ✔ | | ✖ | dwc2 | | +| +----+------------------------+--------+------+-----------+-------------------+-------------------+ +| | F2 | ✔ | | ✔ | dwc2 | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | F3 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | F4 | ✔ | | ✔ | dwc2 | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | F7 | ✔ | | ✔ | dwc2 | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | G0 | ✔ | | ✖ | stm32_fsdev | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | G4 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | H5 | ✔ | | ✖ | stm32_fsdev | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | H7 | ✔ | | ✔ | dwc2 | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | L0 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | L1 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +----+------------------------+--------+------+-----------+-------------------+-------------------+ +| | L4 | 4x2, 4x3 | ✔ | ✖ | ✖ | stm32_fsdev | | +| | +------------------------+--------+------+-----------+-------------------+-------------------+ +| | | 4x5, 4x6 | ✔ | | ✖ | dwc2 | | +| +----+------------------------+--------+------+-----------+-------------------+-------------------+ +| | L4+ | ✔ | | ✖ | dwc2 | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | L5 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +----+------------------------+--------+------+-----------+-------------------+-------------------+ +| | U5 | 535, 545 | ✔ | | ✖ | stm32_fsdev | | +| | +------------------------+--------+------+-----------+-------------------+-------------------+ +| | | 575, 585 | ✔ | | ✖ | dwc2 | | +| | +------------------------+--------+------+-----------+-------------------+-------------------+ +| | | 59x,5Ax,5Fx,5Gx | ✔ | | ✔ | dwc2 | | +| +----+------------------------+--------+------+-----------+-------------------+-------------------+ +| | WBx5 | ✔ | ✖ | ✖ | stm32_fsdev | | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| TI | MSP430 | ✔ | ✖ | ✖ | msp430x5xx | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | MSP432E4 | ✔ | | ✖ | musb | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | TM4C123 | ✔ | | ✖ | musb | | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| ValentyUSB | eptri | ✔ | ✖ | ✖ | eptri | | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ +| WCH | CH32F20x | ✔ | | ✔ | ch32f205 | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | CH32V20x | ✔ | | ✖ | ch32v20x | | +| +-----------------------------+--------+------+-----------+-------------------+-------------------+ +| | CH32V307 | ✔ | | ✔ | ch32v307 | | ++--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ Table Legend diff --git a/test/hil/rpi.json b/test/hil/rpi.json index e90e435d8..b87b80300 100644 --- a/test/hil/rpi.json +++ b/test/hil/rpi.json @@ -14,6 +14,13 @@ "flasher_sn": "E6614C311B597D32", "flasher_args": "-f interface/cmsis-dap.cfg -f target/atsame5x.cfg -c \"adapter speed 5000\"" }, + { + "name": "metro_m7_1011", + "uid": "9CE8715DD71137363E00005002004200", + "flasher": "jlink", + "flasher_sn": "000611000000", + "flasher_args": "-device MIMXRT1011xxx5A" + }, { "name": "max32666fthr", "uid": "0C81464124010B20FF0A08CC2C", @@ -60,14 +67,6 @@ } ], "boards-skip": [ - { - "name": "metro_m7_1011", - "uid": "9CE8715DD71137363E00005002004200", - "flasher": "jlink", - "flasher_sn": "000611000000", - "flasher_args": "-device MIMXRT1011xxx5A", - "comment": "not running reliably in bulk with other boards, probably power, flashing etc .." - }, { "name": "nanoch32v203", "uid": "CDAB277B0FBC03E339E339E3", -- cgit v1.3.1 From 115b1bb71eec878a9e4bd06a1751f64ecfa2dcce Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 13 Sep 2024 23:23:37 +0700 Subject: prepare for 0.17.0 release --- README.rst | 6 +- docs/info/changelog.rst | 144 ++++++++++++++++++---- docs/reference/dependencies.rst | 12 +- docs/reference/supported.rst | 262 +++++++++++++++++++--------------------- library.json | 2 +- repository.yml | 3 +- tools/make_release.py | 2 +- 7 files changed, 259 insertions(+), 172 deletions(-) (limited to 'docs/reference') diff --git a/README.rst b/README.rst index 2ffe3823a..502115c25 100644 --- a/README.rst +++ b/README.rst @@ -77,7 +77,7 @@ Host Stack - Human Interface Device (HID): Keyboard, Mouse, Generic - Mass Storage Class (MSC) - Communication Device Class: CDC-ACM -- Vendor serial over USB: FTDI, CP210x +- Vendor serial over USB: FTDI, CP210x, CH34x - Hub with multiple-level support Similar to the Device Stack, if you have a special requirement, `usbh_app_driver_get_cb()` can be used to write your own class driver without modifying the stack. @@ -111,7 +111,7 @@ Following CPUs are supported, check out `Supported Devices`_ for comprehensive l +--------------+------------------------------------------------------------+ | Analog | max32: 650, 666, 690. max78002 | | | | -| | max3421e (host) | +| | max3421e (spi host) | +--------------+------------------------------------------------------------+ | Brigetek | FT90x | +--------------+------------------------------------------------------------+ @@ -143,7 +143,7 @@ Following CPUs are supported, check out `Supported Devices`_ for comprehensive l | | | | | MCX: A15, N9 | +--------------+------------------------------------------------------------+ -| Raspberry Pi | RP2040 | +| Raspberry Pi | RP2040, RP2350 | +--------------+-----+------------------------------------------------------+ | Renesas | RA: 4M1, 4M3, 6M1, 6M5 | | | | diff --git a/docs/info/changelog.rst b/docs/info/changelog.rst index f7ccb39b9..d11e1134a 100644 --- a/docs/info/changelog.rst +++ b/docs/info/changelog.rst @@ -2,71 +2,165 @@ Changelog ********* -0.17.0 (WIP) -============ +0.17.0 +====== General ------- -- Improved continuous integration: build both cmake and make. Make use of circleci to build arm-clang - +- Improved CI: build both cmake and make. Make use of CircleCI for part of build process to speed up CI +- Add CodeQL Workflow for Code Security Analysis +- Add Clang compiler support +- Add default implementation for weak callbacks functions for better Keil compatibility +- Upgrade hardware-in-the-loop (HIL) testing with more boards and examples: including dual stack example Controller Driver (DCD & HCD) ----------------------------- +- Chipidea + + - Support MCXA + +- DWC2 + + - Fix tickless issue with stm32f7: disable ULPI clock during sleep when using internal phy + - Fix SOF interrupt handling + - Fix fifo level half/empty issue + - Add DWC2 Test Mode support. + - for esp32 force disconnect/connect using USB_WRAP otg pad override + +- FSDEV + + - Rewrite and Generalize driver to support non-stm32 mcu such as wch + - Simplify PMA, HW FIFO access and bit manipulation for different access scheme 1x16, 2x16 and 32 bit + - Add support for ch32 usbd e.g ch32v203 + - Add support for STM32G4 and STM32U5 microcontrollers. + - Fix h5 (32-bit) errata 2.15.1: Buffer description table update completes after CTR interrupt triggers + - ISO EP buffer allocation improvements, implement dcd_edpt_close_all() + + - Fix ch32v203 race condition and stability issue with + + - fix ch32v203 seems to unconditionally accept ZLP on EP0 OUT. + - fix v203 race condition between rx bufsize and RX_STAT which cause PMAOVR, occurs with WRITE10 + - correctly handle setup prepare at dcd_edpt0_status_complete(), which fixes the race condition with windows where we could miss setup packet (setup bit set, but count = 0) + +- MAX3421E + + - Add support for rp2040, esp32 (c3, c6, h2, etc..) + - Add hcd_deinit() for max3421 + - Retry NAK handling next frame to reduce CPU and SPI bus usage + - add cpuctl and pinctl to tuh_configure() option for max3421 + - Implement hcd abort transfer for Max3421 + - Properly Handle NAK Response in MAX3421E driver: correctly switch and skip writing to 2 FIFOs when NAK received. Otherwise, the driver may hang in certain conditions. + +- MSP430: support non-bus-powered + +- MUSB + + - Add support for Analoog devices: max32650, max32666, max32690, max3278002 + +- nRF + + - Fix dcd_edpt_open for iso endpoint + - Handle ISOOUT CRC errors + - Add compile support with old nordic sdk + - Fix a few race conditions + +- OHCI + + - Allow more than 16 devices + +- RP2040 + + - Correctly abort control transfer when new setup arrived. Due to RP2040-E2 only able to fix B2 or later + - Implement hcd abort transfer for rp2040 + - Add support for rp2350 + +- RUSB2 + + - Support ra2a1 pipe number scheme + - WCH CH32 - Added support for USB OTG/FS and FSDev Driver. Update CH32V307 to allow manual select FS or HS driver. - Fixed various bugs in CH32v307 usbhs driver: endpoint handling and data transfer management. -- Fixed race conditions and other bugs in dcd_nrf5x and other drivers. -- Implemented hcd abort transfer for Max3421 and rp2040 -- Added DWC2 Test Mode support. -- stm32 fsdev: ISO EP buffer allocation improvements, implement dcd_edpt_close_all() -- Added support for STM32G4 and STM32U5 microcontrollers. - Device Stack ------------ -- Added tud_deinit() to deinitialize TinyUSB device stack. -- Added support for generic SOF callback. +- Add tud_deinit() and class driver deinit() to deinitialize TinyUSB device stack. +- Add support for generic SOF callback. +- Add set address recovery time 2ms per USB spec. - Audio - Add audio_test_freertos & audio_4_channel_mic_freertos - Improved support for Audio Class 2.0 (UAC2) with various bug fixes. + - Add feedback by fifo counting. + +- Bluetooth HCI + + - Issue ZLP on ACL IN ep when transfer is multiple of endpoint max packet size + +- CDC + + - Add tud_cdc_configure_fifo() to make RX/TX buffer persistent (not clear when disconnected) + - Add missing capability bit for CDC ACM serial break support + - Enhanced CDC class with better handling of large data transmissions. + - Add missing capability bit for CDC ACM serial break support - HID - Added missing key codes for keypad - Added HID Lighting and Illumination functionality + - Fixed issues in the HID class for more reliable device enumeration. + - Support HID Mouse with absolute positioning + - Use separate buffer for control SET_REPORT, fix conflict with interrupt endpoint out -- Vendor: Added empty transfers for tud_vendor_n_write() - MSC: Added support for SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL -- CDC - - - Add option to make CDC TX buffer persistent - - Add missing capability bit for CDC ACM serial break support - - Net - - Rewrite of NCM device driver + - Rewrite of NCM device driver to improve throughput - removed obsolete tud_network_link_state_cb() -- Enhanced CDC class with better handling of large data transmissions. -- Fixed issues in the HID class for more reliable device enumeration. -- Video Added support for USB Video Class (UVC) with MJPEG. - USBTMC Added notification support +- Vendor + + - Migrate to new endpoint stream API, support non-buffered TX/RX + - Add ZLP for write() when needed + +- Video + + - Enhance UVC descriptors and example + - Video Added support for USB Video Class (UVC) with MJPEG. + - Fix multiple interfaces, add an example of 2ch video capture. + - Fix race for tud_video_n_streaming check + Host Stack ---------- -- Added tuh_deinit() to deinitialize TinyUSB host stack. +- Added tuh_deinit() to de-initialize TinyUSB host stack. - Added support for new USB mass storage class APIs. -- Enhanced stability of CDC-ACM devices during enumeration. - Improved error handling and retry mechanisms for unstable devices. -- Added support for multiple interfaces in UVC. + +- CDC Serial + + - Add support for ch34x + - Allow to overwrite CFG_TUH_CDC_FTDI/CP210X/CH32X_VID_PID_LIST + - Enhanced stability of CDC-ACM devices during enumeration. + +- HID + + - Add tuh_hid_receive_abort() + - Add tuh_hid_get_report() + +- Hub + + - Prevent status request to invalid ep_num + - Fix double status xfer + - unroll hub removal 0.16.0 ====== diff --git a/docs/reference/dependencies.rst b/docs/reference/dependencies.rst index fd895519e..65ee31f22 100644 --- a/docs/reference/dependencies.rst +++ b/docs/reference/dependencies.rst @@ -8,6 +8,7 @@ MCU low-level peripheral driver and external libraries for building TinyUSB exam Local Path Repo Commit Required by ======================================== ============================================================== ======================================== ========================================================================================================================================================================================================================================================================================================================== hw/mcu/allwinner https://github.com/hathach/allwinner_driver.git 8e5e89e8e132c0fd90e72d5422e5d3d68232b756 fc100s +hw/mcu/analog/max32 https://github.com/analogdevicesinc/msdk.git b20b398d3e5e2007594e54a74ba3d2a2e50ddd75 max32650 max32666 max32690 max78002 hw/mcu/bridgetek/ft9xx/ft90x-sdk https://github.com/BRTSG-FOSS/ft90x-sdk.git 91060164afe239fcb394122e8bf9eb24d3194eb1 brtmm90x hw/mcu/broadcom https://github.com/adafruit/broadcom-peripherals.git 08370086080759ed54ac1136d62d2ad24c6fa267 broadcom_32bit broadcom_64bit hw/mcu/gd/nuclei-sdk https://github.com/Nuclei-Software/nuclei-sdk.git 7eb7bfa9ea4fbeacfafe1d5f77d5a0e6ed3922e7 gd32vf103 @@ -16,9 +17,9 @@ hw/mcu/microchip https://github.com/hathach/microchip_d hw/mcu/mindmotion/mm32sdk https://github.com/hathach/mm32sdk.git b93e856211060ae825216c6a1d6aa347ec758843 mm32 hw/mcu/nordic/nrfx https://github.com/NordicSemiconductor/nrfx.git 7c47cc0a56ce44658e6da2458e86cd8783ccc4a2 nrf hw/mcu/nuvoton https://github.com/majbthrd/nuc_driver.git 2204191ec76283371419fbcec207da02e1bc22fa nuc -hw/mcu/nxp/lpcopen https://github.com/hathach/nxp_lpcopen.git 04bfe7a5f6ee74a89a28ad618d3367dcfcfb7d83 lpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43 +hw/mcu/nxp/lpcopen https://github.com/hathach/nxp_lpcopen.git b41cf930e65c734d8ec6de04f1d57d46787c76ae lpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43 hw/mcu/nxp/mcux-sdk https://github.com/hathach/mcux-sdk.git 144f1eb7ea8c06512e12f12b27383601c0272410 kinetis_k kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx imxrt -hw/mcu/raspberry_pi/Pico-PIO-USB https://github.com/sekigon-gonnoc/Pico-PIO-USB.git 0f747aaa0c16f750bdfa2ba37ec25d6c8e1bc117 rp2040 +hw/mcu/raspberry_pi/Pico-PIO-USB https://github.com/sekigon-gonnoc/Pico-PIO-USB.git fe9133fc513b82cc3dc62c67cb51f2339cf29ef7 rp2040 hw/mcu/renesas/fsp https://github.com/renesas/fsp.git d52e5a6a59b7c638da860c2bb309b6e78e752ff8 ra hw/mcu/renesas/rx https://github.com/kkitayam/rx_device.git 706b4e0cf485605c32351e2f90f5698267996023 rx hw/mcu/silabs/cmsis-dfp-efm32gg12b https://github.com/cmsis-packs/cmsis-dfp-efm32gg12b.git f1c31b7887669cb230b3ea63f9b56769078960bc efm32 @@ -57,11 +58,12 @@ hw/mcu/st/stm32u5xx_hal_driver https://github.com/STMicroelectronics/ hw/mcu/st/stm32wbxx_hal_driver https://github.com/STMicroelectronics/stm32wbxx_hal_driver.git 2c5f06638be516c1b772f768456ba637f077bac8 stm32wb hw/mcu/ti https://github.com/hathach/ti_driver.git 143ed6cc20a7615d042b03b21e070197d473e6e5 msp430 msp432e4 tm4c hw/mcu/wch/ch32f20x https://github.com/openwch/ch32f20x.git 77c4095087e5ed2c548ec9058e655d0b8757663b ch32f20x -hw/mcu/wch/ch32v20x https://github.com/openwch/ch32v20x.git de6d68c654340d7f27b00cebbfc9aa2740a1abc2 ch32v20x -hw/mcu/wch/ch32v307 https://github.com/openwch/ch32v307.git 17761f5cf9dbbf2dcf665b7c04934188add20082 ch32v307 +hw/mcu/wch/ch32v103 https://github.com/openwch/ch32v103.git 7578cae0b21f86dd053a1f781b2fc6ab99d0ec17 ch32v10x +hw/mcu/wch/ch32v20x https://github.com/openwch/ch32v20x.git c4c38f507e258a4e69b059ccc2dc27dde33cea1b ch32v20x +hw/mcu/wch/ch32v307 https://github.com/openwch/ch32v307.git 184f21b852cb95eed58e86e901837bc9fff68775 ch32v307 lib/CMSIS_5 https://github.com/ARM-software/CMSIS_5.git 20285262657d1b482d132d20d755c8c330d55c1f imxrt kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx mm32 msp432e4 nrf ra saml2xlpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43stm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7 stm32g0 stm32g4 stm32h5stm32h7 stm32l0 stm32l1 stm32l4 stm32l5 stm32u5 stm32wbsam3x samd11 samd21 samd51 samd5x_e5x same5x same7x saml2x samgtm4c lib/FreeRTOS-Kernel https://github.com/FreeRTOS/FreeRTOS-Kernel.git cc0e0707c0c748713485b870bb980852b210877f all lib/lwip https://github.com/lwip-tcpip/lwip.git 159e31b689577dbf69cf0683bbaffbd71fa5ee10 all lib/sct_neopixel https://github.com/gsteiert/sct_neopixel.git e73e04ca63495672d955f9268e003cffe168fcd8 lpc55 -tools/uf2 https://github.com/microsoft/uf2.git 19615407727073e36d81bf239c52108ba92e7660 all +tools/uf2 https://github.com/microsoft/uf2.git c594542b2faa01cc33a2b97c9fbebc38549df80a all ======================================== ============================================================== ======================================== ========================================================================================================================================================================================================================================================================================================================== diff --git a/docs/reference/supported.rst b/docs/reference/supported.rst index 2bfa1b8d0..b871490dc 100644 --- a/docs/reference/supported.rst +++ b/docs/reference/supported.rst @@ -5,142 +5,132 @@ Supported Devices Supported MCUs ============== -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| Manufacturer | Family | Device | Host | Highspeed | Driver | Note | -+==============+=============================+========+======+===========+===================+===================+ -| Allwinner | F1C100s/F1C200s | ✔ | | ✔ | sunxi | musb variant | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| Analog | MAX3421E | | ✔ | ✖ | max3421 | via SPI | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | MAX32 650, 666, 690, | ✔ | | ✔ | musb | 1-dir ep | -| | MAX78002 | | | | | | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| Brigetek | FT90x | ✔ | | ✔ | ft9xx | 1-dir ep | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| Broadcom | BCM2711, BCM2837 | ✔ | | ✔ | dwc2 | | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| Dialog | DA1469x | ✔ | ✖ | ✖ | da146xx | | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| Espressif | ESP32 S2, S3 | ✔ | | ✖ | dwc2 or esp32sx | | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| GigaDevice | GD32VF103 | ✔ | | ✖ | dwc2 | | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| Infineon | XMC4500 | ✔ | | ✖ | dwc2 | | -+--------------+-----+-----------------------+--------+------+-----------+-------------------+-------------------+ -| MicroChip | SAM | D11, D21, L21, L22 | ✔ | | ✖ | samd | | -| | +-----------------------+--------+------+-----------+-------------------+-------------------+ -| | | D51, E5x | ✔ | | ✖ | samd | | -| | +-----------------------+--------+------+-----------+-------------------+-------------------+ -| | | G55 | ✔ | | ✖ | samg | 1-dir ep | -| | +-----------------------+--------+------+-----------+-------------------+-------------------+ -| | | E70,S70,V70,V71 | ✔ | | ✔ | samx7x | 1-dir ep | -| +-----+-----------------------+--------+------+-----------+-------------------+-------------------+ -| | PIC | 24 | ✔ | | | pic | ci_fs variant | -| | +-----------------------+--------+------+-----------+-------------------+-------------------+ -| | | 32 mm, mk, mx | ✔ | | | pic | ci_fs variant | -| | +-----------------------+--------+------+-----------+-------------------+-------------------+ -| | | dsPIC33 | ✔ | | | pic | ci_fs variant | -| | +-----------------------+--------+------+-----------+-------------------+-------------------+ -| | | 32mz | ✔ | | | pic32mz | musb variant | -+--------------+-----+-----------------------+--------+------+-----------+-------------------+-------------------+ -| Mind Montion | mm32 | ✔ | | ✖ | mm32f327x_otg | ci_fs variant | -+--------------+-----+-----------------------+--------+------+-----------+-------------------+-------------------+ -| NordicSemi | nRF 52833, 52840, 5340 | ✔ | ✖ | ✖ | nrf5x | only ep8 is ISO | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| Nuvoton | NUC120 | ✔ | ✖ | ✖ | nuc120 | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | NUC121/NUC125 | ✔ | ✖ | ✖ | nuc121 | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | NUC126 | ✔ | ✖ | ✖ | nuc121 | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | NUC505 | ✔ | | ✔ | nuc505 | | -+--------------+---------+-------------------+--------+------+-----------+-------------------+-------------------+ -| NXP | iMXRT | RT 10xx, 11xx | ✔ | ✔ | ✔ | ci_hs | | -| +---------+-------------------+--------+------+-----------+-------------------+-------------------+ -| | Kinetis | KL | ✔ | ⚠ | ✖ | ci_fs, khci | | -| | +-------------------+--------+------+-----------+-------------------+-------------------+ -| | | K32L2 | ✔ | | ✖ | khci | ci_fs variant | -| +---------+-------------------+--------+------+-----------+-------------------+-------------------+ -| | LPC | 11u, 13, 15 | ✔ | ✖ | ✖ | lpc_ip3511 | | -| | +-------------------+--------+------+-----------+-------------------+-------------------+ -| | | 17, 40 | ✔ | ⚠ | ✖ | lpc17_40 | | -| | +-------------------+--------+------+-----------+-------------------+-------------------+ -| | | 18, 43 | ✔ | ✔ | ✔ | ci_hs | | -| | +-------------------+--------+------+-----------+-------------------+-------------------+ -| | | 51u | ✔ | ✖ | ✖ | lpc_ip3511 | | -| | +-------------------+--------+------+-----------+-------------------+-------------------+ -| | | 54, 55 | ✔ | | ✔ | lpc_ip3511 | | -| +---------+-------------------+--------+------+-----------+-------------------+-------------------+ -| | MCX | N9 | ✔ | | ✔ | ci_fs, ci_hs | | -+--------------+---------+-------------------+--------+------+-----------+-------------------+-------------------+ -| Raspberry Pi | RP2040, RP2350 | ✔ | ✔ | ✖ | rp2040, pio_usb | | -+--------------+-----+-----------------------+--------+------+-----------+-------------------+-------------------+ -| Renesas | RX | 63N, 65N, 72N | ✔ | ✔ | ✖ | rusb2 | | -| +-----+-----------------------+--------+------+-----------+-------------------+-------------------+ -| | RA | 4M1, 4M3, 6M1 | ✔ | ✔ | ✖ | rusb2 | | -| | +-----------------------+--------+------+-----------+-------------------+-------------------+ -| | | 6M5 | ✔ | ✔ | ✔ | rusb2 | | -+--------------+-----+-----------------------+--------+------+-----------+-------------------+-------------------+ -| Silabs | EFM32GG12 | ✔ | | ✖ | dwc2 | | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| Sony | CXD56 | ✔ | ✖ | ✔ | cxd56 | | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| ST STM32 | F0 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +----+------------------------+--------+------+-----------+-------------------+-------------------+ -| | F1 | 102, 103 | ✔ | ✖ | ✖ | stm32_fsdev | | -| | +------------------------+--------+------+-----------+-------------------+-------------------+ -| | | 105, 107 | ✔ | | ✖ | dwc2 | | -| +----+------------------------+--------+------+-----------+-------------------+-------------------+ -| | F2 | ✔ | | ✔ | dwc2 | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | F3 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | F4 | ✔ | | ✔ | dwc2 | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | F7 | ✔ | | ✔ | dwc2 | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | G0 | ✔ | | ✖ | stm32_fsdev | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | G4 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | H5 | ✔ | | ✖ | stm32_fsdev | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | H7 | ✔ | | ✔ | dwc2 | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | L0 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | L1 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +----+------------------------+--------+------+-----------+-------------------+-------------------+ -| | L4 | 4x2, 4x3 | ✔ | ✖ | ✖ | stm32_fsdev | | -| | +------------------------+--------+------+-----------+-------------------+-------------------+ -| | | 4x5, 4x6 | ✔ | | ✖ | dwc2 | | -| +----+------------------------+--------+------+-----------+-------------------+-------------------+ -| | L4+ | ✔ | | ✖ | dwc2 | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | L5 | ✔ | ✖ | ✖ | stm32_fsdev | | -| +----+------------------------+--------+------+-----------+-------------------+-------------------+ -| | U5 | 535, 545 | ✔ | | ✖ | stm32_fsdev | | -| | +------------------------+--------+------+-----------+-------------------+-------------------+ -| | | 575, 585 | ✔ | | ✖ | dwc2 | | -| | +------------------------+--------+------+-----------+-------------------+-------------------+ -| | | 59x,5Ax,5Fx,5Gx | ✔ | | ✔ | dwc2 | | -| +----+------------------------+--------+------+-----------+-------------------+-------------------+ -| | WBx5 | ✔ | ✖ | ✖ | stm32_fsdev | | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| TI | MSP430 | ✔ | ✖ | ✖ | msp430x5xx | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | MSP432E4 | ✔ | | ✖ | musb | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | TM4C123 | ✔ | | ✖ | musb | | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| ValentyUSB | eptri | ✔ | ✖ | ✖ | eptri | | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ -| WCH | CH32F20x | ✔ | | ✔ | ch32f205 | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | CH32V20x | ✔ | | ✖ | ch32v20x | | -| +-----------------------------+--------+------+-----------+-------------------+-------------------+ -| | CH32V307 | ✔ | | ✔ | ch32v307 | | -+--------------+-----------------------------+--------+------+-----------+-------------------+-------------------+ ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| Manufacturer | Family | Device | Host | Highspeed | Driver | Note | ++==============+=============================+========+======+===========+========================+===================+ +| Allwinner | F1C100s/F1C200s | ✔ | | ✔ | sunxi | musb variant | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| Analog | MAX3421E | | ✔ | ✖ | max3421 | via SPI | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | MAX32 650, 666, 690, | ✔ | | ✔ | musb | 1-dir ep | +| | MAX78002 | | | | | | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| Brigetek | FT90x | ✔ | | ✔ | ft9xx | 1-dir ep | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| Broadcom | BCM2711, BCM2837 | ✔ | | ✔ | dwc2 | | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| Dialog | DA1469x | ✔ | ✖ | ✖ | da146xx | | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| Espressif | ESP32 S2, S3 | ✔ | | ✖ | dwc2 or esp32sx | | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| GigaDevice | GD32VF103 | ✔ | | ✖ | dwc2 | | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| Infineon | XMC4500 | ✔ | | ✖ | dwc2 | | ++--------------+-----+-----------------------+--------+------+-----------+------------------------+-------------------+ +| MicroChip | SAM | D11, D21, L21, L22 | ✔ | | ✖ | samd | | +| | +-----------------------+--------+------+-----------+------------------------+-------------------+ +| | | D51, E5x | ✔ | | ✖ | samd | | +| | +-----------------------+--------+------+-----------+------------------------+-------------------+ +| | | G55 | ✔ | | ✖ | samg | 1-dir ep | +| | +-----------------------+--------+------+-----------+------------------------+-------------------+ +| | | E70,S70,V70,V71 | ✔ | | ✔ | samx7x | 1-dir ep | +| +-----+-----------------------+--------+------+-----------+------------------------+-------------------+ +| | PIC | 24 | ✔ | | | pic | ci_fs variant | +| | +-----------------------+--------+------+-----------+------------------------+-------------------+ +| | | 32 mm, mk, mx | ✔ | | | pic | ci_fs variant | +| | +-----------------------+--------+------+-----------+------------------------+-------------------+ +| | | dsPIC33 | ✔ | | | pic | ci_fs variant | +| | +-----------------------+--------+------+-----------+------------------------+-------------------+ +| | | 32mz | ✔ | | | pic32mz | musb variant | ++--------------+-----+-----------------------+--------+------+-----------+------------------------+-------------------+ +| Mind Montion | mm32 | ✔ | | ✖ | mm32f327x_otg | ci_fs variant | ++--------------+-----+-----------------------+--------+------+-----------+------------------------+-------------------+ +| NordicSemi | nRF 52833, 52840, 5340 | ✔ | ✖ | ✖ | nrf5x | only ep8 is ISO | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| Nuvoton | NUC120 | ✔ | ✖ | ✖ | nuc120 | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | NUC121/NUC125 | ✔ | ✖ | ✖ | nuc121 | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | NUC126 | ✔ | ✖ | ✖ | nuc121 | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | NUC505 | ✔ | | ✔ | nuc505 | | ++--------------+---------+-------------------+--------+------+-----------+------------------------+-------------------+ +| NXP | iMXRT | RT 10xx, 11xx | ✔ | ✔ | ✔ | ci_hs | | +| +---------+-------------------+--------+------+-----------+------------------------+-------------------+ +| | Kinetis | KL | ✔ | ⚠ | ✖ | ci_fs, khci | | +| | +-------------------+--------+------+-----------+------------------------+-------------------+ +| | | K32L2 | ✔ | | ✖ | khci | ci_fs variant | +| +---------+-------------------+--------+------+-----------+------------------------+-------------------+ +| | LPC | 11u, 13, 15 | ✔ | ✖ | ✖ | lpc_ip3511 | | +| | +-------------------+--------+------+-----------+------------------------+-------------------+ +| | | 17, 40 | ✔ | ⚠ | ✖ | lpc17_40 | | +| | +-------------------+--------+------+-----------+------------------------+-------------------+ +| | | 18, 43 | ✔ | ✔ | ✔ | ci_hs | | +| | +-------------------+--------+------+-----------+------------------------+-------------------+ +| | | 51u | ✔ | ✖ | ✖ | lpc_ip3511 | | +| | +-------------------+--------+------+-----------+------------------------+-------------------+ +| | | 54, 55 | ✔ | | ✔ | lpc_ip3511 | | +| +---------+-------------------+--------+------+-----------+------------------------+-------------------+ +| | MCX | N9, A15 | ✔ | | ✔ | ci_fs, ci_hs | | ++--------------+---------+-------------------+--------+------+-----------+------------------------+-------------------+ +| Raspberry Pi | RP2040, RP2350 | ✔ | ✔ | ✖ | rp2040, pio_usb | | ++--------------+-----+-----------------------+--------+------+-----------+------------------------+-------------------+ +| Renesas | RX | 63N, 65N, 72N | ✔ | ✔ | ✖ | rusb2 | | +| +-----+-----------------------+--------+------+-----------+------------------------+-------------------+ +| | RA | 4M1, 4M3, 6M1 | ✔ | ✔ | ✖ | rusb2 | | +| | +-----------------------+--------+------+-----------+------------------------+-------------------+ +| | | 6M5 | ✔ | ✔ | ✔ | rusb2 | | ++--------------+-----+-----------------------+--------+------+-----------+------------------------+-------------------+ +| Silabs | EFM32GG12 | ✔ | | ✖ | dwc2 | | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| Sony | CXD56 | ✔ | ✖ | ✔ | cxd56 | | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| ST STM32 | F0 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +----+------------------------+--------+------+-----------+------------------------+-------------------+ +| | F1 | 102, 103 | ✔ | ✖ | ✖ | stm32_fsdev | | +| | +------------------------+--------+------+-----------+------------------------+-------------------+ +| | | 105, 107 | ✔ | | ✖ | dwc2 | | +| +----+------------------------+--------+------+-----------+------------------------+-------------------+ +| | F2, F4, F7, H7 | ✔ | | ✔ | dwc2 | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | F3 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | G0, H5 | ✔ | | ✖ | stm32_fsdev | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | G4 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | L0, L1 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | L4 | 4x2, 4x3 | ✔ | ✖ | ✖ | stm32_fsdev | | +| | +------------------------+--------+------+-----------+------------------------+-------------------+ +| | | 4x5, 4x6 | ✔ | | ✖ | dwc2 | | +| +----+------------------------+--------+------+-----------+------------------------+-------------------+ +| | L4+ | ✔ | | ✖ | dwc2 | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | L5 | ✔ | ✖ | ✖ | stm32_fsdev | | +| +----+------------------------+--------+------+-----------+------------------------+-------------------+ +| | U5 | 535, 545 | ✔ | | ✖ | stm32_fsdev | | +| | +------------------------+--------+------+-----------+------------------------+-------------------+ +| | | 575, 585 | ✔ | | ✖ | dwc2 | | +| | +------------------------+--------+------+-----------+------------------------+-------------------+ +| | | 59x,5Ax,5Fx,5Gx | ✔ | | ✔ | dwc2 | | +| +----+------------------------+--------+------+-----------+------------------------+-------------------+ +| | WBx5 | ✔ | ✖ | ✖ | stm32_fsdev | | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| TI | MSP430 | ✔ | ✖ | ✖ | msp430x5xx | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | MSP432E4 | ✔ | | ✖ | musb | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | TM4C123 | ✔ | | ✖ | musb | | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| ValentyUSB | eptri | ✔ | ✖ | ✖ | eptri | | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ +| WCH | CH32F20x | ✔ | | ✔ | ch32_usbhs | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | CH32V20x | ✔ | | ✖ | stm32_fsdev/ch32_usbfs | | +| +-----------------------------+--------+------+-----------+------------------------+-------------------+ +| | CH32V307 | ✔ | | ✔ | ch32_usbfs/hs | | ++--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+ Table Legend diff --git a/library.json b/library.json index 3cdd5990f..c945d4b52 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TinyUSB", - "version": "0.16.0", + "version": "0.17.0", "description": "TinyUSB is an open-source cross-platform USB Host/Device stack for embedded system, designed to be memory-safe with no dynamic allocation and thread-safe with all interrupt events are deferred then handled in the non-ISR task function.", "keywords": "usb, host, device", "repository": diff --git a/repository.yml b/repository.yml index 28666d2d4..df7895e84 100644 --- a/repository.yml +++ b/repository.yml @@ -14,5 +14,6 @@ repo.versions: "0.14.0": "0.14.0" "0.15.0": "0.15.0" "0.16.0": "0.16.0" - "0-latest": "0.16.0" + "0.17.0": "0.17.0" + "0-latest": "0.17.0" "0-dev": "0.0.0" diff --git a/tools/make_release.py b/tools/make_release.py index 126e07292..3e653c12d 100644 --- a/tools/make_release.py +++ b/tools/make_release.py @@ -1,7 +1,7 @@ import re import gen_doc -version = '0.16.0' +version = '0.17.0' print('version {}'.format(version)) ver_id = version.split('.') -- cgit v1.3.1 From 57aac432b52df6d284c98daf591e661d1c55aa05 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 10 Oct 2024 16:22:12 +0700 Subject: add new tusb_int_handler(rhport, in_isr) as common irq handler update tusb_init() to take rhport and role, defined as macro with optional argument for backward compatible --- docs/reference/getting_started.rst | 13 ++--- examples/device/audio_4_channel_mic/src/main.c | 2 +- .../device/audio_4_channel_mic_freertos/src/main.c | 2 +- examples/device/audio_test/src/main.c | 2 +- examples/device/audio_test_freertos/src/main.c | 2 +- examples/device/audio_test_multi_rate/src/main.c | 2 +- examples/device/board_test/src/tusb_config.h | 5 -- examples/device/cdc_dual_ports/src/main.c | 2 +- examples/device/cdc_msc/src/main.c | 2 +- examples/device/cdc_msc_freertos/src/main.c | 2 +- examples/device/cdc_uac2/src/main.c | 2 +- examples/device/dfu/src/main.c | 2 +- examples/device/dfu_runtime/src/main.c | 2 +- examples/device/dynamic_configuration/src/main.c | 2 +- examples/device/hid_boot_interface/src/main.c | 2 +- examples/device/hid_composite/src/main.c | 2 +- examples/device/hid_composite_freertos/src/main.c | 2 +- examples/device/hid_generic_inout/src/main.c | 2 +- examples/device/hid_multiple_interface/src/main.c | 2 +- examples/device/midi_test/src/main.c | 2 +- examples/device/msc_dual_lun/src/main.c | 2 +- examples/device/net_lwip_webserver/src/main.c | 2 +- examples/device/uac2_headset/src/main.c | 2 +- examples/device/uac2_speaker_fb/src/main.c | 2 +- examples/device/usbtmc/src/main.c | 2 +- examples/device/video_capture/src/main.c | 4 +- examples/device/video_capture_2ch/src/main.c | 4 +- examples/device/webusb_serial/src/main.c | 2 +- examples/dual/host_hid_to_device_cdc/src/main.c | 4 +- examples/dual/host_info_to_device_cdc/src/main.c | 4 +- examples/host/bare_api/src/main.c | 2 +- examples/host/cdc_msc_hid/src/main.c | 2 +- examples/host/cdc_msc_hid_freertos/src/main.c | 2 +- examples/host/device_info/CMakeLists.txt | 8 +-- examples/host/device_info/only.txt | 4 +- examples/host/device_info/src/main.c | 2 +- examples/host/hid_controller/src/main.c | 2 +- examples/host/msc_file_explorer/src/main.c | 2 +- hw/bsp/imxrt/boards/mimxrt1060_evk/board.cmake | 1 + hw/bsp/imxrt/family.c | 28 +--------- hw/bsp/lpc18/family.c | 33 +----------- hw/bsp/lpc43/family.c | 46 +++-------------- hw/bsp/lpc54/family.c | 20 ++------ hw/bsp/lpc55/family.c | 20 ++------ hw/bsp/mcx/family.c | 26 ++-------- hw/bsp/ra/family.c | 36 ++----------- hw/bsp/rp2040/family.c | 4 +- hw/bsp/stm32f4/boards/stm32f412disco/board.cmake | 1 + hw/bsp/stm32f4/family.c | 4 +- hw/bsp/stm32h7/family.c | 32 +++++------- src/common/tusb_types.h | 6 +++ src/common/tusb_verify.h | 6 +-- src/device/usbd.c | 2 +- src/host/usbh.c | 2 +- src/host/usbh.h | 5 +- src/tusb.c | 60 +++++++++++++++++++--- src/tusb.h | 26 ++++++++-- test/unit-test/test/device/msc/test_msc_device.c | 2 +- test/unit-test/test/device/usbd/test_usbd.c | 2 +- 59 files changed, 187 insertions(+), 281 deletions(-) (limited to 'docs/reference') diff --git a/docs/reference/getting_started.rst b/docs/reference/getting_started.rst index 3db3fa206..ac4ab6392 100644 --- a/docs/reference/getting_started.rst +++ b/docs/reference/getting_started.rst @@ -12,22 +12,19 @@ It is relatively simple to incorporate tinyusb to your project * Add *your_project/tinyusb/src* to your include path. Also make sure your current include path also contains the configuration file tusb_config.h. * Make sure all required macros are all defined properly in tusb_config.h (configure file in demo application is sufficient, but you need to add a few more such as CFG_TUSB_MCU, CFG_TUSB_OS since they are passed by IDE/compiler to maintain a unique configure for all boards). * If you use the device stack, make sure you have created/modified usb descriptors for your own need. Ultimately you need to implement all **tud descriptor** callbacks for the stack to work. -* Add tusb_init() call to your reset initialization code. -* Call ``tud_int_handler()`` (device) and/or ``tuh_int_handler()`` (host) in your USB IRQ Handler +* Add tusb_init(rhport, role) call to your reset initialization code. +* Call ``tusb_int_handler(rhport, in_isr)`` in your USB IRQ Handler * Implement all enabled classes's callbacks. * If you don't use any RTOSes at all, you need to continuously and/or periodically call tud_task()/tuh_task() function. All of the callbacks and functionality are handled and invoked within the call of that task runner. .. code-block:: - int main(void) - { + int main(void) { your_init_code(); - tusb_init(); // initialize tinyusb stack + tusb_init(0, TUSB_ROLE_DEVICE); // initialize device stack on roothub port 0 - while(1) // the mainloop - { + while(1) { // the mainloop your_application_code(); - tud_task(); // device task tuh_task(); // host task } diff --git a/examples/device/audio_4_channel_mic/src/main.c b/examples/device/audio_4_channel_mic/src/main.c index 10e6fe88a..6c75d95bf 100644 --- a/examples/device/audio_4_channel_mic/src/main.c +++ b/examples/device/audio_4_channel_mic/src/main.c @@ -86,7 +86,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/audio_4_channel_mic_freertos/src/main.c b/examples/device/audio_4_channel_mic_freertos/src/main.c index 08f49326c..d24113df6 100644 --- a/examples/device/audio_4_channel_mic_freertos/src/main.c +++ b/examples/device/audio_4_channel_mic_freertos/src/main.c @@ -209,7 +209,7 @@ void usb_device_task(void* param) // init device stack on configured roothub port // This should be called after scheduler/kernel is started. // Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API. - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/audio_test/src/main.c b/examples/device/audio_test/src/main.c index f79bb4468..9702060e0 100644 --- a/examples/device/audio_test/src/main.c +++ b/examples/device/audio_test/src/main.c @@ -79,7 +79,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/audio_test_freertos/src/main.c b/examples/device/audio_test_freertos/src/main.c index a3751da40..3d9166263 100644 --- a/examples/device/audio_test_freertos/src/main.c +++ b/examples/device/audio_test_freertos/src/main.c @@ -156,7 +156,7 @@ void usb_device_task(void* param) // init device stack on configured roothub port // This should be called after scheduler/kernel is started. // Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API. - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/audio_test_multi_rate/src/main.c b/examples/device/audio_test_multi_rate/src/main.c index 2ff7f10bd..99b81f74d 100644 --- a/examples/device/audio_test_multi_rate/src/main.c +++ b/examples/device/audio_test_multi_rate/src/main.c @@ -97,7 +97,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/board_test/src/tusb_config.h b/examples/device/board_test/src/tusb_config.h index 36eafe807..89c27d1c0 100644 --- a/examples/device/board_test/src/tusb_config.h +++ b/examples/device/board_test/src/tusb_config.h @@ -30,11 +30,6 @@ extern "C" { #endif -// board_test example is special example that doesn't enable device or host stack -// This can cause some TinyUSB API missing, this define hack to allow us to fill those API -// to pass the compilation process -#define tud_int_handler(x) - //-------------------------------------------------------------------- // COMMON CONFIGURATION //-------------------------------------------------------------------- diff --git a/examples/device/cdc_dual_ports/src/main.c b/examples/device/cdc_dual_ports/src/main.c index ef12186f2..07f41371a 100644 --- a/examples/device/cdc_dual_ports/src/main.c +++ b/examples/device/cdc_dual_ports/src/main.c @@ -52,7 +52,7 @@ int main(void) { board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/cdc_msc/src/main.c b/examples/device/cdc_msc/src/main.c index 4581a3bab..a1f178e2a 100644 --- a/examples/device/cdc_msc/src/main.c +++ b/examples/device/cdc_msc/src/main.c @@ -51,7 +51,7 @@ int main(void) { board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/cdc_msc_freertos/src/main.c b/examples/device/cdc_msc_freertos/src/main.c index 607d40270..b84b33a8c 100644 --- a/examples/device/cdc_msc_freertos/src/main.c +++ b/examples/device/cdc_msc_freertos/src/main.c @@ -132,7 +132,7 @@ static void usb_device_task(void *param) { // init device stack on configured roothub port // This should be called after scheduler/kernel is started. // Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API. - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/cdc_uac2/src/main.c b/examples/device/cdc_uac2/src/main.c index 25b2cd9a5..a75ec1427 100644 --- a/examples/device/cdc_uac2/src/main.c +++ b/examples/device/cdc_uac2/src/main.c @@ -46,7 +46,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); #if (CFG_TUSB_MCU == OPT_MCU_RP2040) stdio_init_all(); diff --git a/examples/device/dfu/src/main.c b/examples/device/dfu/src/main.c index 81fc0a62c..5efec9d32 100644 --- a/examples/device/dfu/src/main.c +++ b/examples/device/dfu/src/main.c @@ -75,7 +75,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/dfu_runtime/src/main.c b/examples/device/dfu_runtime/src/main.c index 170dde932..c21034fc1 100644 --- a/examples/device/dfu_runtime/src/main.c +++ b/examples/device/dfu_runtime/src/main.c @@ -70,7 +70,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/dynamic_configuration/src/main.c b/examples/device/dynamic_configuration/src/main.c index b6409c8e1..bc9ab0b2b 100644 --- a/examples/device/dynamic_configuration/src/main.c +++ b/examples/device/dynamic_configuration/src/main.c @@ -57,7 +57,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/hid_boot_interface/src/main.c b/examples/device/hid_boot_interface/src/main.c index c2aef502d..351a60854 100644 --- a/examples/device/hid_boot_interface/src/main.c +++ b/examples/device/hid_boot_interface/src/main.c @@ -57,7 +57,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/hid_composite/src/main.c b/examples/device/hid_composite/src/main.c index dcf13079f..8f7873ee3 100644 --- a/examples/device/hid_composite/src/main.c +++ b/examples/device/hid_composite/src/main.c @@ -58,7 +58,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/hid_composite_freertos/src/main.c b/examples/device/hid_composite_freertos/src/main.c index 2bd545bc2..d1842368b 100644 --- a/examples/device/hid_composite_freertos/src/main.c +++ b/examples/device/hid_composite_freertos/src/main.c @@ -136,7 +136,7 @@ void usb_device_task(void* param) // init device stack on configured roothub port // This should be called after scheduler/kernel is started. // Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API. - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/hid_generic_inout/src/main.c b/examples/device/hid_generic_inout/src/main.c index cfa9f6283..03de8bfee 100644 --- a/examples/device/hid_generic_inout/src/main.c +++ b/examples/device/hid_generic_inout/src/main.c @@ -81,7 +81,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/hid_multiple_interface/src/main.c b/examples/device/hid_multiple_interface/src/main.c index 30b4ae055..0b7544fe0 100644 --- a/examples/device/hid_multiple_interface/src/main.c +++ b/examples/device/hid_multiple_interface/src/main.c @@ -62,7 +62,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/midi_test/src/main.c b/examples/device/midi_test/src/main.c index b1d51598f..84ca1d944 100644 --- a/examples/device/midi_test/src/main.c +++ b/examples/device/midi_test/src/main.c @@ -63,7 +63,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/msc_dual_lun/src/main.c b/examples/device/msc_dual_lun/src/main.c index aabd0bf8a..9b0930ce0 100644 --- a/examples/device/msc_dual_lun/src/main.c +++ b/examples/device/msc_dual_lun/src/main.c @@ -54,7 +54,7 @@ int main(void) { board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/net_lwip_webserver/src/main.c b/examples/device/net_lwip_webserver/src/main.c index 791e09b4f..dbd7746b0 100644 --- a/examples/device/net_lwip_webserver/src/main.c +++ b/examples/device/net_lwip_webserver/src/main.c @@ -216,7 +216,7 @@ int main(void) { board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/uac2_headset/src/main.c b/examples/device/uac2_headset/src/main.c index c285211b8..73616109f 100644 --- a/examples/device/uac2_headset/src/main.c +++ b/examples/device/uac2_headset/src/main.c @@ -100,7 +100,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/uac2_speaker_fb/src/main.c b/examples/device/uac2_speaker_fb/src/main.c index 0a8529a61..21c2ac24a 100644 --- a/examples/device/uac2_speaker_fb/src/main.c +++ b/examples/device/uac2_speaker_fb/src/main.c @@ -106,7 +106,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/usbtmc/src/main.c b/examples/device/usbtmc/src/main.c index 9d8f0783d..8dbded632 100644 --- a/examples/device/usbtmc/src/main.c +++ b/examples/device/usbtmc/src/main.c @@ -55,7 +55,7 @@ int main(void) board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/video_capture/src/main.c b/examples/device/video_capture/src/main.c index ddb51e03a..4b8877a2f 100644 --- a/examples/device/video_capture/src/main.c +++ b/examples/device/video_capture/src/main.c @@ -68,7 +68,7 @@ int main(void) { freertos_init_task(); #else // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); @@ -319,7 +319,7 @@ void usb_device_task(void *param) { // init device stack on configured roothub port // This should be called after scheduler/kernel is started. // Otherwise, it could cause kernel issue since USB IRQ handler does use RTOS queue API. - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/video_capture_2ch/src/main.c b/examples/device/video_capture_2ch/src/main.c index e8c2ec6b0..118ee669d 100644 --- a/examples/device/video_capture_2ch/src/main.c +++ b/examples/device/video_capture_2ch/src/main.c @@ -68,7 +68,7 @@ int main(void) { freertos_init_task(); #else // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); @@ -327,7 +327,7 @@ void usb_device_task(void *param) { // init device stack on configured roothub port // This should be called after scheduler/kernel is started. // Otherwise, it could cause kernel issue since USB IRQ handler does use RTOS queue API. - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/device/webusb_serial/src/main.c b/examples/device/webusb_serial/src/main.c index bcc33f657..e809c6319 100644 --- a/examples/device/webusb_serial/src/main.c +++ b/examples/device/webusb_serial/src/main.c @@ -91,7 +91,7 @@ int main(void) { board_init(); // init device stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/dual/host_hid_to_device_cdc/src/main.c b/examples/dual/host_hid_to_device_cdc/src/main.c index 0b4165e38..ce586201c 100644 --- a/examples/dual/host_hid_to_device_cdc/src/main.c +++ b/examples/dual/host_hid_to_device_cdc/src/main.c @@ -79,8 +79,8 @@ int main(void) { printf("TinyUSB Host HID <-> Device CDC Example\r\n"); // init device and host stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); - tuh_init(BOARD_TUH_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); + tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/dual/host_info_to_device_cdc/src/main.c b/examples/dual/host_info_to_device_cdc/src/main.c index 443cc4674..7a862f5ad 100644 --- a/examples/dual/host_info_to_device_cdc/src/main.c +++ b/examples/dual/host_info_to_device_cdc/src/main.c @@ -82,8 +82,8 @@ int main(void) { printf("TinyUSB Host Information -> Device CDC Example\r\n"); // init device and host stack on configured roothub port - tud_init(BOARD_TUD_RHPORT); - tuh_init(BOARD_TUH_RHPORT); + tusb_init(BOARD_TUD_RHPORT, TUSB_ROLE_DEVICE); + tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/host/bare_api/src/main.c b/examples/host/bare_api/src/main.c index ae574c078..f248dd28d 100644 --- a/examples/host/bare_api/src/main.c +++ b/examples/host/bare_api/src/main.c @@ -62,7 +62,7 @@ int main(void) printf("TinyUSB Bare API Example\r\n"); // init host stack on configured roothub port - tuh_init(BOARD_TUH_RHPORT); + tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/host/cdc_msc_hid/src/main.c b/examples/host/cdc_msc_hid/src/main.c index a3b80e030..65f7b5201 100644 --- a/examples/host/cdc_msc_hid/src/main.c +++ b/examples/host/cdc_msc_hid/src/main.c @@ -50,7 +50,7 @@ int main(void) { printf("TinyUSB Host CDC MSC HID Example\r\n"); // init host stack on configured roothub port - tuh_init(BOARD_TUH_RHPORT); + tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/host/cdc_msc_hid_freertos/src/main.c b/examples/host/cdc_msc_hid_freertos/src/main.c index fa799aede..2116e6dcf 100644 --- a/examples/host/cdc_msc_hid_freertos/src/main.c +++ b/examples/host/cdc_msc_hid_freertos/src/main.c @@ -126,7 +126,7 @@ static void usb_host_task(void *param) { (void) param; // init host stack on configured roothub port - if (!tuh_init(BOARD_TUH_RHPORT)) { + if (!tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST)) { printf("Failed to init USB Host Stack\r\n"); vTaskSuspend(NULL); } diff --git a/examples/host/device_info/CMakeLists.txt b/examples/host/device_info/CMakeLists.txt index 76182d6fa..6a16155ec 100644 --- a/examples/host/device_info/CMakeLists.txt +++ b/examples/host/device_info/CMakeLists.txt @@ -19,13 +19,13 @@ add_executable(${PROJECT}) # Example source target_sources(${PROJECT} PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c - ) + ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c + ) # Example include target_include_directories(${PROJECT} PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/src - ) + ${CMAKE_CURRENT_SOURCE_DIR}/src + ) # Configure compilation flags and libraries for the example without RTOS. # See the corresponding function in hw/bsp/FAMILY/family.cmake for details. diff --git a/examples/host/device_info/only.txt b/examples/host/device_info/only.txt index fee10f9e2..b3f4468bb 100644 --- a/examples/host/device_info/only.txt +++ b/examples/host/device_info/only.txt @@ -4,11 +4,11 @@ mcu:LPC177X_8X mcu:LPC18XX mcu:LPC40XX mcu:LPC43XX +mcu:MAX3421 mcu:MIMXRT1XXX mcu:MIMXRT10XX mcu:MIMXRT11XX -mcu:RP2040 mcu:MSP432E4 +mcu:RP2040 mcu:RX65X mcu:RAXXX -mcu:MAX3421 diff --git a/examples/host/device_info/src/main.c b/examples/host/device_info/src/main.c index 18beea663..55d685a5d 100644 --- a/examples/host/device_info/src/main.c +++ b/examples/host/device_info/src/main.c @@ -66,7 +66,7 @@ int main(void) { printf("TinyUSB Device Info Example\r\n"); // init host stack on configured roothub port - tuh_init(BOARD_TUH_RHPORT); + tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/host/hid_controller/src/main.c b/examples/host/hid_controller/src/main.c index 05a5ae176..76b686683 100644 --- a/examples/host/hid_controller/src/main.c +++ b/examples/host/hid_controller/src/main.c @@ -52,7 +52,7 @@ int main(void) printf("Note: Events only displayed for explicit supported controllers\r\n"); // init host stack on configured roothub port - tuh_init(BOARD_TUH_RHPORT); + tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/examples/host/msc_file_explorer/src/main.c b/examples/host/msc_file_explorer/src/main.c index f6b6810f5..3af079b0e 100644 --- a/examples/host/msc_file_explorer/src/main.c +++ b/examples/host/msc_file_explorer/src/main.c @@ -78,7 +78,7 @@ int main(void) { printf("TinyUSB Host MassStorage Explorer Example\r\n"); // init host stack on configured roothub port - tuh_init(BOARD_TUH_RHPORT); + tusb_init(BOARD_TUH_RHPORT, TUSB_ROLE_HOST); if (board_init_after_tusb) { board_init_after_tusb(); diff --git a/hw/bsp/imxrt/boards/mimxrt1060_evk/board.cmake b/hw/bsp/imxrt/boards/mimxrt1060_evk/board.cmake index fd335cdf5..f70a5f923 100644 --- a/hw/bsp/imxrt/boards/mimxrt1060_evk/board.cmake +++ b/hw/bsp/imxrt/boards/mimxrt1060_evk/board.cmake @@ -1,6 +1,7 @@ set(MCU_VARIANT MIMXRT1062) set(JLINK_DEVICE MIMXRT1062xxx6A) +#set(JLINK_OPTION "-USB 000726129165") set(PYOCD_TARGET mimxrt1060) set(NXPLINK_DEVICE MIMXRT1062xxxxA:EVK-MIMXRT1060) diff --git a/hw/bsp/imxrt/family.c b/hw/bsp/imxrt/family.c index 2f305aa4d..6087ee37d 100644 --- a/hw/bsp/imxrt/family.c +++ b/hw/bsp/imxrt/family.c @@ -46,18 +46,6 @@ #pragma GCC diagnostic pop #endif -#if defined(BOARD_TUD_RHPORT) && CFG_TUD_ENABLED - #define PORT_SUPPORT_DEVICE(_n) (BOARD_TUD_RHPORT == _n) -#else - #define PORT_SUPPORT_DEVICE(_n) 0 -#endif - -#if defined(BOARD_TUH_RHPORT) && CFG_TUH_ENABLED - #define PORT_SUPPORT_HOST(_n) (BOARD_TUH_RHPORT == _n) -#else - #define PORT_SUPPORT_HOST(_n) 0 -#endif - // needed by fsl_flexspi_nor_boot TU_ATTR_USED const uint8_t dcd_data[] = { 0x00 }; @@ -156,23 +144,11 @@ void board_init(void) // USB Interrupt Handler //--------------------------------------------------------------------+ void USB_OTG1_IRQHandler(void) { - #if PORT_SUPPORT_DEVICE(0) - tud_int_handler(0); - #endif - - #if PORT_SUPPORT_HOST(0) - tuh_int_handler(0, true); - #endif + tusb_int_handler(0, true); } void USB_OTG2_IRQHandler(void) { - #if PORT_SUPPORT_DEVICE(1) - tud_int_handler(1); - #endif - - #if PORT_SUPPORT_HOST(1) - tuh_int_handler(1, true); - #endif + tusb_int_handler(1, true); } //--------------------------------------------------------------------+ diff --git a/hw/bsp/lpc18/family.c b/hw/bsp/lpc18/family.c index e6abecb4b..55ef31ee4 100644 --- a/hw/bsp/lpc18/family.c +++ b/hw/bsp/lpc18/family.c @@ -28,39 +28,15 @@ #include "bsp/board_api.h" #include "board.h" -#ifdef BOARD_TUD_RHPORT - #define PORT_SUPPORT_DEVICE(_n) (BOARD_TUD_RHPORT == _n) -#else - #define PORT_SUPPORT_DEVICE(_n) 0 -#endif - -#ifdef BOARD_TUH_RHPORT - #define PORT_SUPPORT_HOST(_n) (BOARD_TUH_RHPORT == _n) -#else - #define PORT_SUPPORT_HOST(_n) 0 -#endif - //--------------------------------------------------------------------+ // USB Interrupt Handler //--------------------------------------------------------------------+ void USB0_IRQHandler(void) { - #if PORT_SUPPORT_DEVICE(0) - tud_int_handler(0); - #endif - - #if PORT_SUPPORT_HOST(0) - tuh_int_handler(0, true); - #endif + tusb_int_handler(0, true); } void USB1_IRQHandler(void) { - #if PORT_SUPPORT_DEVICE(1) - tud_int_handler(1); - #endif - - #if PORT_SUPPORT_HOST(1) - tuh_int_handler(1, true); - #endif + tusb_int_handler(1, true); } //--------------------------------------------------------------------+ @@ -118,13 +94,8 @@ void board_init(void) { Chip_UART_TXEnable(UART_DEV); //------------- USB -------------// -#if PORT_SUPPORT_DEVICE(0) || PORT_SUPPORT_HOST(0) Chip_USB0_Init(); -#endif - -#if PORT_SUPPORT_DEVICE(1) || PORT_SUPPORT_HOST(1) Chip_USB1_Init(); -#endif } //--------------------------------------------------------------------+ diff --git a/hw/bsp/lpc43/family.c b/hw/bsp/lpc43/family.c index 8be729f7d..dfee9f5ea 100644 --- a/hw/bsp/lpc43/family.c +++ b/hw/bsp/lpc43/family.c @@ -39,18 +39,6 @@ #include "bsp/board_api.h" #include "board.h" -#ifdef BOARD_TUD_RHPORT - #define PORT_SUPPORT_DEVICE(_n) (BOARD_TUD_RHPORT == _n) -#else - #define PORT_SUPPORT_DEVICE(_n) 0 -#endif - -#ifdef BOARD_TUH_RHPORT - #define PORT_SUPPORT_HOST(_n) (BOARD_TUH_RHPORT == _n) -#else - #define PORT_SUPPORT_HOST(_n) 0 -#endif - /* System configuration variables used by chip driver */ const uint32_t OscRateIn = 12000000; const uint32_t ExtRateIn = 0; @@ -161,9 +149,7 @@ void board_init(void) * - Insert jumpers in position 2-3 in JP17/JP18/JP19 * - Insert jumpers in JP31 (OTG) */ -#if PORT_SUPPORT_DEVICE(0) || PORT_SUPPORT_HOST(0) Chip_USB0_Init(); -#endif /* From EA4357 user manual * @@ -186,17 +172,15 @@ void board_init(void) * - LED34 lights green when +5V is available on J20. * - JP15 shall not be inserted. JP16 has no effect */ -#if PORT_SUPPORT_DEVICE(1) || PORT_SUPPORT_HOST(1) Chip_USB1_Init(); -#endif // USB0 Vbus Power: P2_3 on EA4357 channel B U20 GPIO26 active low (base board) Chip_SCU_PinMuxSet(2, 3, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC7); - #if PORT_SUPPORT_DEVICE(0) - // P9_5 (GPIO5[18]) (GPIO28 on oem base) as USB connect, active low. - Chip_SCU_PinMuxSet(9, 5, SCU_MODE_PULLDOWN | SCU_MODE_FUNC4); - Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 5, 18); + #if defined(BOARD_TUD_RHPORT) && BOARD_TUD_RHPORT == 0 + // P9_5 (GPIO5[18]) (GPIO28 on oem base) as USB connect, active low. + Chip_SCU_PinMuxSet(9, 5, SCU_MODE_PULLDOWN | SCU_MODE_FUNC4); + Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 5, 18); #endif // USB1 Power: EA4357 channel A U20 is enabled by SJ5 connected to pad 1-2, no more action required @@ -206,26 +190,12 @@ void board_init(void) //--------------------------------------------------------------------+ // USB Interrupt Handler //--------------------------------------------------------------------+ -void USB0_IRQHandler(void) -{ - #if PORT_SUPPORT_DEVICE(0) - tud_int_handler(0); - #endif - - #if PORT_SUPPORT_HOST(0) - tuh_int_handler(0, true); - #endif +void USB0_IRQHandler(void) { + tusb_int_handler(0, true); } -void USB1_IRQHandler(void) -{ - #if PORT_SUPPORT_DEVICE(1) - tud_int_handler(1); - #endif - - #if PORT_SUPPORT_HOST(1) - tuh_int_handler(1, true); - #endif +void USB1_IRQHandler(void) { + tusb_int_handler(1, true); } //--------------------------------------------------------------------+ diff --git a/hw/bsp/lpc54/family.c b/hw/bsp/lpc54/family.c index 5e5732d74..5e6ff2231 100644 --- a/hw/bsp/lpc54/family.c +++ b/hw/bsp/lpc54/family.c @@ -33,18 +33,6 @@ #include "bsp/board_api.h" #include "board.h" -#ifdef BOARD_TUD_RHPORT - #define PORT_SUPPORT_DEVICE(_n) (BOARD_TUD_RHPORT == _n) -#else - #define PORT_SUPPORT_DEVICE(_n) 0 -#endif - -#ifdef BOARD_TUH_RHPORT - #define PORT_SUPPORT_HOST(_n) (BOARD_TUH_RHPORT == _n) -#else - #define PORT_SUPPORT_HOST(_n) 0 -#endif - //--------------------------------------------------------------------+ // MACRO TYPEDEF CONSTANT ENUM //--------------------------------------------------------------------+ @@ -71,11 +59,11 @@ // Forward USB interrupt events to TinyUSB IRQ Handler //--------------------------------------------------------------------+ void USB0_IRQHandler(void) { - tud_int_handler(0); + tusb_int_handler(0, true); } void USB1_IRQHandler(void) { - tud_int_handler(1); + tusb_int_handler(1, true); } /**************************************************************** @@ -160,7 +148,7 @@ void board_init(void) { #if defined(FSL_FEATURE_SOC_USBHSD_COUNT) && FSL_FEATURE_SOC_USBHSD_COUNT // LPC546xx and LPC540xx has OTG 1 FS + 1 HS rhports - #if PORT_SUPPORT_DEVICE(0) + #if defined(BOARD_TUD_RHPORT) && BOARD_TUD_RHPORT == 0 // Port0 is Full Speed POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY); /*< Turn on USB Phy */ CLOCK_SetClkDiv(kCLOCK_DivUsb0Clk, 1, false); @@ -174,7 +162,7 @@ void board_init(void) { CLOCK_EnableUsbfs0DeviceClock(kCLOCK_UsbSrcFro, CLOCK_GetFroHfFreq()); #endif - #if PORT_SUPPORT_DEVICE(1) + #if defined(BOARD_TUD_RHPORT) && BOARD_TUD_RHPORT == 1 // Port1 is High Speed POWER_DisablePD(kPDRUNCFG_PD_USB1_PHY); diff --git a/hw/bsp/lpc55/family.c b/hw/bsp/lpc55/family.c index 075832ea7..68ccf52d5 100644 --- a/hw/bsp/lpc55/family.c +++ b/hw/bsp/lpc55/family.c @@ -37,18 +37,6 @@ #include "sct_neopixel.h" #endif -#ifdef BOARD_TUD_RHPORT - #define PORT_SUPPORT_DEVICE(_n) (BOARD_TUD_RHPORT == _n) -#else - #define PORT_SUPPORT_DEVICE(_n) 0 -#endif - -#ifdef BOARD_TUH_RHPORT - #define PORT_SUPPORT_HOST(_n) (BOARD_TUH_RHPORT == _n) -#else - #define PORT_SUPPORT_HOST(_n) 0 -#endif - //--------------------------------------------------------------------+ // MACRO TYPEDEF CONSTANT ENUM //--------------------------------------------------------------------+ @@ -73,11 +61,11 @@ // Forward USB interrupt events to TinyUSB IRQ Handler //--------------------------------------------------------------------+ void USB0_IRQHandler(void) { - tud_int_handler(0); + tusb_int_handler(0, true); } void USB1_IRQHandler(void) { - tud_int_handler(1); + tusb_int_handler(1, true); } /**************************************************************** @@ -209,7 +197,7 @@ void board_init(void) { /* PORT0 PIN22 configured as USB0_VBUS */ IOCON_PinMuxSet(IOCON, 0U, 22U, IOCON_PIO_DIG_FUNC7_EN); -#if PORT_SUPPORT_DEVICE(0) +#if defined(BOARD_TUD_RHPORT) && BOARD_TUD_RHPORT == 0 // Port0 is Full Speed /* Turn on USB0 Phy */ @@ -234,7 +222,7 @@ void board_init(void) { CLOCK_EnableUsbfs0DeviceClock(kCLOCK_UsbfsSrcFro, CLOCK_GetFreq(kCLOCK_FroHf)); #endif -#if PORT_SUPPORT_DEVICE(1) +#if defined(BOARD_TUD_RHPORT) && BOARD_TUD_RHPORT == 1 // Port1 is High Speed /* Turn on USB1 Phy */ diff --git a/hw/bsp/mcx/family.c b/hw/bsp/mcx/family.c index cc675a49d..ce54097fe 100644 --- a/hw/bsp/mcx/family.c +++ b/hw/bsp/mcx/family.c @@ -33,39 +33,23 @@ #include "pin_mux.h" #include "clock_config.h" -//--------------------------------------------------------------------+ -// MACRO TYPEDEF CONSTANT ENUM -//--------------------------------------------------------------------+ - -#ifdef BOARD_TUD_RHPORT - #define PORT_SUPPORT_DEVICE(_n) (BOARD_TUD_RHPORT == _n) -#else - #define PORT_SUPPORT_DEVICE(_n) 0 -#endif - -#ifdef BOARD_TUH_RHPORT - #define PORT_SUPPORT_HOST(_n) (BOARD_TUH_RHPORT == _n) -#else - #define PORT_SUPPORT_HOST(_n) 0 -#endif - //--------------------------------------------------------------------+ // Forward USB interrupt events to TinyUSB IRQ Handler //--------------------------------------------------------------------+ #if CFG_TUSB_MCU == OPT_MCU_MCXN9 void USB0_FS_IRQHandler(void) { - tud_int_handler(0); + tusb_int_handler(0, true); } void USB1_HS_IRQHandler(void) { - tud_int_handler(1); + tusb_int_handler(1, true); } #elif CFG_TUSB_MCU == OPT_MCU_MCXA15 void USB0_IRQHandler(void) { - tud_int_handler(0); + tusb_int_handler(0, true); } #endif @@ -133,7 +117,7 @@ void board_init(void) { // USB VBUS /* PORT0 PIN22 configured as USB0_VBUS */ -#if PORT_SUPPORT_DEVICE(0) +#if defined(BOARD_TUD_RHPORT) && BOARD_TUD_RHPORT == 0 // Port0 is Full Speed #if CFG_TUSB_MCU == OPT_MCU_MCXA15 @@ -147,7 +131,7 @@ void board_init(void) { CLOCK_EnableUsbfsClock(); #endif -#if PORT_SUPPORT_DEVICE(1) && (CFG_TUSB_MCU == OPT_MCU_MCXN9) +#if defined(BOARD_TUD_RHPORT) && BOARD_TUD_RHPORT == 1 && (CFG_TUSB_MCU == OPT_MCU_MCXN9) // Port1 is High Speed // Power diff --git a/hw/bsp/ra/family.c b/hw/bsp/ra/family.c index a8b4ebcc7..87f7b4a22 100644 --- a/hw/bsp/ra/family.c +++ b/hw/bsp/ra/family.c @@ -182,43 +182,19 @@ uint32_t board_millis(void) { // Forward USB interrupt events to TinyUSB IRQ Handler //--------------------------------------------------------------------+ -#if CFG_TUD_ENABLED && defined(BOARD_TUD_RHPORT) - #define PORT_SUPPORT_DEVICE(_n) (BOARD_TUD_RHPORT == _n) -#else - #define PORT_SUPPORT_DEVICE(_n) 0 -#endif - -#if CFG_TUH_ENABLED && defined(BOARD_TUH_RHPORT) - #define PORT_SUPPORT_HOST(_n) (BOARD_TUH_RHPORT == _n) -#else - #define PORT_SUPPORT_HOST(_n) 0 -#endif - //------------- USB0 FullSpeed -------------// void usbfs_interrupt_handler(void) { IRQn_Type irq = R_FSP_CurrentIrqGet(); R_BSP_IrqStatusClear(irq); - #if PORT_SUPPORT_HOST(0) - tuh_int_handler(0, true); - #endif - - #if PORT_SUPPORT_DEVICE(0) - tud_int_handler(0); - #endif + tusb_int_handler(0, true); } void usbfs_resume_handler(void) { IRQn_Type irq = R_FSP_CurrentIrqGet(); R_BSP_IrqStatusClear(irq); - #if PORT_SUPPORT_HOST(0) - tuh_int_handler(0, true); - #endif - - #if PORT_SUPPORT_DEVICE(0) - tud_int_handler(0); - #endif + tusb_int_handler(0, true); } void usbfs_d0fifo_handler(void) { @@ -240,13 +216,7 @@ void usbhs_interrupt_handler(void) { IRQn_Type irq = R_FSP_CurrentIrqGet(); R_BSP_IrqStatusClear(irq); - #if PORT_SUPPORT_HOST(1) - tuh_int_handler(1, true); - #endif - - #if PORT_SUPPORT_DEVICE(1) - tud_int_handler(1); - #endif + tusb_int_handler(1, true); } void usbhs_d0fifo_handler(void) { diff --git a/hw/bsp/rp2040/family.c b/hw/bsp/rp2040/family.c index 64a3a0af6..ccc1e1f70 100644 --- a/hw/bsp/rp2040/family.c +++ b/hw/bsp/rp2040/family.c @@ -205,7 +205,9 @@ size_t board_get_unique_id(uint8_t id[], size_t max_len) { pico_get_unique_board_id(&pico_id); size_t len = PICO_UNIQUE_BOARD_ID_SIZE_BYTES; - if (len > max_len) len = max_len; + if (len > max_len) { + len = max_len; + } memcpy(id, pico_id.id, len); return len; diff --git a/hw/bsp/stm32f4/boards/stm32f412disco/board.cmake b/hw/bsp/stm32f4/boards/stm32f412disco/board.cmake index f9e834409..c282af98e 100644 --- a/hw/bsp/stm32f4/boards/stm32f412disco/board.cmake +++ b/hw/bsp/stm32f4/boards/stm32f412disco/board.cmake @@ -1,5 +1,6 @@ set(MCU_VARIANT stm32f412zx) set(JLINK_DEVICE stm32f412zg) +# set(JLINK_OPTION "-USB 000771775987") set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32F412ZGTx_FLASH.ld) diff --git a/hw/bsp/stm32f4/family.c b/hw/bsp/stm32f4/family.c index fb0347aba..b4a661421 100644 --- a/hw/bsp/stm32f4/family.c +++ b/hw/bsp/stm32f4/family.c @@ -32,11 +32,11 @@ // Forward USB interrupt events to TinyUSB IRQ Handler //--------------------------------------------------------------------+ void OTG_FS_IRQHandler(void) { - tud_int_handler(0); + tusb_int_handler(0, true); } void OTG_HS_IRQHandler(void) { - tud_int_handler(1); + tusb_int_handler(1, true); } //--------------------------------------------------------------------+ diff --git a/hw/bsp/stm32h7/family.c b/hw/bsp/stm32h7/family.c index c81437958..6e4b388d6 100644 --- a/hw/bsp/stm32h7/family.c +++ b/hw/bsp/stm32h7/family.c @@ -35,6 +35,12 @@ TU_ATTR_UNUSED static void Error_Handler(void) { #include "board.h" +//--------------------------------------------------------------------+ +// MACRO TYPEDEF CONSTANT ENUM +//--------------------------------------------------------------------+ + +UART_HandleTypeDef UartHandle; + //--------------------------------------------------------------------+ // Forward USB interrupt events to TinyUSB IRQ Handler //--------------------------------------------------------------------+ @@ -42,26 +48,15 @@ TU_ATTR_UNUSED static void Error_Handler(void) { // Despite being call USB2_OTG_FS on some MCUs // OTG_FS is marked as RHPort0 by TinyUSB to be consistent across stm32 port void OTG_FS_IRQHandler(void) { - tud_int_handler(0); + tusb_int_handler(0, true); } // Despite being call USB1_OTG_HS on some MCUs // OTG_HS is marked as RHPort1 by TinyUSB to be consistent across stm32 port void OTG_HS_IRQHandler(void) { - tud_int_handler(1); + tusb_int_handler(1, true); } - -//--------------------------------------------------------------------+ -// MACRO TYPEDEF CONSTANT ENUM -//--------------------------------------------------------------------+ - -UART_HandleTypeDef UartHandle; - -//--------------------------------------------------------------------+ -// -//--------------------------------------------------------------------+ - #ifdef TRACE_ETM void trace_etm_init(void) { // H7 trace pin is PE2 to PE6 @@ -111,9 +106,10 @@ void board_init(void) { SysTick->CTRL &= ~1U; // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher ) -#ifdef USB_OTG_FS_PERIPH_BASE + #ifdef USB_OTG_FS_PERIPH_BASE NVIC_SetPriority(OTG_FS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY ); -#endif + #endif + NVIC_SetPriority(OTG_HS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY ); #endif @@ -206,13 +202,11 @@ void board_init(void) { struct { GPIO_TypeDef* port; uint32_t pin; - } const ulpi_pins[] = - { + } const ulpi_pins[] = { ULPI_PINS }; - for (uint8_t i=0; i < sizeof(ulpi_pins)/sizeof(ulpi_pins[0]); i++) - { + for (uint8_t i=0; i < sizeof(ulpi_pins)/sizeof(ulpi_pins[0]); i++) { GPIO_InitStruct.Pin = ulpi_pins[i].pin; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; diff --git a/src/common/tusb_types.h b/src/common/tusb_types.h index 1501a5af6..adf4b5720 100644 --- a/src/common/tusb_types.h +++ b/src/common/tusb_types.h @@ -39,6 +39,12 @@ /* CONSTANTS *------------------------------------------------------------------*/ +typedef enum { + TUSB_ROLE_INVALID = 0, + TUSB_ROLE_DEVICE, + TUSB_ROLE_HOST, +} tusb_role_t; + /// defined base on EHCI specs value for Endpoint Speed typedef enum { TUSB_SPEED_FULL = 0, diff --git a/src/common/tusb_verify.h b/src/common/tusb_verify.h index 4344575b7..8ad218b03 100644 --- a/src/common/tusb_verify.h +++ b/src/common/tusb_verify.h @@ -94,7 +94,7 @@ #endif // Helper to implement optional parameter for TU_VERIFY Macro family -#define _GET_3RD_ARG(arg1, arg2, arg3, ...) arg3 +#define TU_GET_3RD_ARG(arg1, arg2, arg3, ...) arg3 /*------------------------------------------------------------------*/ /* TU_VERIFY @@ -109,7 +109,7 @@ #define TU_VERIFY_1ARGS(_cond) TU_VERIFY_DEFINE(_cond, false) #define TU_VERIFY_2ARGS(_cond, _ret) TU_VERIFY_DEFINE(_cond, _ret) -#define TU_VERIFY(...) _GET_3RD_ARG(__VA_ARGS__, TU_VERIFY_2ARGS, TU_VERIFY_1ARGS, _dummy)(__VA_ARGS__) +#define TU_VERIFY(...) TU_GET_3RD_ARG(__VA_ARGS__, TU_VERIFY_2ARGS, TU_VERIFY_1ARGS, _dummy)(__VA_ARGS__) /*------------------------------------------------------------------*/ /* ASSERT @@ -126,7 +126,7 @@ #define TU_ASSERT_2ARGS(_cond, _ret) TU_ASSERT_DEFINE(_cond, _ret) #ifndef TU_ASSERT -#define TU_ASSERT(...) _GET_3RD_ARG(__VA_ARGS__, TU_ASSERT_2ARGS, TU_ASSERT_1ARGS, _dummy)(__VA_ARGS__) +#define TU_ASSERT(...) TU_GET_3RD_ARG(__VA_ARGS__, TU_ASSERT_2ARGS, TU_ASSERT_1ARGS, _dummy)(__VA_ARGS__) #endif #ifdef __cplusplus diff --git a/src/device/usbd.c b/src/device/usbd.c index 67faf0da7..6fe7e416e 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -557,7 +557,7 @@ bool tud_task_event_ready(void) { * int main(void) { application_init(); - tusb_init(); + tusb_init(0, TUSB_ROLE_DEVICE); while(1) { // the mainloop application_code(); diff --git a/src/host/usbh.c b/src/host/usbh.c index 8c488aaa2..ed253ffcc 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -459,7 +459,7 @@ bool tuh_task_event_ready(void) { int main(void) { application_init(); - tusb_init(); + tusb_init(0, TUSB_ROLE_HOST); while(1) // the mainloop { diff --git a/src/host/usbh.h b/src/host/usbh.h index d0a5732e5..217cb1a9c 100644 --- a/src/host/usbh.h +++ b/src/host/usbh.h @@ -149,12 +149,9 @@ extern void hcd_int_handler(uint8_t rhport, bool in_isr); #endif // Interrupt handler alias to HCD with in_isr as optional parameter -// - tuh_int_handler(rhport) --> hcd_int_handler(rhport, true) -// - tuh_int_handler(rhport, in_isr) --> hcd_int_handler(rhport, in_isr) -// Note: this is similar to TU_VERIFY(), _GET_3RD_ARG() is defined in tusb_verify.h #define _tuh_int_handler_1arg(_rhport) hcd_int_handler(_rhport, true) #define _tuh_int_hanlder_2arg(_rhport, _in_isr) hcd_int_handler(_rhport, _in_isr) -#define tuh_int_handler(...) _GET_3RD_ARG(__VA_ARGS__, _tuh_int_hanlder_2arg, _tuh_int_handler_1arg, _dummy)(__VA_ARGS__) +#define tuh_int_handler(...) TU_GET_3RD_ARG(__VA_ARGS__, _tuh_int_hanlder_2arg, _tuh_int_handler_1arg, _dummy)(__VA_ARGS__) // Check if roothub port is initialized and active as a host bool tuh_rhport_is_active(uint8_t rhport); diff --git a/src/tusb.c b/src/tusb.c index 11690b203..9f0e45fef 100644 --- a/src/tusb.c +++ b/src/tusb.c @@ -39,21 +39,50 @@ #include "host/usbh_pvt.h" #endif +#define TUP_USBIP_CONTROLLER_NUM 2 + +static tusb_role_t _rhport_role[TUP_USBIP_CONTROLLER_NUM] = { 0 }; + //--------------------------------------------------------------------+ // Public API //--------------------------------------------------------------------+ -bool tusb_init(void) { - #if CFG_TUD_ENABLED && defined(TUD_OPT_RHPORT) - // init device stack CFG_TUSB_RHPORTx_MODE must be defined - TU_ASSERT ( tud_init(TUD_OPT_RHPORT) ); +bool _tusb_rhport_init(uint8_t rhport, tusb_role_t role) { + // backward compatible called with tusb_init(void) + #if defined(TUD_OPT_RHPORT) || defined(TUH_OPT_RHPORT) + if (rhport == 0xff || role == TUSB_ROLE_INVALID) { + #if CFG_TUD_ENABLED && defined(TUD_OPT_RHPORT) + // init device stack CFG_TUSB_RHPORTx_MODE must be defined + TU_ASSERT ( tud_init(TUD_OPT_RHPORT) ); + _rhport_role[TUD_OPT_RHPORT] = TUSB_ROLE_DEVICE; + #endif + + #if CFG_TUH_ENABLED && defined(TUH_OPT_RHPORT) + // init host stack CFG_TUSB_RHPORTx_MODE must be defined + TU_ASSERT( tuh_init(TUH_OPT_RHPORT) ); + _rhport_role[TUH_OPT_RHPORT] = TUSB_ROLE_HOST; + #endif + + return true; + } + #endif + + // new API with explicit rhport and role + TU_ASSERT(rhport < TUP_USBIP_CONTROLLER_NUM && role != TUSB_ROLE_INVALID); + + #if CFG_TUD_ENABLED + if (role == TUSB_ROLE_DEVICE) { + TU_ASSERT( tud_init(rhport) ); + } #endif - #if CFG_TUH_ENABLED && defined(TUH_OPT_RHPORT) - // init host stack CFG_TUSB_RHPORTx_MODE must be defined - TU_ASSERT( tuh_init(TUH_OPT_RHPORT) ); + #if CFG_TUH_ENABLED + if (role == TUSB_ROLE_HOST) { + TU_ASSERT( tuh_init(rhport) ); + } #endif + _rhport_role[rhport] = role; return true; } @@ -71,6 +100,23 @@ bool tusb_inited(void) { return ret; } +void tusb_int_handler(uint8_t rhport, bool in_isr) { + TU_VERIFY(rhport < TUP_USBIP_CONTROLLER_NUM,); + + #if CFG_TUD_ENABLED + if (_rhport_role[rhport] == TUSB_ROLE_DEVICE) { + (void) in_isr; + tud_int_handler(rhport); + } + #endif + + #if CFG_TUH_ENABLED + if (_rhport_role[rhport] == TUSB_ROLE_HOST) { + tuh_int_handler(rhport, in_isr); + } + #endif +} + //--------------------------------------------------------------------+ // Descriptor helper //--------------------------------------------------------------------+ diff --git a/src/tusb.h b/src/tusb.h index 4f69a1414..911d1bae0 100644 --- a/src/tusb.h +++ b/src/tusb.h @@ -129,18 +129,38 @@ //--------------------------------------------------------------------+ // APPLICATION API //--------------------------------------------------------------------+ +#if CFG_TUH_ENABLED || CFG_TUD_ENABLED -// Initialize device/host stack +// Internal helper for backward compatible with tusb_init(void) +bool _tusb_rhport_init(uint8_t rhport, tusb_role_t role); + +// Initialize roothub port with device/host role // Note: when using with RTOS, this should be called after scheduler/kernel is started. -// Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API. -bool tusb_init(void); +// Otherwise, it could cause kernel issue since USB IRQ handler does use RTOS queue API. +// Note2: defined as macro for backward compatible with tusb_init(void), can be changed to function in the future. +#define _tusb_init_0arg() _tusb_rhport_init(0xff, TUSB_ROLE_INVALID) +#define _tusb_init_1arg(_rhport) _tusb_rhport_init(_rhport, TUSB_ROLE_INVALID) +#define _tusb_init_2arg(_rhport, _role) _tusb_rhport_init(_rhport, _role) +#define tusb_init(...) TU_GET_3RD_ARG(__VA_ARGS__, _tusb_init_2arg, _tusb_init_1arg, _tusb_init_0arg)(__VA_ARGS__) // Check if stack is initialized bool tusb_inited(void); +// Called to handle usb interrupt/event. tusb_init(rhport, role) must be called before +void tusb_int_handler(uint8_t rhport, bool in_isr); + // TODO // bool tusb_teardown(void); +#else + +#define tusb_init(...) (false) +#define tusb_int_handler(...) do {}while(0) +#define tusb_inited() (false) + +#endif + + #ifdef __cplusplus } #endif diff --git a/test/unit-test/test/device/msc/test_msc_device.c b/test/unit-test/test/device/msc/test_msc_device.c index a62418524..28216af10 100644 --- a/test/unit-test/test/device/msc/test_msc_device.c +++ b/test/unit-test/test/device/msc/test_msc_device.c @@ -200,7 +200,7 @@ void setUp(void) if ( !tud_inited() ) { dcd_init_Expect(rhport); - tusb_init(); + tusb_init(0, TUSB_ROLE_DEVICE); } dcd_event_bus_reset(rhport, TUSB_SPEED_HIGH, false); diff --git a/test/unit-test/test/device/usbd/test_usbd.c b/test/unit-test/test/device/usbd/test_usbd.c index 00950c5a9..43722d175 100644 --- a/test/unit-test/test/device/usbd/test_usbd.c +++ b/test/unit-test/test/device/usbd/test_usbd.c @@ -128,7 +128,7 @@ void setUp(void) { mscd_init_Expect(); dcd_init_Expect(rhport); - tusb_init(); + tusb_init(0, TUSB_ROLE_DEVICE); } } -- cgit v1.3.1