Compare commits

..

1236 commits

Author SHA1 Message Date
PanRe
a2390802f8
Merge pull request #2282 from HiFiPhile/uac_interl
UAC IN transfer improvements
2023-10-19 19:49:19 +02:00
Mengsk
d3fa3cdf48 Adjsut blackout time. 2023-10-18 17:05:35 +02:00
Ha Thach
dd588222c7
Merge pull request #2265 from bencowperthwaite/master
STM32U5 HS Support
2023-10-18 15:25:57 +07:00
HiFiPhile
ade8a19aef Put sw_buf in USB section only if necessary. 2023-10-17 21:21:52 +02:00
HiFiPhile
e9d894fe66 Fix compile. 2023-10-17 21:03:29 +02:00
Ha Thach
0ede159ad0
Merge pull request #2244 from gabChouin/feat-stm32u575_nucleo
Add stm32u575-nucleo support
2023-10-18 00:06:28 +07:00
hathach
a5a77af11e
add board.mk for u575 nucleo 2023-10-17 23:53:09 +07:00
hathach
22aefd6aba
add cmake support for u575 nucleo 2023-10-17 22:48:54 +07:00
Ha Thach
80ee307244
Merge branch 'master' into feat-stm32u575_nucleo 2023-10-17 22:31:33 +07:00
HiFiPhile
d83a210788 Add blackout time. 2023-10-17 15:18:05 +02:00
HiFiPhile
0a1d6cf4d0 Read sample rate directly from control transfer to eliminate callback. 2023-10-17 13:06:55 +02:00
HiFiPhile
656e1e416a Add flow control for IN transfer. 2023-10-17 09:46:01 +02:00
PanRe
118823c254
Merge pull request #2259 from HiFiPhile/uac_interl
Fix UAC encoding, update example.
2023-10-11 19:18:35 +02:00
HiFiPhile
c8430f5f85 Refactor to get rid of CMSIS DSP lib. 2023-10-10 20:00:50 +02:00
HiFiPhile
e2852da668 Update deps. 2023-10-10 18:35:24 +02:00
HiFiPhile
504d29cf7a Update make & cmake file. 2023-10-10 18:25:42 +02:00
HiFiPhile
20699e30dd Enhance plot script. 2023-10-10 18:25:14 +02:00
HiFiPhile
2ba760a1c1 Enhance audio_4_channel_mic example, plot 4 different waves for each channel. 2023-10-10 18:24:47 +02:00
HiFiPhile
8b2cb63da8 Fix naming nBytesPerSample. 2023-10-10 18:22:20 +02:00
HiFiPhile
b5c839f739 Merge branch 'master' of https://github.com/hathach/tinyusb into uac_interl 2023-10-10 15:02:25 +02:00
Ha Thach
513ab37ec6
Merge pull request #2276 from hathach/more-esp32-max3421
More max3421
2023-10-05 17:53:13 +07:00
hathach
cfb683f481
tested with nrf52840 and esp32s2 2023-10-05 17:01:41 +07:00
hathach
67e34267a6 change tuh_max3421_spi_xfer_api() signature
tested working with sam d21 and d51, not tested with nrf52, seem not
working with esp32
2023-10-04 18:00:32 +07:00
hathach
f36e0b7b92
esp32 comment out uart, increase max3421 spi speed to 26mhz 2023-10-03 16:27:35 +07:00
Ha Thach
b394ae1786
Merge pull request #2270 from hathach/add-max3421-esp32
Add max3421 support for esp32
2023-09-28 16:56:20 +07:00
hathach
8348631bf5
improve esp32 ci, build esp32 with -DDMAX3421_HOST=1 for max3421 testing
revert change in hcd.h
2023-09-28 16:15:31 +07:00
hathach
6b8933cfe8
fix build with new freertos host example 2023-09-28 12:55:59 +07:00
hathach
7dc1a66f91
esp32 cdc host with max3421 work well 2023-09-28 11:12:22 +07:00
hathach
277852afc1
fix esp32 msc example 2023-09-28 10:56:38 +07:00
hathach
10abece264
esp32 hid device work well 2023-09-28 10:06:10 +07:00
hathach
3a10b6a3d5
fix esp32 build 2023-09-27 18:09:19 +07:00
hathach
76c43a5bdc
Merge branch 'master' into add-max3421-esp32 2023-09-27 17:52:18 +07:00
Ha Thach
5b08a65ad2
Merge pull request #2268 from HiFiPhile/iar_tmpl
Update IAR template.
2023-09-27 17:41:18 +07:00
Ha Thach
e4058177af
Merge pull request #2269 from hathach/add-in_isr-to-hcd_int_hanlder
Add in isr to hcd int hanlder
2023-09-27 17:40:50 +07:00
Ha Thach
68c4009bba
Merge branch 'master' into add-in_isr-to-hcd_int_hanlder 2023-09-27 17:01:40 +07:00
Mengsk
42eb4e0da0 Fix CI. 2023-09-27 11:46:52 +02:00
Mengsk
b35621fc63 Update IAR template. 2023-09-27 11:43:23 +02:00
hathach
58c49cea5b
remove sct_neopixel from lpc54 (due to warnings and not used) 2023-09-27 16:31:46 +07:00
hathach
0a4fb6963d
fix build with lpc54 2023-09-27 16:19:39 +07:00
hathach
3b0ffd0f48
change hcd_int_handler(rhport, in_isr) signature: add in_isr
change tuh_int_handler() to take in_isr as optional parameter (default =
true)
2023-09-27 15:51:03 +07:00
hathach
6dc64eaa28
max3421 communication work with esp32 up to enumeration, seems still have a bit of issue 2023-09-27 12:34:45 +07:00
hathach
2f6592de7f
update max3421 to have hcd_int_handler_ext() 2023-09-27 11:30:18 +07:00
bac
1168e4e163 Added support for USB2 HS peripheral (with integrated HS PHY) on STM32U59x chips 2023-09-26 15:27:17 +01:00
hathach
f6ca86c3dd
tested cdc_msc_hid_freertos with samd51
add -Wno-error=format for espressif
wrap up cdc_msc_hid_freertos
2023-09-26 19:09:36 +07:00
hathach
a7c136c03f
adding host/cdc_msc_hid_freertos example 2023-09-25 16:53:11 +07:00
HiFiPhile
6be7f354c2 Fix cast-align. 2023-09-19 16:35:05 +02:00
Ha Thach
56c6d2feab
Merge pull request #2258 from hathach/cmake-u5
Cmake u5
2023-09-19 21:26:20 +07:00
HiFiPhile
9d0251f7a6 Fix UAC interleaved copy. 2023-09-19 15:42:52 +02:00
hathach
b73262be3a minor indent 2023-09-19 18:38:47 +07:00
hathach
8cdcd0fa9d fix build and add u5 to ci 2023-09-19 18:35:15 +07:00
hathach
71a2e8a36d addding cmake support for u5 2023-09-19 17:59:38 +07:00
hathach
81cd995108
add default CFG_TUH_MAX3421 = 0, default spi speed for samd21/samd51 to 12Mhz 2023-09-18 22:15:31 +07:00
Ha Thach
46f7cf4da2
Merge pull request #2235 from slark-yuxj/master
fix:Resource leak: fp
2023-09-12 17:43:14 +07:00
Ha Thach
e9ba93315c
Merge pull request #2245 from arduino/fix_msd_extraneus_bytes_on_reading
Fix msd extraneus bytes on reading
2023-09-12 12:53:52 +07:00
Ha Thach
6d922de0cb
Merge pull request #2251 from hathach/add-max3421e-hcd
Add max3421e host driver
2023-09-11 22:22:13 +07:00
hathach
f55052b61f enable max3421 host for feather nrf52840 with makefile 2023-09-11 16:44:06 +07:00
hathach
1eb0cb0c65
update readme to include max3421 support 2023-09-11 15:45:26 +07:00
hathach
ab9585401b
wrap up build cmake & make support for max3421, to enable the Host driver, 'MAX3421_HOST=1' must be added as part of make/cmake command 2023-09-11 11:35:51 +07:00
hathach
e32c1e08bd
both samd21/d51 works perfectly with max3421e 2023-09-09 16:50:16 +07:00
hathach
605ad73ec0
refactor max3421_init() for samd51 to be generic for sercom and eic 2023-09-09 13:04:36 +07:00
hathach
c074488f75
minor rename 2023-09-09 12:20:16 +07:00
maidnl
228acbeac2 wait_pipe_fifo_empty() now returns bool (as expected using TU_ASSERT macro) 2023-09-08 15:48:05 +02:00
hathach
1d68f2a328
metro m4 working with max3421e 2023-09-08 18:39:09 +07:00
hathach
bcc77a60e0
get spi working for metro m4 express 2023-09-08 17:40:00 +07:00
maidnl
7ce4cfa638 renesas: added wait function for IN transaction
This fixes a problem found on MSD class where data read from from disks were sometimes partially overwritten by the status MSD message ("USBS...").
The function introduced wait for the hw fifo pipe to be empty, that prevent that new writing in the fife overwrite data which are not yet be transmitted by hw.
2023-09-08 10:49:05 +02:00
hathach
ed102a7795
Merge branch 'master' into add-max3421e-hcd 2023-09-07 21:42:46 +07:00
Ha Thach
702740a3e2
Merge pull request #2246 from hathach/add-cmake-samd
Add cmake support for samd21 and samd51
2023-09-07 17:55:50 +07:00
hathach
d3c08ecc3a more ci fix 2023-09-07 17:20:07 +07:00
hathach
e8558458c4 fix ci 2023-09-07 17:09:25 +07:00
hathach
2dea4ce6a2 add cmake support for samd21.
update ci cmake
2023-09-07 16:58:40 +07:00
hathach
bb5d43e9c5
add samd51 to cmake 2023-09-07 15:31:43 +07:00
hathach
21ab40bab2
- wrap up hcd max3421, work well with nrf52840
- also add usbh_defer_func()
2023-09-07 12:38:18 +07:00
hathach
1b9108ea0d
minor debug clean up 2023-09-06 17:11:35 +07:00
Gabriel Chouinard
c4566c4d2b Enable instruction cache for stm32u5 boards 2023-09-05 21:39:28 -04:00
Gabriel Chouinard
4fb15f6bb7 Add stm32u575-nucleo support 2023-09-05 19:30:38 -04:00
hathach
ed0a233d48
vastly improve attach/detach device, still have issue where thing is still hanged occasionally. 2023-08-31 21:28:27 +07:00
hathach
3b7d5aa042
improve connection & disconnection detection. But there is still issue when CONDETIRQ occurs but we are disabled interrupt (for osal queue access). 2023-08-31 16:52:09 +07:00
hathach
41493426b3
use ep buf to keep setup packet, work well with hid device 2023-08-30 16:21:43 +07:00
hathach
1ab488eb06
call xfer_complete_isr() when result is not successful (stalled or failed) 2023-08-30 16:04:18 +07:00
hathach
2a814a99af
- hcd_setup_send() also check for busy flag
- xact_inout() to support send setup
2023-08-29 20:27:37 +07:00
hathach
3740a3287a
- correct tuh_max3421e_int_api() for nrf52
- hcd_int_disable/enable is software only to reduce interrupt lag
2023-08-29 18:22:21 +07:00
yuxiaojun
c350616038 fix:Resource leak: fp
Signed-off-by: yuxiaojun <yuxiaojun1011@outlook.com>
2023-08-28 15:24:14 +08:00
hathach
b31924e13e - add xfer_complete_isr()
- merge addr0 ep to pool
- add control status to xact in/out
- use atomic flag busy to ensure only 1 transfer is active at any time
- execute pending transfer after one is complete (or clear busy flag)
- change rtt mode to block if full
2023-08-28 12:41:44 +07:00
hathach
84df3b04db
minor update 2023-08-27 23:54:24 +07:00
hathach
502b1bdda6
more update to transaction 2023-08-27 23:45:34 +07:00
hathach
cd7464a884
try next endpoint when received NAK 2023-08-25 17:37:09 +07:00
hathach
ac00b91472
add xact_out(), xact_in() to manage transfer 2023-08-25 17:26:57 +07:00
hathach
ecf2f91042
use endpoint pool for more flexible multiple devices support 2023-08-25 16:36:28 +07:00
hathach
09ceaa6cf3
add osal mutex for spi 2023-08-25 13:18:47 +07:00
hathach
f5ebc1700f
add spi lock with interrupt enable/disable 2023-08-25 12:12:44 +07:00
hathach
e6cf125e53
save data toggle, always retry NAK. work with msc device 2023-08-24 16:46:20 +07:00
hathach
344932d27e
add tuh_max3421e_int_api(), retry control if received NAK 2023-08-24 16:27:47 +07:00
hathach
3ed5d6c372
complete enumeration 2023-08-24 16:27:12 +07:00
Ha Thach
7bf5923052
Merge pull request #2142 from sjanc/symlinks
Fix documentation symlinks
2023-08-24 00:01:55 +07:00
hathach
2c237b1ae4
able to complete 1st get device descriptor and set address 2023-08-23 17:49:28 +07:00
hathach
e3f3179924
able to get 8 byte descriptor, but read(RCVBC) always return 0
- rename max3421e to max3421
- fix incorrect bitmask for HCTL, fix initial device connect
- fix bus reset cause connect IRQ
2023-08-23 15:08:12 +07:00
hathach
274578ff46
able to send setup packet 2023-08-22 23:17:12 +07:00
hathach
b413439416
able to detect new device and start enumerating 2023-08-22 19:57:59 +07:00
hathach
cacc96b25d
adding connection event handling, add nrf gpio interrupt for max2341e interrupt pin 2023-08-18 17:39:10 +07:00
hathach
824e585e2b
ground works for hcd max3421e 2023-08-18 14:07:38 +07:00
hathach
9257a0f562
- update nrf52 bsp for cmake
- add empty tuh_int_handler/tud_int_handler if corresponidng stack not enabled
- add hcd_template.c
2023-08-18 12:48:12 +07:00
Ha Thach
1fdf29075d
Merge pull request #2221 from hathach/ehci-halted-error
EHCI more fixes
2023-08-16 16:01:16 +07:00
hathach
f4845e4e6c
minor comment 2023-08-16 14:43:58 +07:00
hathach
0109ffbdcb fix abort transfer does not release endpoint, also reset state if it is control transfer 2023-08-16 14:31:14 +07:00
hathach
b3c7fe1023
clear qhd halted bit if not caused by STALL protocol, allow for next transfer 2023-08-16 11:12:00 +07:00
Ha Thach
7537985c08
Merge pull request #2222 from rppicomidi/fix-2188
fix issue 2188: support usbh_app_driver_get_cb()
2023-08-15 23:33:19 +07:00
hathach
67a374d932
more rename 2023-08-15 22:57:05 +07:00
hathach
1b33a31536
more minor clean up
- also rename usbh_classdriver.h to usbh_pvt.h to consitent with usbd
2023-08-15 22:54:07 +07:00
rppicomidi
9d94296741 fix issue 2188: support usbh_app_driver_get_cb() 2023-08-14 15:38:48 -07:00
Ha Thach
d713571cd4
Merge pull request #2217 from hathach/add-lpc43s67
Add lpc43s67
2023-08-14 22:28:53 +07:00
Ha Thach
ba40d667e1
Merge pull request #2219 from tswan-quasi/master
min on cdc r/w
2023-08-14 22:25:44 +07:00
hathach
f2f005cbdf
fix build iar with lpc43 2023-08-14 22:01:30 +07:00
hathach
088180e3d8
add iar support for lpc43, add lpcxpresso43s67 to hil farm 2023-08-14 20:58:00 +07:00
tswan-quasi
b5ba12119d UINT16_MAX stdint macro usage 2023-08-14 09:01:30 -04:00
tswan-quasi
bd51afb091 min on cdc r/w 2023-08-14 08:49:52 -04:00
hathach
78e5b2c6a4
add board_get_unique_id() for lpc43 2023-08-14 16:52:16 +07:00
hathach
202b945f88
add lpcxpresso43s67 2023-08-14 16:38:51 +07:00
Ha Thach
92457ec99f
Merge pull request #2202 from Rocky04/patch-4
Invoke unmounted state on configuration reset
2023-08-09 20:48:26 +07:00
Ha Thach
04f0cd5c80
Merge pull request #2209 from HiFiPhile/hitl
Enhance HITL test
2023-08-09 20:20:46 +07:00
hathach
8e690df1da
rename hitl to hil 2023-08-09 19:03:56 +07:00
hathach
1268d1a093
update hil test and json (remove troublesome lpc54608), run hil test on ci with IAR build 2023-08-09 18:46:23 +07:00
hathach
1abfa9ac75
Merge branch 'hitl' into pr_hitl 2023-08-09 12:48:46 +07:00
hathach
b8b01c1075
update to dcd ip3511 to add work-around for lpc54628 usb hs errata USB.1 and USB.2
msc is mounted, but device couldn't work reliably and got constant reset
due to other errata probably.
2023-08-09 12:47:24 +07:00
HiFiPhile
992e17fb48 Add simple test for hid_boot_interface. 2023-08-08 22:08:59 +02:00
HiFiPhile
bffe321cd2 Update contributor.rst 2023-08-08 18:25:15 +02:00
HiFiPhile
56bed1e581 Flash board_test when done, skip cdc_msc for LPC54. 2023-08-08 17:34:45 +02:00
HiFiPhile
3444c4abe5 Add dummy board_test. 2023-08-08 17:34:07 +02:00
hathach
6d877c3170
added cmake for lpc54, update lpc55 2023-08-08 18:50:24 +07:00
Rocky04
9602c06f8d
Correcting comments 2023-08-07 21:25:50 +02:00
Rocky04
c959e65edd
Fixing wrong callback placement 2023-08-07 21:16:41 +02:00
Rocky04
12ed867b5e
Fixed typo 2023-08-07 20:59:08 +02:00
HiFiPhile
c24f10e4f6 Mount block device in test_cdc_msc. 2023-08-07 20:48:54 +02:00
Ha Thach
51a0889b75
Merge pull request #2211 from hathach/host-usb-reset
Host usb reset
2023-08-07 23:10:47 +07:00
hathach
4938971aad
code format 2023-08-07 20:48:09 +07:00
hathach
18646179d0
fix host msc get maxlun not using aligned section memory 2023-08-07 20:48:08 +07:00
hathach
1f95a417f2
Add tuh_rhport_is_active() and tuh_rhport_reset_bus()
- also improve ehci bus reset
- seperate bus reset delay and contact debouncing delay in enumeration
2023-08-07 20:48:07 +07:00
Rocky04
45af3d6a83 Update examples 2023-08-07 12:04:22 +00:00
Ha Thach
1b92108bc3
Merge pull request #2208 from kkitayam/fix_makefile_for_win
Fix makefile a warning when run on windows command prompt
2023-08-07 16:13:44 +07:00
Ha Thach
accc3fd737
Merge pull request #2151 from kilograham/rp2040_build_fixes
Fix build issues when building for RP2040 from pico-examples/pico-sdk.
2023-08-07 11:14:04 +07:00
HiFiPhile
87150b7770 Add config file as argument. 2023-08-06 22:02:15 +02:00
HiFiPhile
c940a2f362 Fix RTT build. 2023-08-06 21:55:24 +02:00
HiFiPhile
4d1f3f4e9d Add more MCU. 2023-08-06 16:59:25 +02:00
HiFiPhile
b9e614bd39 Fix LPC54 build. 2023-08-06 15:59:25 +02:00
kkitayam
b173c71ffc Change to subst to work on windows command prompt 2023-08-06 22:49:45 +09:00
HiFiPhile
9dd896904c WIP. 2023-08-06 13:41:41 +02:00
HiFiPhile
4f96eebe1b Fix LPC54 build. 2023-08-06 13:41:10 +02:00
Ha Thach
3db945283a
Merge pull request #2185 from abakosh/clean_RA_HCD
Fix typos in HCD rusb file
2023-08-04 21:59:19 +07:00
Ha Thach
c43e7b198d
Merge pull request #2206 from hathach/hw-test-jlink-sn
add usb serial for hw l412 test
2023-08-04 21:56:46 +07:00
hathach
3c746e8bb0
add usb serial for hw l412 test 2023-08-04 21:33:44 +07:00
Aladdin Bakosh
56e52037a8 clean(ra_hcd): fix typos in the hcd library 2023-08-04 12:00:25 +02:00
Ha Thach
363cea7c34
Merge pull request #2121 from ahooper/blackf407VE
Board support for STM32F407VETx
2023-08-04 13:12:38 +07:00
hathach
25bace5e81
add cmake for all board in stm32f4. fix build, also move ci for f4 from makefile to cmake 2023-08-04 12:49:26 +07:00
hathach
81aca17d6e
Merge branch 'master' into blackf407VE 2023-08-04 12:07:39 +07:00
Ha Thach
61f00c0c4d
Merge pull request #2135 from JustAnother1/master
made line ends consistent.
2023-08-04 12:05:07 +07:00
Ha Thach
1b04db2a77
Merge branch 'master' into master 2023-08-04 11:48:04 +07:00
Ha Thach
de4ad2c775
Merge pull request #2204 from hathach/enhance-bsp
Enhance bsp
2023-08-04 11:41:44 +07:00
Ha Thach
bbdc879995
Merge pull request #2133 from greatscottgadgets/cynthion_support
Update support for Cynthion boards
2023-08-04 11:03:25 +07:00
Ha Thach
9a4c76d18d
Merge pull request #2116 from dsugisawa-mixi/master
fix example of bare_api, check empty string
2023-08-04 11:00:09 +07:00
hathach
9697c4df4e
update all examples to use unique ID as serial if avaialble 2023-08-04 10:28:24 +07:00
hathach
67ff3f7845
more clean up 2023-08-04 00:37:01 +07:00
hathach
ef5bd9ee6c
Merge branch 'master' into enhance-bsp 2023-08-04 00:31:12 +07:00
hathach
9360a3bd51
add uid for some stm32 2023-08-04 00:23:10 +07:00
hathach
041f510f90
add board_get_unique_id() for serial number
implemented board_get_unique_id() for rp2040 and L4
2023-08-03 20:42:34 +07:00
Ha Thach
6d03bb9ffc
Merge pull request #2052 from arduino/renesas_ra_hs_rebased
Renesas_RA: add support for board with HS USB port
2023-08-03 20:41:13 +07:00
hathach
1324c2862d
more board_api rename 2023-08-03 17:32:15 +07:00
hathach
a160da1f2b
add lpc43 family 2023-08-03 17:19:47 +07:00
hathach
a5768f52b4
more board_api.h rename 2023-08-03 15:50:52 +07:00
hathach
cf91660cee
rename hw/bsp/board.h to board_api.h 2023-08-03 15:44:05 +07:00
hathach
4493b838d9
rename ch32v307 and tm4c123 to use underscore 2023-08-03 15:35:01 +07:00
hathach
4cb8b513af
ide settings 2023-08-03 15:17:57 +07:00
Ha Thach
d91869a1fa
Merge pull request #2105 from kholia/cdc_uac2_example
Add CDC+UAC2 composite device example for Pico
2023-08-03 15:13:56 +07:00
hathach
d89fc0772b
add makefile, add cdc_uac2 to cmake example list, update descriptor to build with nrf and samg/7x 2023-08-03 14:55:24 +07:00
Ha Thach
e5b171868a
Merge pull request #2091 from DRNadler/master
For FreeRTOS kernel-aware debugging, when queue registry is enabled, …
2023-08-03 14:30:28 +07:00
hathach
6844055dd1
Merge branch 'master' into cdc_uac2_example 2023-08-03 12:15:07 +07:00
hathach
37a7f9f382
configQUEUE_REGISTRY_SIZE=4 for lpc18 2023-08-03 12:07:28 +07:00
hathach
473f37df95
add osal queue name if needed
also mass change configQUEUE_REGISTRY_SIZE = 4
2023-08-03 12:05:21 +07:00
hathach
de8faf8664
Merge branch 'master' into pr2091 2023-08-03 11:09:33 +07:00
hathach
d09604d636
Revert "Name queues for easier FreeRTOS debugging with task- and queue-aware debuggers"
This reverts commit 11fba59319.
2023-08-03 11:07:23 +07:00
Rocky04
9560d0813f
Set unmounted on configuration reset 2023-08-02 15:25:08 +02:00
hathach
2021c62997
fix pre-commit, also skip lto for rp2040 2023-08-02 17:57:28 +07:00
Ha Thach
5cf94234d2
Merge pull request #2200 from hathach/selective-log
default class driver log level to CFG_TUH/TUD_LOG_LEVEL
2023-08-02 16:26:57 +07:00
hathach
868d52f3a8
move codespell folder to tools 2023-08-02 15:52:06 +07:00
hathach
979bf32266
default class driver log level to CFG_TUH/TUD_LOG_LEVEL allow application to selectively disable usbd/usbh or driver log 2023-08-02 15:34:18 +07:00
Ha Thach
2cf869c1a4
Merge pull request #2197 from HiFiPhile/fix_g0
Fix STM32G0 build.
2023-08-02 10:09:49 +07:00
HiFiPhile
07822979aa Fix STM32G0 build. 2023-08-01 18:41:15 +02:00
Martino Facchin
edee46e794 renesas: host: remove attach_attempt logic 2023-08-01 15:21:31 +02:00
Ha Thach
5e1ed9d580
Merge pull request #2187 from 0xCCF4/master
Fixed typo in binary declaration RP2040 hw bspw family.c
2023-08-01 17:55:40 +07:00
hathach
47ae883ba0
fix build with -flto 2023-08-01 17:26:56 +07:00
hathach
f04e5108b2
Merge branch 'arduino-renesas_ra_hs_rebased' into renesas_ra_hs_rebased 2023-08-01 17:08:03 +07:00
hathach
04f1a34c39
add rusb2_common.c for dynami irq 2023-08-01 17:03:07 +07:00
Martino Facchin
965627e81c rusb2: move dynamic irq function to c file 2023-08-01 11:41:33 +02:00
hathach
40833b585b
enable flto for ra makefile
- remove ra from ci make build since it is already in cmake ci
2023-08-01 15:44:54 +07:00
hathach
789e478d4d
add portenta c33 bsp, add flash by dfu-util 2023-08-01 13:16:37 +07:00
hathach
1cccbaf7ec
fix board name with dash 2023-08-01 11:18:00 +07:00
hathach
3f788a4e5a
enable USBMC for uno r4, add board_init_after_tusb() API
add BOARD_UPPERCASE for board detection
2023-07-31 19:09:40 +07:00
hathach
cb47231518
revert out of scope changes 2023-07-31 17:13:37 +07:00
Ha Thach
ce54984556
Merge pull request #2093 from abakosh/no_osal_delay
osal_none: make it possible to override the task delay function
2023-07-31 17:12:28 +07:00
hathach
0d9973ef87
enable_irq since uno bootloader can disable it. systick triggered, however usb still not work with uno 2023-07-31 16:21:19 +07:00
hathach
feb58ebd54
add uno r4 wih FLASH_IMAGE_START=0x4000, running but interrupt (systick) does not seems to work 2023-07-28 19:01:12 +07:00
0xCCF4
8226b046a9
Fixed typo in rp2040 hw bspw family.c 2023-07-28 11:19:08 +02:00
hathach
e56d5443a8
- revert usb address
- more clean up
2023-07-28 12:42:40 +07:00
hathach
6021803d58
fix ci 2023-07-28 11:33:26 +07:00
hathach
ec093bebad
Merge branch 'master' into renesas_ra_hs_rebased 2023-07-27 16:50:34 +07:00
Ha Thach
db59494b1b
Merge pull request #2179 from hathach/enhance-ehci
Enhance EHCI
2023-07-27 16:15:43 +07:00
hathach
5a29db2787
add check for edpt_xfer() with halted, also reset data toggle when clear stall 2023-07-27 15:52:55 +07:00
Ha Thach
d9cc30291f
Merge pull request #2182 from hathach/correct-hcd_edpt_clear_stall-API
correct hcd_edpt_clear_stall() API signature
2023-07-26 21:42:08 +07:00
hathach
10575c1b38
mising ehci 2023-07-26 20:48:18 +07:00
hathach
c37a957174
correct hcd_edpt_clear_stall() API signature 2023-07-26 19:56:48 +07:00
hathach
6b6dcc6c09
refactored multiple ports for hcd rusb2 2023-07-26 19:52:33 +07:00
hathach
1cb3f0e92a
increase stack size for 6 series to 0x1000, 4 series to 0x800 2023-07-26 18:56:13 +07:00
hathach
fbaa148fe0
updating hcd rusb2
- make osal_task_delay() as weak function in usbh
- implement osal_task_delay() in hcd rusb2 (may moved to other places)
2023-07-26 18:55:41 +07:00
hathach
4deea87579
improve processing usb complete and error isr.
also merge them together
2023-07-25 15:07:21 +07:00
hathach
dc74e634f9
fix unaligned hub status_change 2023-07-25 12:35:40 +07:00
hathach
ef69da054e
use standard EHCI USB INT instead of chipidea async/period interrupt to be compatible with other EHCI implementation 2023-07-25 12:03:54 +07:00
Ha Thach
9554283b03
Merge pull request #2175 from hathach/hcd-abort-xfer
Add HCD abort xfer API
2023-07-24 22:08:53 +07:00
Ha Thach
fda92fd34a
Merge branch 'master' into hcd-abort-xfer 2023-07-24 21:38:46 +07:00
Ha Thach
0b38941362
Merge pull request #2173 from hathach/imxrt-dcache-align
change dcache clean/invalidate return type to bool
2023-07-24 21:36:15 +07:00
hathach
f295aaf185
add hcd abort xfer for rp2040 pio usb 2023-07-24 20:58:50 +07:00
hathach
fd29fd923a
clean up 2023-07-24 20:53:44 +07:00
Ha Thach
d685ac689b
Merge pull request #2172 from hathach/cmake-4088
update bsp for 4088
2023-07-24 20:49:20 +07:00
hathach
25225ba792
minor clean up 2023-07-24 18:04:42 +07:00
hathach
d254256047
change dcache clean/invalidate return type to bool
add tu_assert() check for aligned 32byte address for imxrt
2023-07-24 17:54:24 +07:00
hathach
14a7379799
fix ohci warnings, and add freertosconfig for lpc4088 2023-07-24 16:54:02 +07:00
hathach
210fc7d038
add etm trace pinmux for 4088 quickstart 2023-07-24 16:19:45 +07:00
hathach
ef49b93532
rename CFG_TUSB_MEM_SECTION to CFG_TUD_MEM_SECTION in device stack
CFG_TUD_MEM_SECTION is default to CFG_TUSB_MEM_SECTION
2023-07-24 15:46:21 +07:00
hathach
a268e0b7a3
add lpc40 to cmake 2023-07-24 15:18:41 +07:00
Ha Thach
8fa0b74d80
Merge pull request #2155 from jferreir/xmc4700_relax
Board support for XMC4700_RELAX
2023-07-21 19:08:51 +07:00
hathach
c122e9df73
implement hcd_edpt_abort_xfer() for EHCI, also move thing around a bit 2023-07-21 19:06:36 +07:00
hathach
14c98dd863
minor ehci rename, move code around 2023-07-21 16:39:30 +07:00
hathach
0da273ea79
add stub hcd_edpt_abort_xfer() for all ports 2023-07-21 12:52:26 +07:00
hathach
1cc7c5d030
add hcd_edpt_abort_xfer() API 2023-07-21 12:43:48 +07:00
jferreir
34ff7af7c7 Fix trailing spaces issue 2023-07-20 18:12:36 +02:00
jferreir
48101cc294
Merge branch 'hathach:master' into xmc4700_relax 2023-07-20 17:12:57 +02:00
jferreir
6ac7f19640 fix compilation issues for XMC4500_RELAX 2023-07-20 17:01:00 +02:00
hathach
954f0e948d prefer application callback over built-in driver 2023-07-20 17:01:00 +02:00
hathach
eae8678d67 improve logging, allow easier to turn off usbd, driver logging
can be useful when focusing on let's say usbh
2023-07-20 17:01:00 +02:00
Ha Thach
17576a6949
Merge pull request #2156 from hathach/usbh-xfer-user-callback
Usbh xfer user callback
2023-07-20 18:30:09 +07:00
hathach
16ad918d96
prefer application callback over built-in driver 2023-07-20 17:37:06 +07:00
hathach
77495cf119
improve logging, allow easier to turn off usbd, driver logging
can be useful when focusing on let's say usbh
2023-07-20 17:12:00 +07:00
jferreir
2772581c28 Add support for XMC4700_RELAX kit 2023-07-20 10:53:59 +02:00
jferreir
59778664c9 Add UART_DEV support 2023-07-20 10:53:29 +02:00
jferreir
b1e345b6bc Add UART_DEV support 2023-07-20 10:52:16 +02:00
Ha Thach
6c7c9f2ef5
Merge pull request #2152 from kilograham/is_pico_pio_usb_supported
add is_compiler_supported_by_pico_pio_usb() for rp2040
2023-07-18 23:54:33 +07:00
graham sanderson
08a1892801 add is_compiler_supported_by_pico_pio_usb()
previosuly users of TinyUSB (e.g. pico-examples) would have to decide this for themselves. This function couples
the check closer with the actual version of Pico-PIO-USB used (since TinyUSB picks)
2023-07-18 11:04:46 -05:00
Ha Thach
e3d4385280
Merge pull request #2150 from kkitayam/flash-jlink-for-windows
Fix flash-jlink target to work on Windows command prompt
2023-07-18 22:33:57 +07:00
graham sanderson
3678a25baa Fix build issues when building for RP2040 from pico-examples/pico-sdk.
* include_guard requires GLOBAL as family.cmake is included in multiple non child places
* the following recently added check is suprfluous (family_configure_host_example for rp2040 should do this already),
  and breaks if pico_pio_usb is not avaialble, so i have removed
   # Add pico-pio-usb for rp2040 since user can choose to run on bit-banging host
   if(FAMILY STREQUAL "rp2040")
      family_add_pico_pio_usb(${PROJECT})
   endif()
* added new familt_example_missing_dependency functino to print missing dependency warning, so
  pico-examples can override it to be less in your face, and also more contextual to pico-examples
2023-07-18 09:03:01 -05:00
kkitayam
efa8b4a9b8 Change a variable to a target so that it works on windows command prompt
echo command of windows command prompt can't handle line breaks in a variable.
2023-07-18 22:55:55 +09:00
Aladdin Bakosh
3fdd2a40b2 osal_none: make it possible to override the task delay function 2023-07-18 14:14:23 +02:00
Ha Thach
973c7d47eb
Merge pull request #2149 from hathach/fix-etm-trace-h7
fix etm trace clock with stm32h743eval board
2023-07-18 16:40:26 +07:00
Ha Thach
2bab947e38
Merge pull request #2146 from tannewt/host_cache_align
Fix host buffer alignment setting
2023-07-18 16:39:48 +07:00
hathach
2cd0b9ec35
fix etm trace clock with stm32h743eval board 2023-07-18 16:22:05 +07:00
hathach
b56c4fe945
Merge branch 'master' into renesas_ra_hs_rebased 2023-07-18 15:13:58 +07:00
Ha Thach
6798e7e059
Merge pull request #2120 from abakosh/RA_STALL
fix(RA_hcd): STALL status can be also 3 not only 2
2023-07-18 15:11:02 +07:00
Ha Thach
c5e23eaa14
Merge pull request #2148 from hathach/imxrt-bsp
Imxrt bsp
2023-07-18 14:47:21 +07:00
hathach
5723d38087
correct jlink dev for rt1010 2023-07-18 13:28:57 +07:00
Aladdin Bakosh
3230d5b1ea debugging can be configured on renesas dcd 2023-07-17 11:54:09 +02:00
Aladdin Bakosh
41b608562a debugging can be configured on renesas hcd 2023-07-17 11:54:09 +02:00
Aladdin Bakosh
1923b1845d fix(RA_hcd): STALL status can be also 3 not only 2 2023-07-17 11:54:09 +02:00
Scott Shawcroft
8b6d0a166b
Fix host buffer alignment setting 2023-07-14 15:30:22 -07:00
hathach
eb298e2b81
add clock_config.c for imxrt generated by mcuxpresso config 2023-07-14 12:45:54 +07:00
Szymon Janc
4b59cb9a20 Fix documentation symlinks
There were typos in symlinks target names resulting in following
warrning on checkout (at least in Mynewt newt tool):
* Warning: stat mynewt/repos/tinyusb/docs/contributing/code_of_conduct.rst: no such file or directory
* Warning: stat mynewt/repos/tinyusb/docs/info/contributors.rst: no such file or directory
2023-07-10 12:12:26 +02:00
hathach
0f53e746ff move check highspeed to rusb_ra 2023-07-07 18:41:16 +07:00
hathach
f7e7ba92ca
enable host example for ra 2023-07-07 16:27:12 +07:00
hathach
88478a9d05
add PORT selection for makefile 2023-07-07 16:24:22 +07:00
hathach
e0f1ba8b0e
fully work with multiple ports without CFG_TUSB_RHPORT0/1 2023-07-07 16:07:11 +07:00
hathach
4c156100fa
use unaligned access read for hw fifo 2023-07-07 12:27:18 +07:00
hathach
4bbacb1008
correct setting trace clock 2023-07-07 11:07:57 +07:00
hathach
c53acb1455
fix build with rx 2023-07-06 20:10:58 +07:00
hathach
1eefc2b3ef
more multiple ports update 2023-07-06 19:35:42 +07:00
hathach
95b77a0e73
add rusb2_module_start(), more update for multiple ports for dcd rusb2 2023-07-06 15:54:07 +07:00
hathach
f308435b64
update ra type to include usbhs registers 2023-07-06 09:34:33 +07:00
hathach
4f4c93594d
minor pipe clean up 2023-07-05 17:51:36 +07:00
hathach
f79529c09c
usb hs work with ra 6m5 ek 2023-07-05 17:13:01 +07:00
hathach
1d6ca3bc9b
fix ra4m3 ek build 2023-07-04 20:04:54 +07:00
hathach
071c30f381
update fsp to version 4.5, correct RA BSP. Fix ETM Trace with 6m5 by lowering PLL to 128Mhz. 2023-07-04 19:27:37 +07:00
Andrew Hooper
cfc146e18f Add FreeRTOSConfig for family stm32f4 2023-07-04 08:08:05 -04:00
Andrew Hooper
34966304dd Restore RTOS argument for stm32f4 2023-07-03 11:21:47 -04:00
hathach
bb0e688b8e
add jlinkscript for detect rtt 2023-07-03 16:35:22 +07:00
hathach
04b1a67898
Merge branch 'master' into renesas_ra_hs_rebased 2023-07-03 13:09:43 +07:00
Ha Thach
f1e006d09b
Merge pull request #2137 from hathach/cmake-ra
enhance RA family
2023-07-03 12:25:29 +07:00
hathach
d5d1b43eb9
board pin data clean up 2023-07-03 12:07:27 +07:00
hathach
4080ab3d03
wrap up ra update 2023-07-03 11:22:19 +07:00
hathach
960d9fa6f1
move files around 2023-07-03 11:03:50 +07:00
hathach
ad7764b5b2
move vector_data.h and ioport_cfg.h to common family 2023-07-03 10:54:37 +07:00
Ha Thach
942eb0f323
Merge pull request #2129 from dauc/patch-1
Fix minor spelling issues
2023-07-02 23:40:37 +07:00
hathach
787229a35e
add etm trace for 6m5 2023-07-02 23:39:43 +07:00
Lars Pötter
2029ca9536 also fixed pico_trac() log messages. 2023-07-02 10:53:08 +02:00
Lars Pötter
0693462eba made line ends consistent. 2023-07-02 09:02:24 +02:00
hathach
ec02ddf986
initial ra6m5 ek, board_test led + sw works 2023-07-01 21:43:52 +07:00
A. Hooper
9554a354d4
Merge branch 'hathach:master' into blackf407VE 2023-07-01 08:03:16 -04:00
Andrew Hooper
7d45a43f57 Correct loader file 2023-07-01 07:59:39 -04:00
hathach
14f1123bbd
remove left-over build_arm 2023-07-01 17:55:36 +07:00
hathach
e7431f54f2
fix undef with fsp 2023-07-01 17:46:21 +07:00
hathach
54dc699ddd
forgot board.mk for ra6m1 2023-07-01 17:43:06 +07:00
hathach
c5d958d104
add ra6m1 board 2023-07-01 17:27:45 +07:00
hathach
50381f7b4c
refactor to match fsp_cfg 2023-07-01 17:09:09 +07:00
hathach
22fb66436d
update linker 2023-07-01 16:40:47 +07:00
hathach
99e75e6a8a
rework ra build 2023-07-01 12:41:12 +07:00
mndza
14d69e46be
Update support for Cynthion boards
- Rename LUNA to Cynthion
- Add support for newer revisions (>=0.6)
- Bootloader (saturn-v) default size is now 2K
2023-06-30 11:30:33 +02:00
hathach
48738df489
move LTO checked to family_support.cmake 2023-06-30 16:05:59 +07:00
hathach
3cb4d73899
clean up ra makefile 2023-06-30 14:52:04 +07:00
Ha Thach
f5d0510064
Update build badge 2023-06-29 22:57:58 +07:00
Ha Thach
6e1eec908a
Merge pull request #2130 from hathach/hcd-frame-pio-usb
add hcd_frame_number() for pio-usb host
2023-06-29 22:46:24 +07:00
hathach
6284f2d722
add hcd_frame_number() for pio-usb host 2023-06-29 18:58:33 +07:00
Dave Nadler
11fba59319 Name queues for easier FreeRTOS debugging with task- and queue-aware debuggers 2023-06-28 17:25:22 -04:00
Dave Nadler
cca4be6c67
Merge branch 'hathach:master' into master 2023-06-28 17:05:19 -04:00
Devin Auclair
98fb10a724
Fix minor spelling 2023-06-28 14:03:18 -04:00
Ha Thach
fe77b6713b
Merge pull request #2085 from georgeboc/msc-ready-bug-fix
Fixes bug in tuh_msc_ready
2023-06-27 17:57:35 +07:00
Ha Thach
5cea4b2420
Merge pull request #2128 from hathach/cmake-freertos
rework cmake with rtos support add RTOS to family_configure_device/host/dual_example()
2023-06-27 16:18:17 +07:00
hathach
e43387abac
rework cmake with rtos support add RTOS to family_configure_device/host/dual_example() 2023-06-27 15:45:38 +07:00
Ha Thach
bc0d6c7e92
Merge pull request #2127 from hathach/rp2040-cmake-cleanup
Rp2040 cmake cleanup
2023-06-26 23:50:38 +07:00
hathach
a61d0f074f
more rp2040 family clean up 2023-06-26 23:08:59 +07:00
hathach
8aa28e63fb
minor clean up with include_guard() 2023-06-26 17:54:31 +07:00
hathach
3cfb838ba7
fix warnings when enable rtt with rp2040 2023-06-26 17:03:45 +07:00
Ha Thach
7454e45796
Merge pull request #2125 from hathach/cmake-detect-family
auto detect FAMILY based on BOARD
2023-06-26 14:08:17 +07:00
hathach
200e58d11e
auto detect FAMILY based on BOARD 2023-06-26 13:38:24 +07:00
Ha Thach
eb53680a06
Merge pull request #2124 from hathach/refactor-make-build
Refactor make build
2023-06-25 13:48:00 +07:00
hathach
06d93e95d1
update hw test l4 2023-06-25 10:15:05 +07:00
hathach
2ecd7c148d
fix ci with lpc55 and kl, move hw test l4 to cmake iar 2023-06-25 09:55:05 +07:00
hathach
15376397b1
run ci with -DCMAKE_BUILD_TYPE=MinSizeRel 2023-06-25 00:05:23 +07:00
hathach
30ccfe0832
more cmake less make 2023-06-24 23:36:52 +07:00
hathach
9b2b4ce647
move some family ci make to cmake 2023-06-24 23:32:24 +07:00
hathach
a64d5607a7
fix l4 freertos build 2023-06-24 23:17:28 +07:00
hathach
b9cefb1440
fix build with L4 2023-06-24 23:10:01 +07:00
hathach
c81d8b43a1
fix ci build 2023-06-24 22:58:15 +07:00
Dave Nadler
bd897d9c14
Merge branch 'hathach:master' into master 2023-06-24 11:53:24 -04:00
hathach
430f16bf76
move all IAR to cmake 2023-06-24 22:36:53 +07:00
hathach
2a96ef2519
add cmake for f0, f1 2023-06-24 21:47:55 +07:00
hathach
946d3fdd4f
fix iar with make 2023-06-24 21:17:40 +07:00
hathach
38a582634e
fix missing replace 2023-06-24 20:32:18 +07:00
hathach
eb4380fa14
more make update 2023-06-24 20:17:48 +07:00
hathach
2216704db8
rename GCC_CFLAGS to CFLAGS_GCC, GCC_SRC_S to SRC_S_GCC etc .. 2023-06-24 19:31:33 +07:00
hathach
7d0ce5605a
allow to skip CPU_CORE 2023-06-24 19:08:37 +07:00
hathach
086c1d4090
more CPU_CORE 2023-06-24 18:54:14 +07:00
hathach
eb7fcf1b74
add CPU_CORE for all family 2023-06-24 18:38:41 +07:00
hathach
b59b65d2ed
rename to kinetis_k32l2, rename OPT_MCU_KINETIS_K32 to OPT_MCU_KINETIS_K32L 2023-06-24 18:26:51 +07:00
hathach
dbf7534cd4
update all stm32 to use new enhance make 2023-06-24 18:09:05 +07:00
hathach
edbf06aaab
separate iar and gcc build for clean make, also add cpu specific make 2023-06-24 17:35:37 +07:00
Andrew Hooper
3a5f43528e Board support for STM32F407VETx 2023-06-23 11:51:58 -04:00
Ha Thach
50e61e0e16
Merge pull request #2101 from eustas/patch-1
Fix typos
2023-06-21 15:51:03 +07:00
Ha Thach
6cf735031f
Merge pull request #2117 from hathach/etm_trace
Etm trace
2023-06-21 00:24:26 +07:00
hathach
77e01448e2
ide settings 2023-06-20 16:41:51 +07:00
hathach
c789cfe518
use system_nrf5x.c built-in support for ETM with ENABLE_ETM 2023-06-20 16:13:10 +07:00
hathach
19c99d3b42
etm trace for nrf52840 2023-06-20 13:19:08 +07:00
hathach
1b658ae109
add etm trace for mcb1800
clean up other ide setting
2023-06-20 13:12:12 +07:00
Angel Molina
3d685fe7f2 Add CDC+UAC2 composite device example for Pico
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
2023-06-19 16:00:03 +05:30
hathach
7dc6829519
enable etm trace support for h743 eval 2023-06-19 16:33:47 +07:00
dsugisawa-mixi
5e78f08a24 fix example of bare_api, check empty string 2023-06-17 20:04:46 +09:00
Ha Thach
13bb132044
Merge pull request #2113 from hathach/correct-iar-build
correct cmake iar build
2023-06-16 19:53:01 +07:00
hathach
268ce0287f
correct cmake iar build 2023-06-16 19:39:03 +07:00
Ha Thach
74624381b3
Merge pull request #2112 from hathach/minor-naming-opt-mcu-imxrt
Minor naming opt mcu imxrt
2023-06-16 18:57:26 +07:00
hathach
1419091923
update h7 to cmake, and move iar build to cmake 2023-06-16 16:47:32 +07:00
hathach
e754795d3a
fix build warnings 2023-06-16 15:29:34 +07:00
hathach
a7f330fa94
fix build, update freertos config for cmake 2023-06-16 14:17:25 +07:00
hathach
65d6acdbfa
fix build warnings 2023-06-16 12:02:42 +07:00
hathach
8af8869d3b
renam OPT_MCU_MIMXRT to OPT_MCU_MIMXRT1XXX
fix build util with makefile
2023-06-16 11:26:38 +07:00
hathach
96f7cd09dc
remove legacy transdimension driver 2023-06-16 10:45:59 +07:00
Ha Thach
433ffe2152
Merge pull request #1985 from kkitayam/uvc_bulk
Add the capability for video class to handle a bulk endpoint in the streaming interface.
2023-06-15 16:28:33 +07:00
Ha Thach
81450bc71d
Merge pull request #2110 from hathach/chipidea-fs
Chipidea fs
2023-06-15 14:18:00 +07:00
hathach
1a37777f59
fix ci with win/mac 2023-06-15 13:11:21 +07:00
hathach
d70403f1f4
refactor khci to chipidea fs driver for device (host is not yet) 2023-06-15 13:06:27 +07:00
hathach
bce282186e
update kinetis kl to use mcx-sdk, also add cmake support
note: cdc_msc_freertos built but does not seems to work with kl
2023-06-14 22:36:44 +07:00
Ha Thach
4e61eb6d9e
Merge pull request #2109 from hathach/typec-rename
Typec rename
2023-06-14 16:47:20 +07:00
hathach
31a66eb5bc
mcx neeed helps to locate rtt control block 2023-06-14 15:33:57 +07:00
hathach
8b8b9690ad
update segger rtt to fix cast align 2023-06-14 12:01:21 +07:00
hathach
05969d2a58
rename typec driver 2023-06-14 11:07:58 +07:00
hathach
a88d7c7c74
ide setting 2023-06-13 17:47:53 +07:00
Ha Thach
365c4169a5
Merge pull request #2107 from hathach/fix-usbh-enum-issue
fix usbh issue when device genreate multiple attach/detach/attach when plugging in
2023-06-13 17:32:55 +07:00
hathach
9593ab7acc
fix usbh issue when device genreate multiple attach/detach/attach when plugging in 2023-06-13 16:40:29 +07:00
Ha Thach
bbc76e7777
Merge pull request #2104 from hathach/g4-pd
Initial support for USB PD stack
2023-06-12 23:14:48 +07:00
hathach
41801c2a6b
add typec example to cmake 2023-06-12 17:12:25 +07:00
hathach
d2d486dced
update docs 2023-06-12 17:06:04 +07:00
hathach
7a1179a4e1
tested with 9V request 2023-06-12 17:01:54 +07:00
hathach
6941a5af81
wrap up initial PD support for G4 2023-06-12 16:42:27 +07:00
hathach
c28503060c
ad pd_types.h 2023-06-12 14:57:50 +07:00
hathach
debde4cc97
response with request safe5v, get passed PS_READY 2023-06-12 12:14:55 +07:00
Ha Thach
39a64334aa
Merge pull request #2100 from kilograham/top_broken
movement of TOP in c0ecf8b5 broke RP2040 SDK build
2023-06-10 17:24:23 +07:00
hathach
bb4fb0543b
able to parse SOURCE_CAP message from dfp 2023-06-09 19:38:50 +07:00
hathach
912802456b
move protocol message to stack, disable battery in PWR's CR3
there is still issue with CC1/CC2 pull down resistor and vstate is not
correct.
2023-06-09 18:15:28 +07:00
Eugene Kliuchnikov
0833806980 Fix typos 2023-06-08 15:38:30 +02:00
hathach
8181d470e5
enable DMA for both pd rx, tx 2023-06-08 18:55:54 +07:00
hathach
9c2a8490af
dma rx works well 2023-06-08 13:37:37 +07:00
hathach
fc761953b3
define tuc_int_handler() to empty if TUC not enabled 2023-06-08 09:34:15 +07:00
hathach
7fd0a17bc3
default CFG_TUC_ENABLED to 0 2023-06-08 09:11:29 +07:00
graham sanderson
0493983a8f movement of TOP in c0ecf8b5 broke RP2040 SDK build 2023-06-07 14:46:14 -05:00
Ha Thach
aaec12a3fb
Merge pull request #2077 from abakosh/renesas_packed
fix(RA Host Portable): git rid of the IAR warnings for packed
2023-06-07 19:00:41 +07:00
hathach
9b7dee563e
able to response with good crc 2023-06-07 18:57:48 +07:00
Aladdin Bakosh
8bb012e50b fix(RA): static assert RUSB2 register 2023-06-07 12:01:59 +02:00
hathach
b893f1d541
inital support for usb typec and pd example 2023-06-07 15:10:40 +07:00
hathach
914e82b25d
able to receive first PD message 2023-06-07 09:36:37 +07:00
hathach
e02eee7477
revert board flash latency to 8 2023-06-07 00:14:22 +07:00
hathach
23f7130ae4
update rtt to rev 25842 2023-06-07 00:07:58 +07:00
hathach
b3fda4a354
able to get usbpd irq handler
- handle cc1, cc2 voltage changes
- get order set, rx message end interrupt
- add  segger rtt support for cmake
2023-06-06 23:55:33 +07:00
hathach
a70978e057
clean up 2023-06-05 19:53:40 +07:00
hathach
f6a45a7aab
clean up 2023-06-05 15:41:45 +07:00
Martino Facchin
2b735ee8f5 renesas_ra: fix wrong ifdef
Since CFG_TUSB_RHPORT1_MODE is always defined now for backwards compatibility
2023-06-05 09:48:06 +02:00
Martino Facchin
cdbd3a0b4e Merge remote-tracking branch 'mainline/master' into HEAD
Update fsp to 4.0.0
2023-06-05 09:12:50 +02:00
Martino Facchin
cdae66c837 renesas_rx: fix compilation on latest GCC
__CCRX__ only applyes to version 4 of RX family compiler http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V4.01.00/CS+.chm/Compiler-CCRX.chm/Output/ccrx04c0201y.html

__RX__ is one of the macros exported by latest gcc (gcc_8.3.0.202305_rx_elf)
2023-06-05 09:04:55 +02:00
Aladdin Bakosh
268ab5863a fix(RA Host Portable): git rid of the IAR warnings for packed 2023-06-02 14:14:57 +02:00
Ha Thach
c7686f8d5e
Merge pull request #2092 from hathach/stm32g4
Stm32g4
2023-06-02 17:07:28 +07:00
hathach
2016ad72f3
fix iar ci 2023-06-02 16:21:49 +07:00
hathach
11fb837b51
fix ci 2023-06-02 16:15:26 +07:00
hathach
c2bc363f06
build g0 g4 iar cmake 2023-06-02 16:11:00 +07:00
hathach
bb795e6a5e
update cmake to build with IAR for g0 and g4 2023-06-02 15:26:16 +07:00
hathach
fcf7791454
add IAR support for G0 with cmake 2023-06-02 13:27:18 +07:00
hathach
e7090c7514
cmake refactor 2023-06-02 11:42:17 +07:00
hathach
ba3d71b615
fix usb clock for dpow1 2023-06-02 10:19:46 +07:00
Dave Nadler
e8b7f21af6 For FreeRTOS kernel-aware debugging, when queue registry is enabled, label tinyUSB queue 2023-06-01 12:57:44 -04:00
Ha Thach
002cb9289d
Merge pull request #2089 from DRNadler/master
Fix diagnostic format string (missing %u)
2023-06-01 22:56:18 +07:00
hathach
c3bde520cc
add new b_g474e_dpow1 board 2023-06-01 22:16:30 +07:00
Dave Nadler
70a92291fe Fix diagnostic format string (missing %u) 2023-06-01 10:58:03 -04:00
Ha Thach
cbbd858be4
Merge pull request #1942 from HubertD/feature/STM32G0
STM32G0 support
2023-06-01 21:34:39 +07:00
hathach
dc3afdbf3b
add note for B0 clock variant 2023-06-01 20:52:48 +07:00
hathach
c750030f7a
add freertosconfig for g0, add cmake stlink, add g0 to cmake ci 2023-06-01 17:09:00 +07:00
hathach
6280cba6e8
tested with g0b1 nucleo 2023-06-01 16:52:58 +07:00
hathach
6b44d8fb55
add cmake support for g0, exlicitly call HAL_Init() and also HAL_IncTick() in systick irq, fix button active state. 2023-06-01 15:58:02 +07:00
hathach
af59864ab5
Merge branch 'master' into feature/STM32G0 2023-06-01 13:28:28 +07:00
Ha Thach
77714e02ca
Merge pull request #2088 from hathach/minor-cleanup
add lto for cmake
2023-06-01 13:22:09 +07:00
hathach
62b2d05d34
skip set CMAKE_EXECUTABLE_SUFFIX for espressif port 2023-06-01 12:50:32 +07:00
hathach
19a597bcae
add lto for cmake 2023-06-01 12:36:08 +07:00
Ha Thach
ddc029ce54
Merge pull request #2016 from ipopov/master
Even when we get an empty "status change" interrupt from the hub, schedule another interrupt poll
2023-05-29 13:47:23 +07:00
hathach
20ef6c4ef7
slightly clean up 2023-05-29 13:29:11 +07:00
hathach
5c428d35a6
check status_change is not zero first 2023-05-29 13:27:20 +07:00
Ivo Popov
8ad024e51b
Even when we get an empty "status change" interrupt from the hub, schedule another interrupt poll.
During enumeration, when there are multiple devices attached to the
hub as it's plugged into the Pi Pico, enumeration hangs, because we
get a "status change" callback with value zero. With this patch, we
retry several times on "zero" status change callbacks, until
eventually we succeed.

This is the cheapo hub that exhibits this behavior, but I assume it's
not the only one: https://www.amazon.com/gp/product/B083RQMC7S.

While debugging this, I consulted the implementation in the Linux
kernel. There, hub setup explicitly checks each port individually,
before starting to depend on "status change" interrupts:
https://elixir.bootlin.com/linux/latest/source/drivers/usb/core/hub.c#L1133.
We probably should do something like that here, but it's a much bigger
change.
2023-05-29 13:18:16 +07:00
gitlab
acfaa4494f Fixes bug in tuh_msc_ready 2023-05-28 15:40:01 +01:00
Ha Thach
069e1ef84f
Merge pull request #2084 from hathach/more-build2
More build2
2023-05-26 20:23:25 +07:00
hathach
59ad5c59df
fix artifacts location 2023-05-26 18:58:21 +07:00
hathach
4bd02fb04d
more test 2023-05-26 18:54:14 +07:00
hathach
c88e7481be
retry hw test 2023-05-26 17:15:54 +07:00
hathach
7fb74a33a1
forgot to move hw test 2023-05-26 16:44:29 +07:00
hathach
7ac85d08c7
move lpc18 and rp2040 to cmake workflow since rp2040 often failed randomly with make 2023-05-26 16:37:47 +07:00
hathach
05cc342dfa
update deps, rename kinetis_k32 to k32l 2023-05-26 15:45:55 +07:00
hathach
1d857605b7
use get_deps.py 2023-05-26 15:25:55 +07:00
hathach
b262164a35
fix build with net_lwip_webserver example 2023-05-26 15:16:18 +07:00
hathach
c0ecf8b50f
move set TOP to family_support.cmake 2023-05-26 14:56:22 +07:00
Ha Thach
23c8670e79
Merge pull request #2081 from hathach/more-build-system
More build system
2023-05-25 21:54:31 +07:00
hathach
4c9605910f
update cmake with freertos 2023-05-25 21:27:26 +07:00
hathach
5fea010406
add family_support_configure_common() 2023-05-25 17:27:05 +07:00
hathach
26d05d7fc9
fix issue with ftdi host driver with status bytes
add workflow_dispatch to all ci workflow
2023-05-25 16:53:32 +07:00
hathach
625c27ca58
add workflow_dispatch for manual trigger 2023-05-25 16:20:58 +07:00
hathach
7a3d7a7c23
cmsis_5 missing mcx and imxrt 2023-05-25 16:17:41 +07:00
hathach
5a0c2bd638
update get_deps.py to support geting family as argument 2023-05-25 16:11:57 +07:00
Ha Thach
eedafb23f7
Merge pull request #2063 from abakosh/develop
fix(RA Host Portable): implement missing function __builtin_ctz(x)
2023-05-24 20:11:50 +07:00
Aladdin Bakosh
57d2eb603b fix(RA Host Portable): implement missing function __builtin_ctz(x) for IAR 2023-05-24 11:38:40 +02:00
Ha Thach
1ef820ecfe
Enhance chipidea (#2075)
* update chipidea dcd, remove manual ep_count and use DCCPARAMS to get number of endpoint instead
* add dcd dcache for chipidea
* add cmake for lpc18
* add makefile build for mcx
* use fork of mcu sdk
* fix ci build with nrf
* flash rp2040 with openocd
2023-05-23 21:45:00 +07:00
Ha Thach
c998e9c60b
Merge pull request #2069 from hathach/minor-build-system
Minor build system
2023-05-19 18:39:21 +07:00
hathach
9f0bae4c3f
fix freertos build with nrf 2023-05-19 18:04:08 +07:00
hathach
49d8d27770
improve flash target 2023-05-19 16:27:07 +07:00
hathach
270136e84a
adding cpu core .mk for makefile
fix cortex m33 for nrf5340 dk
2023-05-19 16:02:26 +07:00
hathach
e8dd200fed
move cmake folder to tools/ 2023-05-19 14:46:39 +07:00
Ha Thach
6ecd480006
Merge pull request #2061 from hathach/imx-usbhost
iMX.RT EHCI add dcache support and other fixes + refactor
2023-05-19 14:18:07 +07:00
hathach
7211dd18b4
more dcache fix 2023-05-19 13:42:26 +07:00
hathach
5dae5e1292
ehci fix dcache clean when control endpoint failed 2023-05-19 13:32:49 +07:00
hathach
f26a93908e
only clean/invalidate dcache on imxrt if memory is not in DTCM 2023-05-19 10:56:52 +07:00
hathach
f22d8ee3b9
add rt1060 jlink config 2023-05-18 16:46:02 +07:00
hathach
ec4bd39a92
refactor ehci: add attached_buffer for dcache invalidate for IN transfer 2023-05-18 16:41:06 +07:00
hathach
27acaa013b
refactor ehci, since usbh only queue 1 TD per queue head 2023-05-18 15:44:08 +07:00
hathach
49e2aabc81
EHCI more improvement
- more dcache clean/invalidate
- extract init_periodic_list()
- improve isr list handling
2023-05-18 13:45:38 +07:00
hathach
a0aea52a11
more cache, fix an similar issue with OHCI when removing an queue head 2023-05-18 12:39:53 +07:00
hathach
e4f4ad5bc3
use weak local for dcache function to skip if() 2023-05-18 10:21:11 +07:00
hathach
a3e017bfd2
EHCI adding dcahe support, passing enumertaion 2023-05-18 10:04:48 +07:00
Martino Facchin
32f9f452af renesas: provide default for CFG_TUSB_RHPORT1_MODE
Should fix CI failure for Renesas RX family
2023-05-17 12:13:28 +02:00
hathach
eb89df4115
adding hcd_dcache_clean/hcd_dcache_invalidate 2023-05-17 16:14:35 +07:00
hathach
a9aa0e3a1a
fix error on EHCI causes xfer error in non-queued qhd which cause memory fault 2023-05-16 11:10:44 +07:00
hathach
1e998ce3bd
usbd: fix control transfer issue for chipidea hs when previous status and new setup complete in the same isr frame
change usbd edpt busy/stalled/claimed value to 0/1 instead of
(true/false) since they are 1-bit field.
2023-05-16 11:09:23 +07:00
hathach
2c48050993
add various check for disconncted device, also fix #1511 un-roll recursive hub removal with usbh queue 2023-05-16 11:09:22 +07:00
hathach
1c4f22a54c
EHCI: fix xfer failed with disconnected device as stalled
- change CFG_TUH_ENDPOINT_MAX to 16 (max endpoint pair per device) if
not defined
- change QHD_MAX for EHCI, should be user configurable and more
optimized in the future
2023-05-16 11:09:22 +07:00
hathach
206d63e038
correct EHCI reporting failed xfer (instead of stalled) when device is unplugged 2023-05-16 11:09:21 +07:00
Ha Thach
e2d3c0b2d3
Merge pull request #2065 from hathach/cmake-lpc55
add support for nrf5340 application core with pca10059
2023-05-16 11:04:07 +07:00
hathach
116a258858
fix nrf build 2023-05-16 10:14:00 +07:00
hathach
792cf95f2d
revert ci gcc to 11.2, update nrfx to version 2.11 2023-05-15 23:35:29 +07:00
hathach
d7175ad834
update nrf cmake and make to support nrf5340 (pca10095) 2023-05-15 23:34:24 +07:00
Ha Thach
9f5b08dc93
Update build_arm.yml
try bump up gcc to 12
2023-05-15 14:39:49 +07:00
hathach
9fd0fee458
adding nrf 2023-05-15 14:25:42 +07:00
Ha Thach
a57ba87859
revert family.mk 2023-05-13 13:24:00 +07:00
hathach
dbcef41f95
add support for other lpc55 boards 2023-05-13 13:24:00 +07:00
hathach
2c745d1b1e
able to build lpc55 2023-05-13 13:23:59 +07:00
HiFiPhile
f1bef8d8dd
Merge pull request #2057 from abakosh/develop
fix(iar_template.ipcf): add missing portable links, and delete the us…
2023-05-12 13:15:19 +02:00
HiFiPhile
9c1918fe46
Remove deprecated dcd_synopsys 2023-05-12 13:13:42 +02:00
Ha Thach
aaff27d220
Merge pull request #2058 from hathach/cmake-imxrt
Add Cmake for imxrt and Fix EHCI PortSC issue
2023-05-10 16:06:04 +07:00
hathach
eaa159c0a6 more doc build fix 2023-05-10 15:52:33 +07:00
hathach
137d516882 try to fix build doc 2023-05-10 15:32:39 +07:00
hathach
1e91fc97e2 remove imxrt from makebuild 2023-05-10 14:59:23 +07:00
hathach
c4b2fed8bd forgot sudo 2023-05-10 13:51:45 +07:00
hathach
c3770019cb install ninja 2023-05-10 13:50:24 +07:00
hathach
8e3bdd2391 add python script to help building cmake, build all imxrt boards with ci 2023-05-10 13:09:15 +07:00
hathach
4c796b89d8 try to build with cmake on ci 2023-05-10 11:20:26 +07:00
hathach
c0e4c02b9d allow imxrt build with dual exmaples 2023-05-10 11:15:11 +07:00
hathach
bc579c045e skip link option --print-memory-usage for renesas rx since it does not support this option 2023-05-09 21:39:10 +07:00
hathach
77f0726361 fix ehci issue with portsc when enable port power and port reset
fix attached device not regconized if attached before power on
2023-05-09 17:32:14 +07:00
hathach
04c759028a simplify cmake target, remove -bsp 2023-05-09 10:02:44 +07:00
Aladdin Bakosh
4be7546372 fix(iar_template.ipcf): add missing portable links, and delete the usbh_control.c from the list 2023-05-08 15:57:34 +02:00
hathach
fd50be2e62 change imxrt board_uart_read() to non-blocking
simple host seems to work
2023-05-08 19:43:48 +07:00
hathach
4fc4f35a8a fix linking missing ivt symbol for imxrt with cmake
changed device port = 0, host port =1 for imxrt 1060 and 1064
2023-05-08 17:25:47 +07:00
hathach
654f182176 build host examples with imx 2023-05-08 00:24:48 +07:00
hathach
6945c594d5 update all device cmake example for imx 2023-05-07 22:09:08 +07:00
hathach
f15f79df5d cmake work well with imxrt 2023-05-06 15:14:54 +07:00
hathach
cda5ab8b25 more temp work 2023-05-05 19:15:19 +07:00
hathach
97ee40fd7b add clion files 2023-05-05 16:51:50 +07:00
hathach
8a9d2b4b75 wip 2023-05-04 23:29:37 +07:00
Martino Facchin
161c95f1b7 renesas: update fsp to 4.0.0 2023-05-04 14:42:32 +02:00
hathach
629717cd13 fix cmake build 2023-05-04 16:38:06 +07:00
Martino Facchin
6ff62c0fe8 renesas: add fallback for targets not defining CFG_TUSB_RHPORT*_MODE 2023-05-03 11:47:41 +02:00
Martino Facchin
a349869906 renesas_ra: fix existing boards support 2023-05-03 10:06:58 +02:00
Martino Facchin
5f7e7b4b0a renesas_ra: support RA2A1 (FS only) 2023-05-03 10:06:13 +02:00
Martino Facchin
4afed62646 renesas_ra: host: handle retry on attach() 2023-05-03 10:05:29 +02:00
Martino Facchin
be54870c3b renesas_ra: add support for HS port 2023-05-03 10:02:24 +02:00
Ha Thach
5e023fa2ca
Merge pull request #2051 from hathach/improve-serial-host
Improve serial host
2023-04-28 22:59:57 +07:00
hathach
1763eede48
more update to host serial API 2023-04-28 22:14:14 +07:00
hathach
fb5fe3360f
allow call tuh cdc with blocking (callback = NULL)
- tuh_cdc_set_control_line_state()
- tuh_cdc_set_baudrate()
- tuh_cdc_set_line_coding()
2023-04-28 21:50:54 +07:00
hathach
0a43a7b418
improve host serial drivers
- tuh_control_xfer() update xfer result to user_data if complete
callback = NULL (sync/blocking)
- refactor host serial driver for acm/ftdi/cp210x
2023-04-28 19:13:25 +07:00
Ha Thach
2afef458be
Merge pull request #2030 from slc-tl/patch-1
Update porting.rst
2023-04-28 11:36:14 +07:00
hathach
090078542f update osal note 2023-04-28 11:34:12 +07:00
Ha Thach
a41ab41b8b
Merge pull request #2047 from jbtheou/master
cdc: fix line_coding aligment
2023-04-28 11:25:53 +07:00
hathach
190acc1fb0 add aligned(4) for cdc_line_coding_t 2023-04-28 11:12:03 +07:00
Jean-Baptiste Theou
8f47976639 cdc: fix line_coding aligment
While calling tud_cdc_n_get_line_coding, the structure is copied into
the destination.

Dump of assembler code for function tud_cdc_n_get_line_coding:
   0x000193f4 <+0>:	mov.w	r2, #2112	@ 0x840
0x000193f8 <+4>:	ldr	r3, [pc, #20]	@ (0x19410
<tud_cdc_n_get_line_coding+28>)
   0x000193fa <+6>:	mla	r0, r2, r0, r3
=> 0x000193fe <+10>:	ldr.w	r3, [r0, #6]
   0x00019402 <+14>:	str	r3, [r1, #0]

On some platform (tested on LPC55S28), the address needs to be 4-bytes
aligned. Without this, the address is

(gdb) p &_cdcd_itf.line_coding
$3 = (cdc_line_coding_t *) 0x40100006 <_cdcd_itf+6>

which leads to a HardFault. With this fix

(gdb) p &_cdcd_itf.line_coding
$5 = (cdc_line_coding_t *) 0x40100008 <_cdcd_itf+8>

and the function can be called properly

Signed-off-by: Jean-Baptiste Theou <jb@thing.com>
2023-04-27 15:48:15 -10:00
Ha Thach
e3b3229d61
Merge pull request #2046 from hathach/add-usb2uart-host-driver
Add usb2uart serial host driver
2023-04-28 00:06:08 +07:00
hathach
732686cc10 add tuh_cdc_set_baudrate() 2023-04-27 23:22:10 +07:00
hathach
ee58278ed2 add code to calculate divisor from baudrate for ftdi 2023-04-27 23:08:25 +07:00
hathach
8214f0f497 clean up 2023-04-27 17:40:08 +07:00
hathach
c10f52b237 forgot to add cp210x header 2023-04-27 17:39:02 +07:00
hathach
438387be8c more refactor 2023-04-27 17:32:56 +07:00
hathach
86f6fd17ed cp210x seems to work well 2023-04-27 17:09:21 +07:00
hathach
a32ef1cde1 more host serial refactor 2023-04-27 16:32:42 +07:00
hathach
9698a088db refactor acm function 2023-04-27 15:29:44 +07:00
hathach
85d9925d24 refactor ftdi driver 2023-04-27 15:20:04 +07:00
hathach
293a6222f8 rename ftdi_host to ftdi_sio 2023-04-27 11:08:42 +07:00
hathach
cf95b44001 enable CDC FTDI 2023-04-26 22:36:17 +07:00
hathach
45169d833d hacky, but ftdi work with hard code baudrate = 9600 2023-04-26 22:36:17 +07:00
hathach
1a229f3ce2 fix pio vbus typo 2023-04-26 22:36:17 +07:00
Ha Thach
4c7fd1648e
Merge pull request #2043 from hathach/fix-nxp-build
fix build with nxp since mcux-sdk from 2.13.0 remove CMSIS folder
2023-04-26 22:33:28 +07:00
hathach
ad39833ea4 fix build with nxp since mcux-sdk from 2.13.0 remove CMSIS folder 2023-04-26 22:10:13 +07:00
Ha Thach
908e23d109
Merge pull request #2040 from hathach/update-imxrt-deps
bump up imxrt mcux-sdk to 2.13.1
2023-04-24 16:59:05 +07:00
hathach
841a62170e bump up imxrt mcux-sdk to 2.13.1 commit f357a1150f6cf6c6b844f53f2d426bfb3e649850 2023-04-24 16:54:26 +07:00
Ha Thach
964e7ebf21
Merge pull request #2013 from tannewt/imx_1042
Handle iMX RT 1042 usb naming
2023-04-24 16:53:24 +07:00
Ha Thach
8ede566c41
Merge pull request #2039 from hathach/add-cmake-build
Add cmake build
2023-04-24 16:43:40 +07:00
hathach
a4d5d51549 add wip note 2023-04-24 16:24:06 +07:00
hathach
5254202b20 minor update 2023-04-24 11:54:58 +07:00
hathach
9858d45815 build all freertos, not able to build net lwip due to lack of sio_open() 2023-04-21 22:07:58 +07:00
hathach
11e1aff389 update freeRTOS kernel to latest for library cmake
add per family freeRTOSConfig.h also make changes to build with
freertos_kernel cmake
- hard coded configPRIO_BITS based on family
- change configSUPPORT_STATIC_ALLOCATION to 0,
configSUPPORT_DYNAMIC_ALLOCATION to 1
- enable configRECORD_STACK_HIGH_ADDRESS for tracing
- enable INCLUDE_xTaskGetCurrentTaskHandle which is required to compile
stream_buffer (although we don't use it).
2023-04-21 20:55:44 +07:00
hathach
6daa135201 update most examples cmake to build with imxrt 2023-04-21 18:23:40 +07:00
hathach
0afe1b3684 example run well with cmake for imxrt 2023-04-21 18:10:28 +07:00
Ha Thach
0871238cac
Merge pull request #2024 from jfedor2/sie_ctrl_fix
[rp2040] Make writes to SIE_CTRL aware of concurrent access
2023-04-21 12:17:57 +07:00
Jacek Fedorynski
9bf97e3e52 [rp2040] Make writes to SIE_CTRL aware of concurrent access
This commit makes it so that when setting the START_TRANS bit in the
SIE_CTRL register, along with some other bits, we first set all the
other bits, then wait some cycles, and then set the START_TRANS bit.

Doing so protects against a situation where the USB controller is
reading the register at the same time and gets an incorrect value.

This mirrors the procedure already applied to buffer control
registers.
2023-04-20 20:23:31 +02:00
hathach
2ac289685a clean up 2023-04-20 16:55:48 +07:00
hathach
b42d3e431c board test running with cmake 2023-04-20 16:43:00 +07:00
hathach
fab48e5bcc adding cmake build for imxrt1010 2023-04-20 14:09:38 +07:00
Ha Thach
9771c76f25
Merge pull request #2033 from ReimuNotMoe/master
Fix compatibility with the latest Microchip XC16 compiler
2023-04-19 12:53:23 +07:00
Reimu NotMoe
c0674142a8
Merge branch 'hathach:master' into master 2023-04-18 23:20:25 +08:00
Reimu NotMoe
9002dc7067 Use __GNUC__ macro to determine if __has_attribute is supported 2023-04-18 17:27:42 +08:00
Ha Thach
c3a60ed355
Merge pull request #1920 from mikee47/fix/midi-definition
MIDI_CIN_NOTE_ON definition transposed with MIDI_CIN_NOTE_OFF
2023-04-18 10:43:52 +07:00
Mengsk
412b557a08 Cleanup unnecessary code for 16bit access. 2023-04-17 15:34:20 +02:00
Reimu NotMoe
fa8f3731c1 Implement TU_BSWAP{16,32} correctly for Microchip XC16 2023-04-17 21:02:12 +08:00
Reimu NotMoe
d97b6d57de Fix compatibility with the latest Microchip XC16 compiler 2023-04-17 20:20:22 +08:00
slc-tl
8c780a9564
Update porting.rst
Adds more in depth documentation of how tud_task does not need to be polled in implementations that use an RTOS / scheduler.
2023-04-14 17:07:33 -06:00
HiFiPhile
818bda18c2 Fix FIFO transfer and buffer alignment. 2023-04-14 23:37:07 +02:00
HiFiPhile
2f2c8ce9ec Fix GCC build. 2023-04-14 21:00:55 +02:00
HiFiPhile
723e21ad6a
Merge pull request #2025 from dauc/master
Fix spelling configuraiton->configuration
2023-04-14 18:48:03 +02:00
HiFiPhile
71d2ccd78f Fix CI 2023-04-14 17:29:32 +02:00
HiFiPhile
413b0a7da5 Use PLL clock. 2023-04-14 17:12:47 +02:00
HiFiPhile
0ea23904c4 Add stm32g0b1nucleo BSP. 2023-04-14 16:07:04 +02:00
HiFiPhile
152a22f3ee Update lib & template. 2023-04-14 16:05:56 +02:00
Devin Auclair
16ed10a6e4 Fix spelling configuraiton->configuration 2023-04-14 12:48:59 +00:00
HiFiPhile
cbf4b1aec8 Merge branch 'master' of https://github.com/hathach/tinyusb into pr1942 2023-04-14 13:16:52 +02:00
HiFiPhile
28817a7150
Merge pull request #2015 from tyustli/tyustli_uac
fix audio comment error
2023-04-08 16:25:39 +02:00
HiFiPhile
95dec2ac26 Fix case. 2023-04-08 15:39:33 +02:00
tyustli
d4c7c9871e fix audio comment error 2023-04-08 18:14:10 +08:00
Scott Shawcroft
2cda9b60c9
Handle iMX RT 1042 usb naming 2023-04-06 15:45:23 -07:00
Ha Thach
3336fbafe4
Merge pull request #2011 from hathach/add-hid-host-ready
Add hid host send/recieve ready
2023-04-06 12:16:17 +07:00
hathach
6db24e0dba implement tuh_hid_receive_ready() and tuh_hid_send_ready() 2023-04-06 11:16:28 +07:00
hathach
106084289d add define for vendor_flush() to write_flush() for backward compatible 2023-04-06 11:15:57 +07:00
Ha Thach
5f327dd49f
Merge pull request #2006 from hathach/cmake
Cmake
2023-04-06 00:39:39 +07:00
Ha Thach
f7aa716a61
Merge pull request #2000 from jncronin/stm32l5
Add STM32L5 support - no OTG similar to some L4s
2023-04-04 16:30:47 +07:00
Ha Thach
4c5104f6d6
Merge pull request #1989 from epatstarkey/vendor_device_race_condition_fix
Vendor device race condition fix
2023-04-04 12:27:22 +07:00
Ha Thach
8d07f5e733
Merge pull request #1999 from raiden00pl/master
openh743i: initialize USB3300 reset pin
2023-04-04 11:27:19 +07:00
Ha Thach
44fab77c3d
Update bug_report.yml 2023-04-04 11:02:20 +07:00
John Cronin
718bcdb8bc Add STM32L5 support - no OTG similar to some L4s 2023-04-03 13:56:16 +01:00
hathach
4f96a1f3b2 more fix 2023-04-03 18:05:22 +07:00
hathach
5ef260d5fc fix build for esp32 2023-04-03 17:44:05 +07:00
raiden00pl
f2faf72f7f
openh743i: initialize USB3300 reset pin 2023-04-03 12:27:33 +02:00
hathach
1911c613c7 add some .idea configuration 2023-04-03 11:34:00 +07:00
hathach
160e2a8aeb skip .idea 2023-04-03 11:07:48 +07:00
epatstarkey
1372d4e4d5 Remove trailing whitespace 2023-03-31 12:58:51 -05:00
epatstarkey
d7d4e7b527 Update samples 2023-03-30 11:34:39 -05:00
hathach
cf7aad790c more esp32 cmake clean up 2023-03-30 11:37:36 +07:00
hathach
641613c428 update all cmake for esp32 build 2023-03-30 10:41:11 +07:00
hathach
96718b7ca0 merge s2 and s3, update cmake for espressif, add tinyusb_src as component 2023-03-30 00:31:26 +07:00
hathach
99315bcca3 adding more cmake support 2023-03-29 14:36:43 +07:00
epatstarkey
1fb2a2f1bd
Update vendor_device.c 2023-03-28 14:01:33 -05:00
epatstarkey
876f49f6ad
Update vendor_device.c 2023-03-28 14:00:23 -05:00
epatstarkey
faaed198b4
Update vendor_device.h 2023-03-28 13:59:59 -05:00
kkitayam
5ce60c5d20 Add MJPEG descriptor for bulk transfer 2023-03-26 21:22:52 +09:00
kkitayam
993b8d6686 Add state variable 2023-03-26 21:18:00 +09:00
kkitayam
389babf20b Add descriptor for a bulk endpoint as a streaming endpoint 2023-03-25 21:25:13 +09:00
kkitayam
e508831561 Update handle streaming interface 2023-03-25 21:25:13 +09:00
kkitayam
78732d6733 Fix streaming interface handling 2023-03-25 21:25:12 +09:00
kkitayam
97f9321e1d Add handling for bulk EPs 2023-03-25 21:25:12 +09:00
Ha Thach
5add4c97fa
Merge pull request #1979 from hathach/fix-cdc-host-unsupported-line-request
fix cdc host enumeration issue when device does not support line request
2023-03-24 17:58:34 +07:00
hathach
df5f60b6d6 fix shadow warning 2023-03-24 17:36:29 +07:00
hathach
b054229780 fix cdc host enumeration issue when device does not support line request 2023-03-24 17:26:30 +07:00
Ha Thach
59cbfbbdbe
Merge pull request #1971 from MattMills/class_net_net_device_mac_address_shouldnt_be_consts
Update net_device.h to make MAC addresses not const.
2023-03-24 16:48:33 +07:00
Ha Thach
f640163ee9
Merge pull request #1969 from hathach/fix-tmc488-bit-order-1658
Fix tmc488 bit order 1658
2023-03-24 14:41:57 +07:00
Ha Thach
ad7bacbfd8
Merge pull request #1978 from hathach/fix-align-host
separate CFG_TUSB_MEM_SECTION/ALIGN to host and device specific macros
2023-03-24 14:41:01 +07:00
hathach
76dae8d8c1 update host example to use new tuh mem macros 2023-03-24 14:08:57 +07:00
hathach
71fb6469d4 separate CFG_TUSB_MEM_SECTION and CFG_TUSB_MEM_ALIGN to
- CFG_TUD_MEM_SECTION and CFG_TUD_MEM_ALIGN
- CFG_TUH_MEM_SECTION and CFG_TUH_MEM_ALIGN
- fix missing mem section and align for host
2023-03-24 14:05:21 +07:00
Ha Thach
7440782afb
Merge pull request #1975 from hathach/update-doc
update doc and generate deps list
2023-03-23 16:39:19 +07:00
hathach
f80d11301e
update doc and generate deps list 2023-03-23 16:33:35 +07:00
Ha Thach
cd0fdc3264
Merge pull request #1974 from hathach/pico-pio-name
rename and change default pio usb pin to adafruit feather usb host
2023-03-23 14:22:39 +07:00
hathach
4cee79af27
rename and change default pio usb pin to adafruit feather usb host 2023-03-23 13:08:09 +07:00
Matt Mills
033627ee41 Remove const from tud_network_mac_address in example and test files 2023-03-22 07:30:46 -06:00
Matt Mills
4274cab395
Update net_device.h 2023-03-22 07:18:27 -06:00
hathach
096da11e88
more update 2023-03-22 17:01:04 +07:00
hathach
c85f46c4ab
fix bitorder in usbtmc_response_capabilities_488_t 2023-03-22 16:59:57 +07:00
Ha Thach
07976ad26d
Merge pull request #1968 from hathach/refactor-hid-host
Refactor hid host
2023-03-22 10:37:06 +07:00
hathach
f27486e19a add tuh_hid_itf_get_info() and change tuh_cdc_itf_get_info() to use new tuh_itf_info_t 2023-03-22 10:00:42 +07:00
hathach
f8a5cde3c7 add tuh_task_event_ready(), better implement blocking control transfer for rtos 2023-03-22 09:23:44 +07:00
hathach
0921edaf59 use tud_inited() instead of tusb_inited() 2023-03-22 09:23:11 +07:00
hathach
a97f39151e fine tune CFG_TUH_HID value 2023-03-22 08:33:30 +07:00
hathach
d22fc550c7 change meaning of CFG_TUH_HID to total number of HID interfaces supported.
- previously CFG_TUH_HID is max number of interfaces per device which is
rather limited and consume more resources than needed.
- change hid host instance in API to index
2023-03-21 21:04:06 +07:00
hathach
8a0b17598c add osal_task_delay() for control blocking 2023-03-21 18:15:45 +07:00
hathach
d34508a316 add note for blocking tuh_configuration_set(), tuh_interface_set() 2023-03-21 18:13:25 +07:00
hathach
878f2b54fe relax hid host enumeration, allow set protocol to be stalled 2023-03-21 18:12:55 +07:00
Ha Thach
ec9c666107
Merge pull request #1965 from HiFiPhile/align
UAC2: fix feedback EP buffer alignment.
2023-03-21 15:46:00 +07:00
Ha Thach
096b6ec462
Merge pull request #1964 from hathach/add-tuh-set-interface
add tuh_set_interface
2023-03-21 13:58:44 +07:00
Mengsk
42decd94e5 UAC2: fix feedback EP buffer alignment. 2023-03-21 07:58:39 +01:00
hathach
ccf17e3cde add -Wreturn-type 2023-03-21 13:21:59 +07:00
hathach
e44e461ce3 add tuh_set_interface 2023-03-21 12:55:52 +07:00
Ha Thach
cbcf5d8c08
Merge pull request #1963 from hathach/rp2040-more-iar
more compatible with IAR
2023-03-20 11:58:51 +07:00
hathach
4520218786
more compatible with IAR 2023-03-20 11:33:39 +07:00
Ha Thach
d4d6f60885
Merge pull request #1962 from hathach/update-bsp
Update bsp
2023-03-19 19:10:54 +07:00
hathach
f58da31145
clean up 2023-03-19 18:12:03 +07:00
hathach
f75a019732
bsp lpc17 2023-03-19 18:10:26 +07:00
hathach
934baae9b8
bsp lpc51 2023-03-19 17:58:20 +07:00
hathach
1154b7a9e7
add mising lpc13 file 2023-03-19 17:40:44 +07:00
hathach
64c6b715ce
bsp lpc13 2023-03-19 17:27:45 +07:00
hathach
80be1aa13d
bsp lpc11 2023-03-19 17:19:33 +07:00
hathach
1867ba0bc1
fix l4 hw testing ci 2023-03-19 16:43:59 +07:00
hathach
aa11e21358
add mising file 2023-03-19 13:15:05 +07:00
hathach
b46632ba07
bsp for f2 f3 2023-03-19 13:11:41 +07:00
hathach
322f58ea85
add CFLAGS_SKIP to improve sam compile time 2023-03-19 12:47:05 +07:00
hathach
ab0da3c30b
group stm32l0 2023-03-19 12:01:33 +07:00
hathach
3944f1c4da
group same5x 2023-03-19 11:28:06 +07:00
Ha Thach
779149ecce
Merge pull request #1858 from bpaddock/FRDM_K32L24AS
Add support for the NXP FRDM-K32L2A4S eval board.
2023-03-18 22:18:39 +07:00
hathach
ec0f25d095
fix ci with kl25z 2023-03-18 20:30:49 +07:00
hathach
bbe550efa0
add kinetis family to ci 2023-03-18 20:19:37 +07:00
hathach
1fc203b085
more update to kinetis bsp 2023-03-18 19:50:24 +07:00
hathach
2d187777c0
merge kinetis into its own family in bsp 2023-03-18 18:30:51 +07:00
Bob Paddock
b13b95a670 Document that support for the FRDM-K32L2A4S has been added. 2023-03-18 16:50:51 +07:00
Bob Paddock
f9b8a0667a Add support for NXP FRDM_K32L2A4S eval board. 2023-03-18 16:50:50 +07:00
Ha Thach
f1a859d907
Merge pull request #1639 from bavison/portability
Fixes for building with IAR toolchain
2023-03-18 12:13:08 +07:00
hathach
9f54cc1eb7
more clean up 2023-03-18 11:43:47 +07:00
hathach
d919f107c7
minor clean up 2023-03-18 11:22:44 +07:00
hathach
bdfcd50b1b
Merge branch 'master' into portability 2023-03-17 23:53:38 +07:00
Ha Thach
65ee11ff63
Merge pull request #1882 from koendv/pitaya_lite
add board: DshanMCU Pitaya Lite
2023-03-17 20:48:39 +07:00
hathach
b2568eb02b
bump up mm32sdk to fix HSE_VALUE not 8Mhz warnings 2023-03-17 20:22:08 +07:00
hathach
1ed04ad05d
update mm32sdk with idndef for SYSCLK_FREQ_XXMHz and SYSCLK_HSI_XXMHz
add HSE_VALUE define for each board with 8mhz, 12mhz accordingly
2023-03-17 19:46:22 +07:00
hathach
b3ecf82196
whitespace 2023-03-17 19:31:45 +07:00
Koen De Vleeschauwer
899e7cc4f9 add board: DshanMCU Pitaya Lite 2023-03-17 19:31:06 +07:00
Ha Thach
bc57358eb0
Update README.rst 2023-03-17 19:29:25 +07:00
Ha Thach
4d273254b6
Merge pull request #1961 from hathach/remove-all-submodules
Remove all submodules
2023-03-17 19:27:47 +07:00
hathach
6683053f48
finalize 2023-03-17 18:44:30 +07:00
hathach
57d23c7a68
update example description 2023-03-17 18:34:56 +07:00
hathach
25d802532c
fix spelling 2023-03-17 18:34:43 +07:00
hathach
f14b4ba30a
use codespell as pre-commit 2023-03-17 17:27:17 +07:00
hathach
0c174c17ad
fix ci with building fuzz 2023-03-17 17:04:11 +07:00
hathach
a4b17483b9
fix ci build with fomu 2023-03-17 17:01:56 +07:00
hathach
2e5f649fd3
fix run unit test with pre-commit 2023-03-17 16:57:30 +07:00
hathach
3623ba1884
fix trailing space and new line
temporarily disable codespell
2023-03-17 16:12:49 +07:00
hathach
2faad42cb1
update ci
- remove submodules init
- pre-commit: forbid new submodule, run in ci
2023-03-17 15:54:25 +07:00
hathach
323a56e309
bump up freeRTOS deps to version 10.5.1 2023-03-17 15:39:59 +07:00
hathach
6763521ec7
remove all submodules 2023-03-17 15:31:41 +07:00
Ha Thach
16daad8164
Merge pull request #1960 from hathach/fix-host-enumerate-mul-device
Fix host enumerate multiple devices from multiple host controllers
2023-03-17 15:27:56 +07:00
Ha Thach
96d064e923
Merge pull request #1860 from howard0su/pico_freertos
Allow config OS for RP2040
2023-03-17 14:57:13 +07:00
hathach
511f5be8b3
bump up pico-pio-usb dependency 2023-03-17 14:46:34 +07:00
hathach
e1fda007f6
minor refactor to invalid index 2023-03-17 14:46:02 +07:00
hathach
317177c83d
update host example, add pio-pico-usb for rp2040 2023-03-17 14:06:25 +07:00
hathach
f349ae7702
fix enumerate one device at a time 2023-03-17 13:58:01 +07:00
Ha Thach
6b84a29f8c
Merge pull request #1391 from perigoso/renesas-ra
Renesas ra family support
2023-03-17 11:28:54 +07:00
hathach
c12795734c
reduce number of supported RA to only those that is tested 2023-03-17 10:59:08 +07:00
hathach
e7d212f337
more fix 2023-03-16 23:21:15 +07:00
hathach
ffdffc7e06
rename FREERTOS_PORT to FREERTOS_PORTABLE_SRC
also fix trailing spaces
2023-03-16 23:11:11 +07:00
hathach
e0b1de923c
add ra4m1_ek board 2023-03-16 22:43:58 +07:00
Ha Thach
d875e694f8
Merge pull request #1958 from tyustli/tyustli_st
fix HAL_Delay no effect bug on st platform
2023-03-16 12:28:24 +07:00
hathach
2a10d5c20b
rename ra board name 2023-03-16 11:39:53 +07:00
hathach
92aed7e3e0
rename symbols 2023-03-16 11:28:10 +07:00
hathach
bc2127b330
rename file link to rusb2 2023-03-16 11:03:53 +07:00
hathach
1117cf5729
update pre-commit yaml 2023-03-16 10:05:46 +07:00
hathach
cd1726c009 Merge branch 'master' into renesas-ra 2023-03-16 09:51:27 +07:00
tyustli
fabe86362b fix HAL_Delay no effect bug on st platform 2023-03-16 08:28:19 +08:00
Ha Thach
b443851980
Merge pull request #1957 from hathach/fix-old-picosdk
Fix old picosdk
2023-03-15 23:24:44 +07:00
hathach
ffa56a1beb
add pre-commit yaml 2023-03-15 19:30:35 +07:00
hathach
d9a9dc5ac0 fix PICO_SHARED_IRQ_HANDLER_HIGHEST_ORDER_PRIORITY not defined in old pico-sdk 2023-03-15 17:38:14 +07:00
Ha Thach
ea8ecea59a
Merge pull request #1953 from tannewt/fix_cached_imx_reset
Flush the dcd data on reset
2023-03-14 09:08:32 +07:00
Scott Shawcroft
d31aac453e
Flush the dcd data on reset 2023-03-13 15:22:00 -07:00
Ha Thach
7cf67b2845
Merge pull request #1889 from Tails86/master
Implemented tuh_hid_send_report
2023-03-13 17:03:27 +07:00
James Smith
9247131b1f Avoid spamming out endpoint on connect 2023-03-13 16:31:25 +07:00
James Smith
43770802f9 Removed tabs from host hid_controller example 2023-03-13 16:31:25 +07:00
James Smith
296ce528fc Updated host hid_controller example to demo tuh_hid_send_report 2023-03-13 16:31:25 +07:00
James Smith
f6774d5611 Implemented tuh_hid_send_report 2023-03-13 16:31:25 +07:00
Hubert Denkmair
f8a21fff17 dcd_write_packet_memory: use volatile modifier for destination pointer 2023-03-12 15:51:07 +01:00
hathach
0a7c08d16e minor format 2023-03-12 16:01:24 +07:00
Ha Thach
be21413361
Merge pull request #1948 from dhalbert/remove-volatile-cast-include
rp2040: include hardware/sync.h explicitly
2023-03-11 09:35:04 +07:00
hathach
e045995407 minor update get_deps 2023-03-11 08:54:51 +07:00
hathach
4065ca3fca Merge branch 'master' into renesas-ra 2023-03-11 08:40:36 +07:00
Ha Thach
a8d7e08cee
Merge pull request #1950 from hathach/update-get-deps
update get-deps.py
2023-03-11 08:37:58 +07:00
hathach
cae05c6593 update get-deps.py 2023-03-11 08:33:08 +07:00
hathach
7428a16d2d remove ra submodules 2023-03-11 08:23:21 +07:00
hathach
fe77976765 Merge branch 'master' into renesas-ra 2023-03-11 08:15:23 +07:00
Ha Thach
6af18dc906
Merge pull request #1947 from hathach/remove-submodules
Remove submodules and use python script to manage repo dependencies
2023-03-11 08:09:25 +07:00
Ha Thach
b5b2fad5fb
Merge pull request #1946 from kasjer/kasjer/nrf5x-fix-iso-memory-corruption
dcd_nrf5x: ISO OUT handling
2023-03-11 08:06:17 +07:00
Dan Halbert
4857abdc6b rp2040: include hardware/sync.h explicitly 2023-03-10 14:01:51 -05:00
hathach
206a9a21e6 fix ci 2023-03-10 23:54:30 +07:00
hathach
704f3ddeb5 add dependencies repo to git ignore 2023-03-10 23:43:07 +07:00
hathach
7e6a6e75bc remove the rest of mcu submodules 2023-03-10 23:41:27 +07:00
hathach
fb9180b6eb remove most of the submodules 2023-03-10 23:36:53 +07:00
hathach
7c9bd81eca update deps script 2023-03-10 22:56:42 +07:00
hathach
d41320a42e adding python script to manage dependencies instead of submodule 2023-03-10 20:49:11 +07:00
hathach
76f43a7a16
starting to remove submodule cmsis5 and nrfx 2023-03-10 19:23:23 +07:00
Jerzy Kasenberg
f0ddf8d10f dcd_nrf5x: ISO OUT handling
For incoming ISO OUT packets it was possible to start
DMA from endpoint to RAM before transfer was started
resulting in unrelated memory corruption.
This is scenario that causes memory corruption:
- ISO OUT packet is received
- Packet is transferred by DMA to transfer buffer
- xfer->started is cleared and xfer->buffer is updated as
  it is in every case
- Application takes to long to handle it (it happens when debugger
  is connected breakpoint is hit slowing down software).
- Next ISO OUT packet arrives
At this point there was no check if transfer was started and packet
was copied by DMA to location beyond previous data, possibly overwriting
unrelated memory.

This solves the issue by checking that transfer was
started and there is buffer ready for incoming packet.
2023-03-10 08:22:43 +01:00
Ha Thach
990fb6ae5c
Merge pull request #1931 from branalba/master
For STM32H7 BSP boards, initialize RCC_...TypeDef structs as empty
2023-03-09 17:21:58 +07:00
hathach
0f8e530de1
fix incorrect merge of hcd link 2023-03-08 23:01:37 +07:00
hathach
2cf092464b
fix freertos build with iar, format/indent link_type 2023-03-08 22:34:54 +07:00
hathach
05e0205ad0
Merge branch 'master' into renesas-ra 2023-03-08 21:05:06 +07:00
Hubert Denkmair
af577d2b6d add G0 to supported platforms in README.rst :) 2023-03-08 14:25:30 +01:00
Hubert Denkmair
b3ad560e62 fix path to stm32g0xx.h 2023-03-08 14:22:11 +01:00
Hubert Denkmair
8ae4f8f069 add basic STM32G0 support 2023-03-08 12:14:40 +01:00
Hubert Denkmair
410ad4d0f9 add basic STM32G0 support 2023-03-08 12:05:58 +01:00
Ha Thach
be66f5f57f
Merge pull request #1941 from hathach/minor-ci
Minor ci
2023-03-08 13:08:25 +07:00
hathach
0957902c40
more ci merge 2023-03-08 12:28:30 +07:00
hathach
9e0ae5f29d
improve ci 2023-03-08 12:15:39 +07:00
Ha Thach
3387c86108
Merge pull request #1933 from kilograham/rp2040_llvm_tweaks
make rp2040 code compile cleanly with LLVM embedded toochain for ARM.
2023-03-06 15:24:51 +07:00
Ha Thach
66da95a0ee
Merge pull request #1938 from hathach/update-build
Fix build on windows and macos
2023-03-06 15:10:21 +07:00
hathach
ec8c292bbe
clean up 2023-03-06 14:37:40 +07:00
hathach
02478c57e5
more ci fix 2023-03-06 14:31:18 +07:00
hathach
e62d1a03ac
integrate top.mk into make.mk 2023-03-06 13:25:56 +07:00
hathach
b6404d143e
clean up top 2023-03-06 13:03:55 +07:00
hathach
9930863b41
fix iar ci 2023-03-06 12:45:47 +07:00
hathach
5c537c25f0
change gcc to 10.3 due to freeRTOS warning 2023-03-06 11:16:21 +07:00
hathach
956d1c9c4e
update size to fix macos ci 2023-03-06 10:33:04 +07:00
HiFiPhile
a83cef5e4c
Merge pull request #1937 from silvergasp/fix_wrong_size
fix: Fix wrong destsz used with tu_memcpy_s
2023-03-06 04:25:52 +01:00
Nathaniel Brough
95cfa37bf5 fix: Fix wrong destsz used with tu_memcpy_s
Bug: #1935
2023-03-05 18:47:48 -08:00
hathach
0a1a61bb6c
try gcc 12.2 with macos 2023-03-05 15:42:05 +07:00
hathach
9824981ee8
ignore mkdir in windows ci 2023-03-05 15:35:02 +07:00
hathach
8a493485e8
more ci test 2023-03-05 13:39:38 +07:00
hathach
b4ef98cbdc
fix ci build on windows 2023-03-05 10:57:16 +07:00
hathach
a99ee1b1a2
bump up gcc, test macos uname 2023-03-04 20:08:10 +07:00
hathach
363fcc5b68
only build 1 board on windows/macos 2023-03-03 16:24:33 +07:00
hathach
7089535848
clean up f0 warnings 2023-03-03 16:13:12 +07:00
hathach
9a8a9359e4
use make abspath intead of shell realpath 2023-03-03 15:55:34 +07:00
hathach
e92583ffd7
try adding build for windows and macos 2023-03-03 15:37:17 +07:00
graham sanderson
b7fa90e706 rp2040: Fixup lib and example compile for LLVM Embedded Toolchain for ARM 2023-03-02 14:32:22 -06:00
Ha Thach
34798ff85e
Merge pull request #1932 from hathach/add-usbip-fsdev
add TUP_USBIP_FSDEV and TUP_USBIP_FSDEV_STM32
2023-03-01 21:32:31 +07:00
hathach
5d3084a714 add TUP_USBIP_FSDEV and TUP_USBIP_FSDEV_STM32, clean up ifdef with stm32 2023-03-01 11:22:04 +07:00
Brandon Alba
8c8f26f14e In some STM32H7 BSP variants, initialized RCC_PeriphCLKInitStruct instances as empty 2023-02-28 10:31:07 -08:00
Brandon Alba
787afbbcd0 Initialized all RCC init structs for all STM32H7 BSP variants as empty 2023-02-28 10:25:06 -08:00
Ha Thach
3c38c7dc25
Merge pull request #1828 from HiFiPhile/stm32_fsdev
stm32_fsdev & ISO EP buffer allocation improvements
2023-02-28 23:45:02 +07:00
hathach
ffdc100cb9 rename ep_num to ep_idx, minor clean up 2023-02-28 17:11:59 +07:00
Ha Thach
65ac519715
Merge pull request #1852 from silvergasp/mem_s
fix: Replace device calls to memcpy with tu_memcpy_s
2023-02-27 10:22:53 +07:00
hathach
e34aeb5cf6 minor clean up 2023-02-27 09:11:35 +07:00
Ha Thach
73afca14eb
Merge pull request #1491 from Ryzee119/ohci_fixes
OHCI usbh, tweaks and improvements
2023-02-22 22:52:41 +07:00
hathach
eca96c635d
comment out osal_task_delay if using os none 2023-02-22 22:28:22 +07:00
hathach
4caa6063b0
white space 2023-02-22 22:17:45 +07:00
hathach
1466afafeb
move and add optional tusb_app_virt_to_phys/tusb_app_phys_to_virt
also add place holder for tusb_app_dcache_flush() and
tusb_app_dcache_invalidate()
2023-02-22 22:14:50 +07:00
Ha Thach
b66c2d5f0a
Merge pull request #1796 from Sinitax/master
Fix ifdefs for disabled uart stdio in rp2040 family
2023-02-22 17:40:54 +07:00
Ha Thach
8fadaf01d3
Merge pull request #1919 from hathach/use-tu-static-for-fuzz
use tu_static instead of static _fuzz_thread
2023-02-22 17:35:07 +07:00
mikee47
302b9562dc MIDI_CIN_NOTE_ON definition transposed with MIDI_CIN_NOTE_OFF 2023-02-22 09:58:30 +00:00
hathach
498989ee00
use tu_static instead of static _fuzz_thread 2023-02-22 16:23:40 +07:00
hathach
4c846af53e
rename OHCI_RHPORTS to TUP_OHCI_RHPORTS 2023-02-22 16:18:45 +07:00
hathach
c01aee6c1a
revert some changes 2023-02-22 15:14:56 +07:00
hathach
78a014ef18
move check LIB_PICO_STDIO_UART to board.h 2023-02-22 15:13:27 +07:00
Ha Thach
557bf82336
Merge pull request #1867 from silvergasp/thread_local_globals
fix: Change all static variables to thread when fuzzing
2023-02-22 12:54:32 +07:00
hathach
bcf5e5f729
missing some files 2023-02-22 12:10:22 +07:00
hathach
03ec49450d
rename maros from FUZZ to _FUZZ, change TU_STATIC to static _fuzz_thread 2023-02-22 11:47:09 +07:00
wooyay
4e2afdf5e1 ohci: Disable MIE interrupt during IRQ processing, zero HccADoneHead on completion 2023-02-18 10:48:39 +10:30
Ryzee119
75f6583c1c ohci: Use enum instead of magic number 2023-02-18 10:48:39 +10:30
Ryan Wendland
f2a6af05b1 ohci: Add ability to separate physical and virtual memory 2023-02-18 10:48:38 +10:30
Ryan Wendland
f87262185e ohci: Set skip on ed prior to removal 2023-02-18 10:24:21 +10:30
Ryan Wendland
cc9c3feeae ohci: Fix bug in ed removal 2023-02-18 10:24:21 +10:30
Ryzee119
e89e8ba392 ohci: Direct port commands to the correct rhport. 2023-02-18 10:24:21 +10:30
Ryzee119
5d3c0fb922 ohci: Force reset of devices already connected on power up 2023-02-18 10:24:21 +10:30
Ryzee119
c1d0fd1bd7 ohci: Wait POTG time after port power 2023-02-18 10:24:21 +10:30
Ryzee119
2063ee5f15 ohci: Toggle frameinterval bit on update 2023-02-18 10:24:21 +10:30
Ryzee119
d5e6d02817 ohci: Leave SMM or bios mode during init 2023-02-18 10:24:21 +10:30
Ryzee119
c820c87692 ohci: Support configurable number of roothub ports 2023-02-18 10:24:21 +10:30
Ryzee119
d367e8f8a8 ohci: Expand roothub descriptors into unions 2023-02-18 10:24:21 +10:30
PanRe
3342635237
Merge pull request #1825 from HiFiPhile/mic_test
Minor audio_test example fix.
2023-02-16 11:59:44 +01:00
HiFiPhile
9e16e904ed
Merge pull request #1853 from NullMember/master
examples/uac2: Fix mute and volume array lengths
2023-02-16 11:22:52 +01:00
Ha Thach
6b4838cb2f
Merge pull request #1910 from rppicomidi/fix-1909
Fix issue 1909
2023-02-16 17:06:22 +07:00
rppicomidi
fde7577117 Fix issue 1909 2023-02-15 20:02:12 -08:00
Ha Thach
e3be8a0a15
Merge pull request #1906 from hathach/update-pio-pico-usb
update pico-pio-usb to include data pid fix (0.5.1)
2023-02-14 16:51:56 +07:00
hathach
95acf3960d update pico-pio-usb to include data pid fix (0.5.1) 2023-02-14 16:11:33 +07:00
Ha Thach
d87f4da6b1
Merge pull request #1893 from jefftrull/bugfix/bitfields
Adjust reserved bitfields to make SDCC happy
2023-02-13 16:30:01 +07:00
Ha Thach
09e70ebd13
Merge pull request #1885 from kripton/fixDHCPServerDoS
dhserver: Fix a potential DoS vulnerability accidentially introduced by #1712
2023-02-13 15:11:44 +07:00
Ha Thach
ac60a03ea9
Merge pull request #1901 from hathach/add-metro-rt1011
Add metro rt1011
2023-02-13 14:58:42 +07:00
hathach
fbf99b8e53 forget to add metro 1011 linker 2023-02-13 13:33:03 +07:00
hathach
fb5fd22c73
add uf2 linker for metro m7 1011 2023-02-13 12:29:31 +07:00
hathach
49c621d510
fix typo 2023-02-13 12:04:33 +07:00
hathach
3e86f0532a fix release trigger body 2023-02-13 12:03:09 +07:00
hathach
105f108661 add metro m7 1011 board def (not running yet) 2023-02-13 12:03:09 +07:00
Ha Thach
002ca345b8
Merge pull request #1898 from ccrome/fix-imx1011
Turn data cache on
2023-02-13 12:01:39 +07:00
Jeff Trull
7e2c5fcc8a Correct bitfields for cdc_desc_func_telephone_call_state_reporting_capabilities_t 2023-02-12 20:52:17 -08:00
caleb crome
ec26c6163c Turn data cache on
This fixes https://github.com/hathach/tinyusb/issues/1894.  I'm not really
sure if this is the correct way to fix it, and I have not tested on all the
rest of the family members, however, this lets the i.MX1010 work again.

The problem:  the latest SDK update does not enable the data cache by default
This causes an assert in board_init() when attemping to control clock
gating.  I haven't investigated further as to *why* it's a problem, but it
is a problem.
2023-02-12 11:24:21 -08:00
Jeff Trull
f48ae4aad7 Adjust reserved bitfields to make SDCC happy
- keep each field at or under 16b
- For optimal packing, segment fields to 8b boundaries
2023-02-10 15:54:04 -08:00
Ha Thach
86c416d4c0
Merge pull request #1890 from hathach/release-0.15.0
update version to 0.15.0
2023-02-10 17:39:04 +07:00
hathach
f0ab6d824e
increase hw test timeout to 10s since pyocd seems to take longer to flash 2023-02-10 15:41:48 +07:00
hathach
39a37d82ce
change rp2040 hw test to use pyocd for better stability/performance than openocd 2023-02-10 14:56:32 +07:00
hathach
cf162e2c54
fix typo 2023-02-10 13:03:43 +07:00
hathach
7e48da5b44
update version to 0.15.0
add changelog
2023-02-10 12:47:48 +07:00
Graham Sanderson
c0d79457f6
Merge pull request #1887 from hathach/rp2040-build-fixes
RP2040 build fixes
2023-02-06 16:06:36 -06:00
graham sanderson
8d3f0ffb95 * don't force dependency on pico-pio-usb submodule
* suppress compiler warning/errors especially in pico-pio-usb
* disable use of pico-pio-usb on gcc 11.3+ for now as it doesn't compile
2023-02-06 10:07:39 -06:00
Ha Thach
792b552c5c
Merge pull request #1884 from hathach/reapply-uint16-len-tud_hid_report_complete_cb
change length in tud_hid_report_complete_cb() from uint8 to uint16
2023-02-06 09:08:46 +07:00
Jannis Achstetter
830849211d
dhserver: Fix a potential DoS vulnerability accidentially introduced by #1712 2023-02-04 22:37:39 +01:00
hathach
3422e05684
change length in tud_hid_report_complete_cb() from uint8 to uint16 2023-02-04 11:43:23 +07:00
Ha Thach
4c03a9f855
Merge pull request #1880 from hathach/reduce-selfed-host-iar
Bundle mulitple familes for self-hosted iar to reduce build time
2023-02-01 20:10:01 +07:00
hathach
1727702217
add note for iar workflow 2023-02-01 19:30:32 +07:00
hathach
647fd030ff merge multiple matrix with IAR build 2023-02-01 18:45:50 +07:00
hathach
3846da69d3 run workflow if its yml is updated 2023-02-01 16:37:24 +07:00
hathach
6ec0537408 move hw-stm32l412nucleo-test into build-arm to reduce self-host compile time
reduce IAR build to only f0, h7, l4
2023-02-01 15:14:35 +07:00
Ha Thach
d6354a2aa7
Merge pull request #1877 from hathach/fix-host-cdc-without-iad
Fix host cdc without iad
2023-02-01 11:18:04 +07:00
Ha Thach
49628d8c18
Merge pull request #1779 from P33M/rp2040_device_babble_fix
rp2040: avoid device-mode state machine hang
2023-01-31 21:38:27 +07:00
hathach
ddb061f639 fix typos 2023-01-31 19:03:31 +07:00
hathach
9b6d6a983a fix typo issue #1859 2023-01-31 18:42:02 +07:00
hathach
5f4701bb3e added fuzzing status 2023-01-31 18:40:49 +07:00
hathach
95403ed9ac fix host issue when mounting an CDC device without IAD 2023-01-31 18:40:07 +07:00
hathach
6759721e9a move errata to end of c file 2023-01-31 17:38:27 +07:00
hathach
19b6cbc616 add e15 prefix or walkaround related functions, also minor refactor 2023-01-31 17:15:42 +07:00
hathach
0cce42fcc6 minor clean up 2023-01-31 11:38:15 +07:00
Ha Thach
b03a688b24
Merge pull request #1768 from ftdigdm/port-ft90x
Port ft90x
2023-01-30 22:13:14 +07:00
Ha Thach
7166bb3643
Merge pull request #1876 from hathach/support-iar
Support iar build
2023-01-30 22:05:21 +07:00
hathach
25603c7269 iar L4 2023-01-30 20:11:59 +07:00
Gordon McNab
770de31dd9 Merge branch 'port-ft90x' of https://github.com/ftdigdm/tinyusb into port-ft90x 2023-01-30 11:51:51 +00:00
Gordon McNab
06079dcae1
Merge branch 'hathach:master' into port-ft90x 2023-01-30 11:49:05 +00:00
Ha Thach
8681dbb7a2
Merge pull request #1870 from DRNadler/WindowsBuildFix
Windows build fix for some mingw gnu make situations
2023-01-30 17:23:50 +07:00
hathach
39eb1ce70e minor clean up 2023-01-30 17:21:48 +07:00
hathach
63a6fd3689 iar g4 2023-01-30 17:07:06 +07:00
Gordon McNab
c07fb9a71e Merge branch 'port-ft90x' of https://github.com/ftdigdm/tinyusb into port-ft90x 2023-01-30 10:06:55 +00:00
hathach
b464f91a6e iar h7 2023-01-30 17:04:39 +07:00
Gordon McNab
63e6aea5ac Removed unrequired header file from debugging. 2023-01-30 10:04:34 +00:00
hathach
6257123157 Merge branch 'master' into support-iar 2023-01-30 16:44:22 +07:00
hathach
cc18784479 hardcoded configPRIO_BITS for IAR build to pass CI 2023-01-30 16:42:56 +07:00
hathach
6dd40603f9 fix typo 2023-01-30 11:46:52 +07:00
Ha Thach
88f3279c3c
Merge branch 'master' into port-ft90x 2023-01-30 11:40:53 +07:00
Ha Thach
00c007ed68
Merge pull request #1866 from DRNadler/mimxrt1024_evk
Add support for NXP's mimxrt1024_evk evaluation board.
2023-01-30 11:18:10 +07:00
hathach
11384159e1 suppress rt1024 warnings and fix typo 2023-01-30 10:16:57 +07:00
Ha Thach
778b62df81
Merge pull request #1875 from silvergasp/seed_corpus
feat(fuzz): Adds seed corpus for cdc and msc classes
2023-01-30 09:53:28 +07:00
Ha Thach
718e7342b1
Merge pull request #1872 from kasjer/kasjer/nucleoh723
Add support for nucleo-h723zg
2023-01-30 09:50:53 +07:00
Nathaniel Brough
02f1f05697 feat(fuzz): Adds seed corpus for cdc and msc classes 2023-01-29 09:38:05 -08:00
Jerzy Kasenberg
42230df71a Add support for nucleo-h723zg
Mostly copy of stm32h743nucleo.
Linker script generated by STM32CubeIDE.

Since this device has only one HS USB
board.h contains few defines that map on
board HS USB to FS because there is no
ULPI chip mounted on Nucleo board.

For FreeRTOS build:
Set interrupt priority for HS always and for FS if exists.
2023-01-26 12:53:03 +01:00
Jerzy Kasenberg
ba017d0669 boards/stm32h7 update gpio clocks
GPIOE was turned on twice, changed to missing GPIOF.
GPIOI is not present on all boards notably STM32H723
so clock in turned on only if present.
2023-01-26 12:02:07 +01:00
Jonathan Bell
0d2078d295 rp2040: shuffle hw_endpoint members
Ordering by element size prevents alignment holes, and as a consequence the
host mode version of the struct is the same size as device, as pad bytes at
the end are used instead.
2023-01-24 12:05:32 +00:00
Jonathan Bell
73b0047efc rp2040: avoid device-mode state machine hang
Don't mark IN buffers as available during the last 200us of a full-speed
frame. This avoids a situation seen with the USB2.0 hub on a Raspberry
Pi 4 where a late IN token before the next full-speed SOF can cause port
babble and a corrupt ACK packet. The nature of the data corruption has a
chance to cause device lockup.

Use the next SOF to mark delayed buffers as available. This reduces
available Bulk IN bandwidth by approximately 20%, and requires that the
SOF interrupt is enabled while these transfers are ongoing.

Inherit the top-level enable from the corresponding Pico-SDK flag.
Applications that will not use the device in a situation where it could
be plugged into a Pi 4 or Pi 400 (for example, when directly connected
to a commodity hub or other host) can turn off the flag in the SDK.

v2: use a field in hw_endpoint to mark pending.

v3: Partial rewrite following review comments

- Stub functions out if the workaround is not required
- Only force-enable SOF while any vulnerable endpoints are active
- Respect dcd_sof_enable() functionality
- Get rid of all but necessary ifdef hackery
- Fix a bug where the "endpoint lock" was used with an uninitialised pointer.
2023-01-24 11:53:28 +00:00
hathach
df2ebe5d1a add iar --fpu option 2023-01-24 12:57:07 +07:00
Jonathan Bell
c3e47c31cc rp2040: export hw_endpoint_start_next_buffer() and hw_endpoint_lock_update()
The next change to the driver requires the export of these functions. Leave the
lock unimplemented for now.

Also move hw_set and hw_clear aliases into the top-level header file.
2023-01-23 10:55:20 +00:00
Dave Nadler
9b6ef4fcbc When tools/top.mk finds it is running on Windows, it expects SHELL set to cmd.exe.
Some Windows development environments invoke a mingw version of gnu make
with SHELL set to /bin/sh or /bin/bash (either explicitly or by default),
in which case tinyUSB make fails when a $(shell...) command feeds DOS syntax to sh.
We can't just use sh, as many Windows environments won't have unix utilities
like realpath (used by this makefile for sh shell commands).

This fix forces SHELL=cmd.exe on Windows and documents the issue.
Also adds additional documentation to help the next person...

With this fix, tinyUSB can be easily built and debugged in environments like
NXP's MCUxpresso (import as a makefile project).
2023-01-22 12:11:50 -05:00
hathach
0a4e611e37 update stm32f7 to build with iar 2023-01-22 12:11:01 +07:00
hathach
db36075721 update f4 to build with iar 2023-01-22 11:56:50 +07:00
hathach
f4c3f0800d add test_common_func.c 2023-01-21 17:47:40 +07:00
hathach
436cd5b9b8 add icf for f1 mini2 2023-01-21 14:26:46 +07:00
hathach
1bbeb6ad79 update stm32f1 to support iar build 2023-01-21 11:32:37 +07:00
Nathaniel Brough
18c3095346 fix: Change all static variables to thread when fuzzing 2023-01-20 15:45:31 -08:00
Dave Nadler
a6e0b598fa Add support for NXP's mimxrt1024_evk evaluation board.
Tested AOK with device\cdc_msc_freertos example.
2023-01-20 13:15:42 -05:00
Dave Nadler
456a8b208b Add support for NXP's mimxrt1024_evk evaluation board.
Tested AOK with device\cdc_msc_freertos example.
2023-01-20 12:59:45 -05:00
hathach
cb34cb2a93 slightly update rule.mk for IAR 2023-01-20 15:56:32 +07:00
hathach
daec3c24d8 fix warnings with arithmetic on void* pointer 2023-01-20 15:30:45 +07:00
hathach
074289caa3 add helper tu_desc_find/find2/find3 2023-01-20 15:30:24 +07:00
hathach
3fd075b48b fix warning 2023-01-20 15:29:23 +07:00
Ha Thach
ea098aeda1
Merge pull request #1847 from HiFiPhile/dwc2_iar
dwc2: fix iar warnings
2023-01-18 17:41:33 +07:00
hathach
84be70baf5 fix iar build with board_test 2023-01-18 13:17:53 +07:00
hathach
075095554a dont use non-std strncasecmp 2023-01-18 11:47:24 +07:00
hathach
fb7122f07d update iar ci 2023-01-18 10:33:26 +07:00
hathach
ecfd57e6f1 get most examples build with iar 2023-01-18 10:31:00 +07:00
Howard Su
eb7aacb51f Allow config OS for RP2040 2023-01-18 02:30:05 +00:00
hathach
8df2fd1916 update freertos example to build with iar 2023-01-17 23:38:10 +07:00
hathach
c86e628a4c update build script to support iar with CC=iccarm option 2023-01-17 23:37:00 +07:00
hathach
1891802f08 update all f0 board to build with iar 2023-01-17 16:38:02 +07:00
hathach
c414cc650e try running iar build with self-host 2023-01-17 16:30:33 +07:00
hathach
3fee8b402e update makefile to support iar build starting with stm32f070 2023-01-17 16:20:04 +07:00
Nathaniel Brough
2e47210c1a fix: Replace device calls to memcpy with tu_memcpy_s
Introduces a new function tu_memcpy_s, which is effectively
a backport of memcpy_s. The change also refactors calls
to memcpy over to the more secure tu_memcpy_s.
2023-01-13 15:20:32 -08:00
Malik Enes Safak
546dd6038c examples/uac2: Fix mute and volume array lengths 2023-01-13 18:28:10 +03:00
Ha Thach
fa9d19027b
Merge pull request #1405 from gregdavill/ch32v307
Add WCH CH32V307 port
2023-01-12 17:51:56 +07:00
hathach
b1021d53f3 add TUP_RHPORT_HIGHSPEED for ch32v307 2023-01-12 15:38:18 +07:00
hathach
160d64b00a minor clean up. ch32v307 has issue with uart LOG=2 (skipping characters) 2023-01-12 15:34:29 +07:00
hathach
3cf21c66b6 add dcd_remote_wakeup() stub 2023-01-12 15:26:48 +07:00
hathach
f05f81e8b3 add button support 2023-01-12 15:19:26 +07:00
hathach
65f7a8006c rename board to lower case ch32v307v-r1-1v0 2023-01-12 13:31:36 +07:00
hathach
e6a3cfb350 rename link file 2023-01-12 13:12:37 +07:00
hathach
658897cf4e fix redundant-decls warnings with USART_Printf_Init() 2023-01-12 12:30:18 +07:00
hathach
e61d4aefe6 rename driver with dcd_ to be consitent with other ports 2023-01-12 12:08:56 +07:00
hathach
3cc6cece07 add note for openocd with wch, also add wch-riscv.cfg 2023-01-12 10:25:48 +07:00
MasterPhi
9d19ed940e dwc2: fix IAR warnings. 2023-01-11 18:50:38 +01:00
Ha Thach
4ee4c6f594
Merge pull request #1844 from silvergasp/master
feat(ci): Adds oss-fuzz integration on PRs
2023-01-11 09:20:27 +07:00
Nathaniel Brough
abb95fc4b3 feat(ci): Adds oss-fuzz integration on PRs 2023-01-09 13:07:03 -08:00
Ha Thach
8775d55adc
Merge pull request #1843 from HiFiPhile/ip3511
ip3511 : Fix IAR build.
2023-01-09 10:02:59 +07:00
MasterPhi
57de6016f9 ip3511 : Fix IAR build. 2023-01-08 11:23:18 +01:00
hathach
a7e1de1e83
temporarily suppress redundant-decls due to USART_Printf_Init()
fix codespell
2023-01-08 00:02:25 +07:00
Ha Thach
949950e592
Merge branch 'master' into ch32v307 2023-01-07 23:46:46 +07:00
Ha Thach
83cc71feaf
Merge pull request #1820 from Staacks/master
Fix UVC probe and commit on MacOS
2023-01-07 23:30:30 +07:00
Ha Thach
79e5d7aa69
Merge pull request #1789 from hathach/fix-fifo-memory-overflow
Fix fifo memory overflow
2023-01-07 20:42:19 +07:00
hathach
c84de8f06b
minor clean up 2023-01-07 19:40:06 +07:00
hathach
9e551c9f5c
remove _ff_overflowed() due to lack of use 2023-01-07 19:00:04 +07:00
hathach
c29b7643a5
simplify _ff_correct_read_index() 2023-01-07 18:53:00 +07:00
hathach
248025bb6c
reverse idx2ptr() arguments to be consistent 2023-01-07 17:29:43 +07:00
hathach
24bd1c9562
update advance_pointer/backward_pointer to use depth instead of fifo, also rename to advance/backward_index 2023-01-07 17:27:26 +07:00
hathach
507d5b10b0
simplify _tu_fifo_count() and _tu_fifo_remaining(), also rename to _ff_count() and _ff_remaining() 2023-01-07 17:14:17 +07:00
hathach
a804a1ac09
simplify and remove _tu_fifo_empty, _tu_fifo_full. Also correct full condition check 2023-01-07 16:48:07 +07:00
hathach
2d7849282a
use TU_FIFO_INIT to replace TU_FIFO_DEF 2023-01-07 16:33:11 +07:00
hathach
e885ced0fe
using clang with ceedling unit-test with -fsanitize=address 2023-01-07 16:24:05 +07:00
hathach
82457519fa minor clean up 2023-01-07 16:12:35 +07:00
hathach
2a1b81e3c5 minimize tu_fifo size to 16
- remove non_used_index_space
- packed overwritable with item_size
2023-01-06 11:51:17 +07:00
hathach
9c73c1a532 minor clean up 2023-01-06 10:56:19 +07:00
hathach
b42d298b81 Merge branch 'master' into fix-fifo-memory-overflow 2023-01-06 10:52:25 +07:00
Ha Thach
6e23c596cc
Merge pull request #1837 from pete-pjb/master
Fix typo in audio.h. Specifiy _ctrl_xfer struct in CFG_TUSB_MEM_SECTION in usbh.c
2023-01-06 10:24:55 +07:00
Ha Thach
cde16b802b
Merge pull request #1836 from HiFiPhile/Pe381
Fix IAR warning: Warning[Pe381]: extra ";" ignored
2023-01-06 09:10:11 +07:00
Mengsk
8db462bf6e Add fix to dcd_edpt_iso_activate() 2023-01-05 16:54:42 +01:00
Simon Kueppers
d6b612257e Fixed bug where with some devices, the TU_ASSERT inserted with this commit gets triggered for ISOCHRONOUS endpoints. It is necessary for those endpoints to set the NUM_BLOCK and BLSIZE for the receiving buffer in both, USB_COUNTn_TX and USB_COUNTn_RX. Despite the datasheet showing those fields only for the USB_COUNTn_RX register 2023-01-05 16:23:53 +01:00
Mengsk
8c591e2c45 More warning fixes 2023-01-04 12:40:01 +01:00
Ha Thach
18043131d0
Merge pull request #1823 from silvergasp/fix_cluster_fuzz_flags
fix(fuzz): Make sanitizer flags optional
2023-01-04 13:44:33 +07:00
pete-pjb
f5cffeedec Fix typo in audio.h. Specifiy _ctrl_xfer struct in CFG_TUSB_MEM_SECTION
Add NULL check to loop in list_remove_qhd_by_addr() function in ehci.c
2023-01-03 10:33:36 +00:00
Mengsk
82f105e32b Fix IAR warning: Warning[Pe381]: extra ";" ignored 2023-01-02 21:18:10 +01:00
Mengsk
69475cd1bf Remove tu_stm32_sof_cb 2023-01-02 12:06:26 +01:00
Mengsk
7228239eb9 Clean up. 2023-01-02 09:43:48 +01:00
Mengsk
51bb27a131 Optimize descriptor looping. 2022-12-31 13:37:22 +01:00
Mengsk
35fa6b660a Fix CI. 2022-12-30 16:10:54 +01:00
Mengsk
fc32280f42 Fix buffer allocation overflow. 2022-12-30 15:10:00 +01:00
Mengsk
7ff2f43bfd Add multi-rate audio test example for new ISO buffer allocation. 2022-12-30 15:09:50 +01:00
Mengsk
21bdafcfef Add ISO buffer allocation. 2022-12-30 01:08:04 +01:00
Mengsk
07ad64adfe Do not set USB_EP_RX_NAK for ISO EP. 2022-12-29 23:30:24 +01:00
Mengsk
db65759b1e Use weak for dcd_edpt_iso_alloc/dcd_edpt_iso_activate 2022-12-29 23:29:50 +01:00
Mengsk
0bd41d5354 Fix CI. 2022-12-29 21:37:44 +01:00
Mengsk
e4f07206f8 UAC : Enable fifo based transfer on stm32_fsdev 2022-12-29 19:34:12 +01:00
Mengsk
fe8c170c98 Add dcd_edpt_iso_alloc() / dcd_edpt_iso_activate() for ISO EP buffer management. 2022-12-29 19:19:27 +01:00
Mengsk
8a1184e7b3 Minor audio_test example fix.
Fix CFG_TUD_AUDIO_EP_SZ_IN size.
2022-12-29 14:34:37 +01:00
Mengsk
cece59df22 Generally enable ISO xfer. 2022-12-29 12:33:44 +01:00
Mengsk
ef2f17a514 Add hardware endpoint allocator. 2022-12-29 12:33:43 +01:00
Mengsk
b156a8b78c dcd_stm32_fsdev : Implement FIFO transfer correctly. 2022-12-29 12:33:43 +01:00
Mengsk
17990025bb dcd_stm32_fsdev : Fix index out of bound in dcd_write_packet_memory()
If src is odd then src[wNBytes] is accessed.
2022-12-29 12:33:43 +01:00
Simon Kueppers
1d37f5ef9b Added improvements with regards to SOF timing jitter 2022-12-29 12:33:16 +01:00
Simon Kueppers
76413a95d4 Added TU_ATTR_ALWAYS_INLINE to all static inline functions 2022-12-29 12:29:47 +01:00
Simon Kueppers
9ec21248d7 Fixed various small problems and inaccuracies regarding ISOCHRONOUS endpoint 2022-12-29 12:29:47 +01:00
Mengsk
b4b619abd6 SHA-1: 5cb3ed518301e2237ee4e468e97e51ece0ba3838
* Correct handling of SOF interrupt
2022-12-29 12:29:28 +01:00
Mengsk
8327090171 Merge branch 'master' of https://github.com/hathach/tinyusb into stm32_fsdev 2022-12-29 12:14:52 +01:00
Simon Kueppers
d584b07e2c Fixed problem where the transmit byte count was written into the wrong register on ISOCHRONOUS endpoints 2022-12-29 12:13:56 +01:00
Simon Kueppers
510720b396 Renamed pcd_set_ep_rx_cnt because it actually sets the maximum buffer size 2022-12-29 12:13:56 +01:00
Simon Kueppers
9a84390878 Changed comments, added define to fail if ISOCHRONOUS endpoint is not available but requested 2022-12-29 12:13:56 +01:00
Simon Kueppers
ec826732fc Fixed non-aligned allocated memory sizes 2022-12-29 12:13:56 +01:00
Simon Kueppers
abf53f9270 Changed indirection from actual endpoint address to hardware endpoint through lookup table. Allocation of endpoint is now only performed in dcd_edpt_open 2022-12-29 12:13:56 +01:00
Simon Kueppers
8c0388f477 Fixed wrongly enabling RX and TX status simultaneously on ISOCHRONOUS endpoints 2022-12-29 12:13:56 +01:00
Simon Kueppers
d9b2c9934a Implemented an optional callback function that is used instead of tu_edpt_number in the stm32 device driver as a crude tool to control mapping of the endpoint address to actual endpoint register 2022-12-29 12:13:56 +01:00
Simon Kueppers
6d65eaf7a1 Implemented very rudimentary support for isochronous transfer buffer handling 2022-12-29 12:13:55 +01:00
Nathaniel Brough
1dcffc655d fix(fuzz): Make sanitizer flags optional
Currently OSS fuzz expects to have complete control over the
sanitizer flags. As we currently have these set it's causing
problems with the OSS fuzz build. Instead we should use the
provided variables from the OSS fuzz build environment. For
local testing we'll create a set a well defined defaults.
2022-12-28 21:07:29 +00:00
Staacks
95ba158a10 Fix UVC probe and commit on MacOS 2022-12-27 23:02:33 +01:00
Ha Thach
549bee94ad
Merge pull request #1819 from hathach/fix-ncm-warning
fix ncm warning
2022-12-27 19:02:57 +07:00
hathach
d0ca6ca8f7
fix ncm warning 2022-12-27 18:21:56 +07:00
Ha Thach
301b6af6c6
Merge pull request #1801 from tyustli/tyustli_sem_reset
[add] semaphore reset support for rt-thread
2022-12-26 13:09:47 +07:00
Ha Thach
4b5880671c
Merge pull request #1814 from hathach/more-host-cdc
add tuh_cdc_peek()
2022-12-25 00:50:18 +07:00
hathach
48d4a67ec5
add tuh_cdc_peek() 2022-12-24 01:11:13 +07:00
Ha Thach
48f4d8b7f7
Merge pull request #1810 from hathach/fix-cdc-buf
fix incorrect rx buf in cdc
2022-12-22 22:34:20 +07:00
hathach
15a02d04df
fix incorrect rx buf in cdc 2022-12-22 21:35:55 +07:00
Ha Thach
2777df411f
Merge pull request #1809 from hathach/host-cdc
Support Host CDC
2022-12-22 21:29:00 +07:00
hathach
396716cc2c
clean up 2022-12-22 20:26:32 +07:00
hathach
f33883c308
add tuh_cdc_get_local_line_coding() 2022-12-22 19:41:39 +07:00
hathach
14d45b580e
correct host cdc enum 2022-12-22 19:17:09 +07:00
hathach
05c119ce97
cdc host, add set line coding API 2022-12-22 18:28:06 +07:00
hathach
11233e4d3e
minor clean up 2022-12-22 11:43:57 +07:00
hathach
c99af908f1
fix typo 2022-12-22 11:41:27 +07:00
hathach
2d536123c8
finish moving edpt stream to tusb.c 2022-12-22 11:31:37 +07:00
hathach
e3c9d94500
fix stream read count computation 2022-12-22 11:16:39 +07:00
hathach
8323e4b79a
moving edpt_stream API into common tusb.c 2022-12-22 08:52:01 +07:00
hathach
9e8ea44925 add tuh_cdc_write_clear, rename read_flush() to read_clear() 2022-12-21 17:49:50 +07:00
hathach
cd9008e5a9 add tuh_cdc_tx_complete_cb() callback 2022-12-21 13:05:45 +07:00
hathach
84a483f5ea add more host cdc API
tuh_cdc_write_available(), tuh_cdc_read_flush(), tuh_cdc_rx_cb()
callback
2022-12-21 12:47:00 +07:00
hathach
edc559cb4d fix ci 2022-12-21 12:29:51 +07:00
hathach
badb30a6c3 correct cdc host app 2022-12-21 12:25:13 +07:00
hathach
22b62f8712 add tu_edpt_stream_write_zlp_if_needed() 2022-12-21 12:07:12 +07:00
hathach
76021c7359 rename tud_edpt_stream_write_xfer 2022-12-21 11:49:28 +07:00
hathach
b3e63c335a updat cdc host app 2022-12-21 11:47:07 +07:00
hathach
cb2af4c0bc minor debug log 2022-12-21 11:46:58 +07:00
hathach
d1ea3844f7 rename TU_LOG_VAR to TU_LOG_PTR, print out setup of failed control transfer when LOG=1 2022-12-21 11:04:57 +07:00
hathach
37529c41da fix ci 2022-12-21 10:46:47 +07:00
hathach
854e5222ae finalizing cdc host, has a working read/write
TODO: first character seems not to get echoed. set control line state
seems to failed with LOG < 2
2022-12-21 00:26:46 +07:00
Ha Thach
97984b4203
Merge pull request #1803 from jbruneaux31/patch-1
Update osal_freertos.h to fix FreeRTOS wrong task switch
2022-12-20 18:34:04 +07:00
hathach
7004914d8c fix hid host incorrect edpt release if failed to transmit
add CDC_CONTROL_LINE_STATE_DTR/RTS, TUSB_INDEX_INVALID enum
2022-12-20 12:06:59 +07:00
jbruneaux31
a46ad8fcdf
Update osal_freertos.h
Fix FreeRTOS task switch even if not required (unitialized variable usage)
2022-12-19 13:58:54 +01:00
tyustli
e992ff46d2
Update osal_rtthread.h 2022-12-19 17:25:35 +08:00
tyustli
7d76c172db
[add] semaphore reset support for rt-thread
add  semaphore reset support for rt-thread
2022-12-19 17:18:47 +08:00
hathach
fc9321ce26 correct cdc usbh_driver_set_config_complete() 2022-12-16 23:54:21 +07:00
hathach
4811b3463f stub 2022-12-16 17:08:37 +07:00
hathach
bd1f7f86ce add common EPSIZE for bulk/iso in full and highspeed
adding cdc host fifo tx/rx
2022-12-16 17:08:37 +07:00
hathach
f62f973956 minor rename 2022-12-16 17:08:37 +07:00
hathach
f0c51eae44 cdc check for bNumEndpoints before checking for endpoint descriptor 2022-12-16 17:08:37 +07:00
hathach
4f03695084 adding tuh_cdc_mount_cb/tuh_cdc_umount_cb
start adding cdc_app.c to example
2022-12-16 17:08:37 +07:00
Ha Thach
159aa599be
Merge pull request #1799 from hathach/update-osal-mutex
Update osal mutex
2022-12-16 17:05:25 +07:00
hathach
660343d200 update fifo per PanRe review 2022-12-16 16:55:25 +07:00
hathach
1e99480ad2 fix ci with usbh and unit test 2022-12-16 15:19:40 +07:00
hathach
96d2be905b fix build with usbtmc 2022-12-15 18:47:54 +07:00
hathach
88e6da7273 use OSAL_MUTEX_REQUIRED to replace CFG_FIFO_MUTEX/TUSB_OPT_MUTEX
add macro to swallow mutex API in order to simplify code with mutex
2022-12-15 18:03:01 +07:00
Gordon McNab
9f440e5c69 Update SDK for FT9xx to include 3rdparty sources 2022-12-15 10:27:49 +00:00
Ha Thach
ab18b8794f
Merge pull request #1797 from hathach/fix-midi-len
fix midi MS Header wTotalLength computation
2022-12-14 16:24:42 +07:00
hathach
a05adfce86 fix midi MS Header wTotalLength computation 2022-12-14 14:38:40 +07:00
Louis Burda
9e7e8908a3 Fix ifdefs for disabled uart stdio in rp2040 family 2022-12-13 11:00:03 +01:00
hathach
04a5c03ea8 fix int conversion warnings 2022-12-12 11:54:33 +07:00
hathach
ce064de6fd clean up 2022-12-10 00:18:11 +07:00
hathach
82852774a7 add fifo implementation note
- handle/fix double overflowed with write()
- other minor clean upp
2022-12-09 18:20:09 +07:00
hathach
75989673e5 add test_write_double_overflowed for fifo 2022-12-09 15:39:57 +07:00
Ha Thach
f4f85bad54
Merge pull request #1783 from scoudreau/usbtmc-high-speed
usbtmc: correct packet size bug
2022-12-09 09:52:23 +07:00
Ha Thach
ec2902bd3f
Merge pull request #1784 from scoudreau/interrupt-descriptor-polling-interval
Correct interrupt polling interval in descriptor
2022-12-09 09:45:40 +07:00
scoudreau
007ed1f0fe
Added missing typecast to pass build checks 2022-12-08 14:50:34 +01:00
Sebastien COUDREAU
071da47944 Correct interrupt polling interval in descriptor
Use macro argument instead of 0x16 constant value.
At least Linux kernel was complaining about this value:
"config 1 interface 0 altsetting 0 endpoint 0x82 has an invalid bInterval 22, changing to 8"
(warning obtained using usbtmc device config)
2022-12-08 11:44:15 +01:00
Sebastien COUDREAU
15ab35d9b8 usbtmc: correct packet size bug
Code was only reading the first 64 bytes of a 512 bytes packet.
2022-12-08 11:35:32 +01:00
hathach
3e32fa36b8 enhance tu fifo
- rename wr/rd absolute to index, and rel to pointer.
- fix crash with _tu_fifo_remaining()
- change get_relative_pointer() to idx2ptr() and merge with _ff_mod()
2022-12-08 16:39:24 +07:00
hathach
bae7fe5be7 add test fifo overwritable + overflow, that cause buffer overflow 2022-12-08 13:10:24 +07:00
Ha Thach
d4620d99d3
Merge pull request #1716 from silvergasp/master
fuzz: Add support for fuzzing
2022-12-08 12:18:32 +07:00
hathach
c19bffb1d9 clean up 2022-12-08 11:48:53 +07:00
hathach
d0758d0733 correct ci paths filter 2022-12-08 11:47:01 +07:00
hathach
4deec2f4be fix ci 2022-12-08 11:40:43 +07:00
hathach
33ea178cd9 update build fuzzer step 2022-12-08 11:37:13 +07:00
hathach
ffd008dc75 update build fuzzer 2022-12-08 11:36:19 +07:00
hathach
bf8f4f9521 move build Fuzzer into pre-commit 2022-12-08 11:31:39 +07:00
hathach
86a3315bcf update fuzzer ci 2022-12-08 10:42:29 +07:00
hathach
56f846cf74 move fuzz into test/fuzz 2022-12-08 10:39:54 +07:00
hathach
19400c8556 fix typo, add -Wno-error=unreachable-code for fuzz due to latest cdc changes 2022-12-08 10:30:22 +07:00
Nathaniel Brough
6492f4a18d feat(fuzz): Adds net class fuzzer 2022-12-08 10:13:35 +07:00
Nathaniel Brough
9cc93e6d41 .github: Add fuzzer builder 2022-12-08 10:13:35 +07:00
Nathaniel Brough
92b5f2d2e8 fuzz: Add msc fuzz harness 2022-12-08 10:13:35 +07:00
Nathaniel Brough
aedae6201b fuzz: Add support for fuzzing
Adds support for fuzzing with basic cdc fuzzer.
2022-12-08 10:13:35 +07:00
Ha Thach
ab8cfb3d5b
Merge pull request #1781 from hathach/update-unit-test
Update unit test
2022-12-08 10:11:21 +07:00
hathach
a29b3dd690 update .codespell 2022-12-08 10:05:52 +07:00
hathach
34081f6c5c update ci 2022-12-08 10:00:25 +07:00
hathach
be4f4e4f79 move ceedling tests to test/unit-test 2022-12-08 09:59:02 +07:00
hathach
4b50ca2a61 add missing ceedling files 2022-12-08 09:54:15 +07:00
hathach
91d5fa5639 add paths to all workflows 2022-12-08 09:44:26 +07:00
hathach
a3827b87fe test ci paths 2022-12-08 09:30:42 +07:00
hathach
a652212f27 update ceedling to 0.31.1 2022-12-08 09:14:38 +07:00
Ha Thach
d9817ebe17
Merge pull request #1487 from tore-espressif/fix/cdc_autoflush
cdc: Fix autoflush for FIFO < MPS
2022-12-06 14:19:58 +07:00
Tomas Rezucha
603effbb77 cdc: Fix autoflush for FIFO < MPS 2022-12-06 07:49:26 +01:00
Ha Thach
f03c28ec31
Merge pull request #1776 from hathach/hid-fido
Hid fido
2022-12-05 14:32:49 +07:00
hathach
d58120647a rename to match fido sample uf2_hid..h 2022-12-05 13:18:05 +07:00
Ha Thach
71a5906865
Merge pull request #1767 from pete-pjb/master
Allow the use of non-static allocation for FreeRTOS mutexes & queues
2022-12-05 12:45:48 +07:00
hathach
de5a67bf3b clean osal_freertos, update freertos examples to work with configSUPPORT_DYNAMIC_ALLOCATION only
note: for example to build with configSUPPORT_STATIC_ALLOCATION = 0, one
of heap_n.c must be included in makefile/cmake
2022-12-05 12:09:41 +07:00
Ha Thach
279e2d6aeb
Merge pull request #1774 from hathach/add-codespell
Add codespell to ci run
2022-12-04 22:25:54 +07:00
hathach
feed1a83a9 add ignore-words to make it easier to 2022-12-04 21:28:30 +07:00
hathach
b37870c964 test exclude-file.txt, add action concurrency 2022-12-04 21:08:47 +07:00
hathach
b9314bddc5 check exclude file 2022-12-04 20:52:02 +07:00
hathach
e3df3ac5ce add codespell config and ci run 2022-12-04 20:29:24 +07:00
Ha Thach
d6d2499ad6
Merge pull request #1695 from hadess/wip/hadess/fix-typos
Fix typos
2022-12-04 20:26:59 +07:00
hathach
43b255f413 more typos 2022-12-04 19:44:01 +07:00
Bastien Nocera
6a2cf67289 Fix typos 2022-12-04 19:43:23 +07:00
pete-pjb
52261ac02d Back out another of my changes I am still investigating. 2022-12-02 10:13:35 +00:00
pete-pjb
3816869fce Some reverts and changes after discussion. 2022-12-02 10:00:19 +00:00
pete-pjb
c31b95c916 Added CFG_TUSB_MEM_SECTION define to struct _ctrl_xfer in usbh.c 2022-12-01 17:53:35 +00:00
PeterB
ae588d796e Alter tuh_task_ext() function so no need to return when using FreeRTOS 2022-12-01 16:06:15 +00:00
Ha Thach
f24f47d038
Merge pull request #1765 from hathach/rp2040-host-bulk-comment
Rp2040 host bulk comment
2022-12-01 10:10:40 +07:00
Gordon McNab
8cce9385e2 More configurable board options 2022-11-30 16:18:07 +00:00
pete-pjb
25abb10de1 Fix white space issue. 2022-11-30 13:26:59 +00:00
Gordon McNab
d3c4f66d35 Fix script issues with paths including spaces from env variable.
$(FT90X_TOOLCHAIN) or even $(TOP) may have spaces. Quote to fix.
2022-11-30 12:49:15 +00:00
Pete Bone
0ddd5591af
Merge branch 'hathach:master' into master 2022-11-30 13:43:45 +01:00
Gordon McNab
aceab1dcf3
Merge branch 'hathach:master' into port-ft90x 2022-11-30 12:16:52 +00:00
Gordon McNab
1437ad1dfb Add endpoint definitions for more example projects. 2022-11-30 12:15:27 +00:00
hathach
c9c7dfa868
more clean up 2022-11-30 18:59:58 +07:00
hathach
069215c538
white spaces 2022-11-30 18:58:30 +07:00
Gordon McNab
fe63e30a44 Add FT9xx for cdc_dual_ports
Fix handling of interrupt endpoints. i.e. no ZLPs.
Fix the assignation of endpoint types.
Add button support for MM900evx boards.
On board support do not block for UART input.
2022-11-30 11:46:13 +00:00
pete-pjb
d588167a39 Modify FreeRTOS integration to allow non-static allocation. 2022-11-30 11:33:24 +00:00
Ha Thach
2ae6a4d519
Merge pull request #1755 from rppicomidi/fix_1721
Fix RP2040 Issue 1721
2022-11-30 18:00:27 +07:00
Ha Thach
ff26714958
Merge pull request #1756 from benishor/master
Added board description for electro-smith daisy seed
2022-11-30 17:16:19 +07:00
Gordon McNab
7d8d3eca73 Fix transfers issues with FT9xx
Correct USB FIFO use for setup data phases (OUT transfers). We cannot stop traffic on the control endpoint so we set a flag and pull data from host when tinyUSB requests it from the USB FIFO. Extend this for all endpoints although currently not required.
Rename all instances of ft90x which can apply to ft93x as ft9xx.
Add support for the cdc_dual_ports example for ft9xx.
Add LED pin definition for board LED in a simple to access place on the Bridgetek MM900EVx boards.
2022-11-29 18:49:23 +00:00
Gordon McNab
1fce76ad47 Fix issue with the CDC SetLineCoding request
The SetLineCoding would fail as host would send the SETUP OUT phase before tinyUSB had setup a transaction for it. ft9xx port would ignore the transfer since there was no valid transaction setup for it. One SETUP data phase packet is cached now.
2022-11-28 17:41:00 +00:00
Ha Thach
52a9098b31
Merge pull request #1763 from hathach/host-retry-failed-enumeration-request
Retry a few times with transfers in enumeration since device can be unstable when starting up
2022-11-29 00:11:41 +07:00
hathach
be6f6f2c99 increase delay between attempts to 100ms 2022-11-28 23:43:52 +07:00
hathach
b2a3f33046 Retry a few times with transfers in enumeration since device can be unstable when starting up 2022-11-28 23:22:10 +07:00
hathach
5785467016 update pico-pio-usb submodule and its warnings suppress 2022-11-28 23:21:17 +07:00
Gordon McNab
9ccfb384e8 Update to v2.6.0 library 2022-11-24 12:17:55 +00:00
Adrian Scripca
8ef32617ba
Added board description for electro-smith daisy seed 2022-11-24 13:06:25 +02:00
rppicomidi
9825fbe9ac Fix RP2040 Issue 1721 2022-11-23 13:12:31 -08:00
Ha Thach
081e4eecba
Merge pull request #1750 from hathach/rework-host-msc-complete-callback
Rework host msc complete callback
2022-11-23 17:47:52 +07:00
hathach
7298923927 rework tuh_msc_complete_cb_t signature to use new tuh_msc_complete_data_t
add user arg to all scsi command API that support complete callback
2022-11-23 16:01:48 +07:00
hathach
21d552bbdf
allow all host examples to use pico-pio-usb for rp2040 2022-11-23 12:30:10 +07:00
Ha Thach
4a2e424103
Merge pull request #1746 from hathach/host-msc-example
Add host msc explorer example
2022-11-21 17:22:52 +07:00
hathach
a394273ed2
add board_getchar() for non-blocking getchar() 2022-11-21 16:28:54 +07:00
hathach
460bef9dbb
host msc example work well with rp2040 pio-usb 2022-11-21 15:49:38 +07:00
hathach
ba9f88f18c
suppress fatfs cast-qual 2022-11-21 12:33:31 +07:00
hathach
53677d4844
house keeping 2022-11-21 12:28:33 +07:00
hathach
64ecf43663
whitespace 2022-11-21 11:53:15 +07:00
hathach
cab65acc46
add pwd 2022-11-21 11:52:51 +07:00
hathach
51873cd1be
implement rm command 2022-11-21 11:24:58 +07:00
hathach
47bc269b50
fix build with rp2040 and rx65 2022-11-21 11:12:10 +07:00
hathach
2312bfe3c4
implement cp command 2022-11-20 16:40:15 +07:00
hathach
bf69ffb8f7
add mv command 2022-11-19 15:53:55 +07:00
hathach
daeaea9556
add mkdir 2022-11-19 15:37:23 +07:00
hathach
16e1838862
implement cat command 2022-11-19 15:27:07 +07:00
hathach
083ed364ba
add cd command 2022-11-19 13:56:33 +07:00
hathach
bb570e02d6
msc explorer ls work great 2022-11-19 13:44:07 +07:00
hathach
a6001fc8f2
update uart read for lpc18/43 for testing 2022-11-18 21:50:00 +07:00
Ha Thach
95fb11fcff
Merge pull request #1712 from kripton/fixDhserver
dhserver: Support DHCP clients that don't send the MESSAGETYPE as first option
2022-11-18 21:42:39 +07:00
hathach
b00529e287
add msc file explorer example
- add lib/fatfs version 15
- add lib/embedded-cli
2022-11-18 21:39:04 +07:00
Ha Thach
2dc7a62361
Merge pull request #1738 from kaysievers/midi-port-names
MIDI: support port name strings
2022-11-16 16:36:13 +07:00
Ha Thach
67cda9b7f9
Merge pull request #1740 from hathach/add-HiFiPhile-selfhost
Add hifiphile self-hosted
2022-11-16 15:34:05 +07:00
hathach
fc523733c1 more ci warnings 2022-11-16 11:16:40 +07:00
hathach
9b9d841770 fix other ci warnings 2022-11-16 11:11:26 +07:00
hathach
ba0f1a3be5 disable orphan board workflow and minor update to pi4 workflow 2022-11-16 11:01:54 +07:00
hathach
d17eb94e84 only print flash output if failed 2022-11-16 09:36:12 +07:00
hathach
a6d9fda5f9 skip usb msc test 2022-11-16 01:01:03 +07:00
hathach
2f909c284a more flash script 2022-11-15 23:47:24 +07:00
hathach
2fb0cea7e2 more test 2022-11-15 23:37:07 +07:00
hathach
468ec83c1b correct flash.sh creation 2022-11-15 23:07:58 +07:00
hathach
d8badc948f update yml 2022-11-15 18:13:19 +07:00
hathach
931b718289 try running HiFiPhile self-host with stm32l412nucleo 2022-11-15 18:10:41 +07:00
Ha Thach
6c6b7ee2bf
Merge pull request #1727 from HiFiPhile/bsp_412
Add support for STM32L412.
2022-11-15 16:15:09 +07:00
Kay Sievers
abfcdf2cfb MIDI: support port name strings
This allows to set custom descriptive names for virtual MIDI
ports/cables. A MIDI port offers different functionality on
the same physical USB device. The names make it easier to
distinguish one from the other.
2022-11-11 22:48:29 +01:00
Mengsk
da1589f116 Fix FREERTOS USB IRQ priority. 2022-11-08 21:58:51 +01:00
Mengsk
f3f3739073 Fix DCD build. 2022-11-07 13:38:35 +01:00
Mengsk
9d3d8fd5b0 Merge branch 'master' of https://github.com/hathach/tinyusb into bsp_412 2022-11-07 12:47:41 +01:00
Mengsk
1eae139aa9 Add support for STM32L412. 2022-11-07 12:32:36 +01:00
Ha Thach
e434a1dc05
Merge pull request #1718 from hfegran/efm32_freertos_port_fix
Fixed wrong FreeRTOS port for EFM32GG12
2022-11-07 00:05:51 +07:00
Ha Thach
187e57dc81
Merge pull request #1724 from hathach/add-self-host
Add self host
2022-11-07 00:00:44 +07:00
hathach
030b50dce3
final clean up 2022-11-06 23:19:34 +07:00
hathach
a0dc9008a7
remove trigger hardware step 2022-11-06 22:39:09 +07:00
hathach
5d13eb8e7a
move test_hardware into build_arm 2022-11-06 22:33:55 +07:00
hathach
ca4ae61c1c
use gh cli instead of action for workflow dispatch 2022-11-06 22:06:22 +07:00
Ha Thach
a97f6a4945
Merge pull request #1723 from hathach/fix-rp2040-minor
Fix rp2040 minor
2022-11-06 16:02:41 +07:00
hathach
fee90f353f bump up setup python action to v4 2022-11-06 15:17:00 +07:00
hathach
b920155444 minor clean up 2022-11-06 14:56:05 +07:00
hathach
a061bc4173 bump up pico-pio-usb 2022-11-06 14:46:44 +07:00
hathach
44e19aa3c7 rename PIO_USB_PIN_DP to PIO_USB_DP_PIN and change from 2 to 20 & moved to board.h
add support for  PIO_USB_VBUSEN_PIN and its state.
2022-11-06 14:44:56 +07:00
Ha Thach
9e9f331503
Merge pull request #1434 from Skyler84/rp2040-hcd-bulk
Rp2040 hcd bulk
2022-11-05 15:16:36 +07:00
hathach
cb0ca6151b remove CFG_TUSB_DEBUG from tinyusb_common_base 2022-11-04 17:08:02 +07:00
hathach
d2c9b8bcfb fix -wconversion-int and add minor comment 2022-11-04 16:14:35 +07:00
Ha Thach
b554c2ed83
Merge branch 'master' into rp2040-hcd-bulk 2022-11-04 15:42:50 +07:00
Henrik Fegran
38cdeb9e60 Fixed wrong FreeRTOS port for EFM32GG12 2022-11-03 20:23:27 +01:00
Jannis Achstetter
3f3f6eee1c
dhserver: Support DHCP clients that don't send the MESSAGETYPE as first option
Signed-off-by: Jannis Achstetter <kripton@kripserver.net>
2022-11-01 23:42:58 +01:00
Ha Thach
28f49c088b
Merge pull request #1698 from battlesnake/fix-attrs-on-struct-member
do not apply storage attributes to member of struct
2022-10-25 15:23:09 +07:00
Mark K Cowan
815c2cc995 keep alignment spec 2022-10-24 20:36:45 +03:00
Ha Thach
5b1b383d2a
Merge pull request #1676 from tswan-quasi/master
dcd_lpc_ip3511: isochronous support and endpoint accidental write fix
2022-10-24 19:08:58 +07:00
hathach
e3b7ed9ae9 use dummy for all ZLP for ip3511, fix lpc55 build with DEBUG=1 2022-10-24 18:43:21 +07:00
tswan-quasi
35e1a27c95 unused (void) cast 2022-10-21 15:06:30 -04:00
Ha Thach
bfcdef499a
Merge pull request #1690 from tore-espressif/fix/espressif/iso_transfers
esp: Fix Isochronous transfers
2022-10-22 00:34:38 +07:00
Mark K Cowan
4ec1643bdb do not apply storage attributes to member of struct 2022-10-20 22:46:21 +03:00
tswan-quasi
0b55047081 typo fix 2022-10-20 11:04:49 -04:00
tswan-quasi
fe4278554b dummy buffer only on EP0 OUT ZLPs 2022-10-20 11:02:57 -04:00
Ha Thach
55db123a85
Merge pull request #1696 from kasjer/kasjer/fix-stm32u5-submodules
stm32u5: Fix submodules paths
2022-10-20 16:12:28 +07:00
Jerzy Kasenberg
19208cd88d stm32u5: Fix submodules paths
Local paths were commited to submodule definitions
This just removes prefix for submodules path and name
2022-10-20 11:04:49 +02:00
Ha Thach
39be00975c
Merge pull request #1680 from LynnL4/port-stm32u5xx
Port stm32u5xx
2022-10-19 23:10:30 +07:00
Ha Thach
e79325adec
Merge pull request #1668 from kkitayam/add_support_for_mjpeg
Add support for MJPEG on UVC
2022-10-19 23:10:11 +07:00
Ha Thach
2cd4e27e98
Merge pull request #1523 from maddyaby/dcd_edpt_open
Allow more endpoint packet sizes for SAMD
2022-10-19 22:56:36 +07:00
Ha Thach
08a4988e99
Merge pull request #1691 from hadess/wip/hadess/fix-deps-typo
Fix typo in getting_started guide
2022-10-19 09:10:19 +07:00
Bastien Nocera
8f88ff559e Fix typo in getting_started guide
Fixes: 1234111 ("add get-deps target")
2022-10-18 15:14:45 +02:00
Tomas Rezucha
a49ca795af esp: Fix Isochronous transfers
On ESP32-S2/S3 ISO transfers must be configured for even or odd frame.

Closes https://github.com/hathach/tinyusb/issues/1382
2022-10-18 08:05:13 +02:00
hathach
3f45f37672
minor rename 2022-10-17 23:13:24 +07:00
gaoyichuan
3846d5f38c hid: add configurable report size for fido 2022-10-15 19:22:21 +08:00
gaoyichuan
2a520fb921 hid: add fido hid descriptor templates 2022-10-15 19:07:07 +08:00
Ha Thach
154821acc0
Merge pull request #1646 from battlesnake/feedback-prototype-fix
audio_device: prototype added for function referenced before use
2022-10-14 16:28:26 +07:00
tswan-quasi
2c1ff2673b (void) rhport for unused parameter 2022-10-13 11:48:30 -04:00
LynnL4
4238467b2d Add support for STM32U5 mcu 2022-10-13 17:39:42 +08:00
tswan-quasi
930c68278c double cast of pointer to remove error 2022-10-12 11:16:35 -04:00
kkitayam
53dc9d55b5 Fix pointer type to calculate streaming parameter 2022-10-12 20:41:03 +09:00
kkitayam
2c9b5ddff0 Rename descriptor macros for consistency 2022-10-12 20:07:22 +09:00
tswan-quasi
16f1554a03 lpc55s69 isochronous, dummy address for endpoint buffers to prevent accidental writes 2022-10-11 09:59:28 -04:00
LynnL4
8a89365bb2 Add stm32u5xx offical driver. 2022-10-11 13:50:11 +08:00
Ha Thach
a95fb36f72
Merge pull request #1623 from SudoMaker/master
Initial PIC32MM/MX & PIC24 support
2022-10-10 20:18:01 +07:00
Ha Thach
b75d44c3ae
Merge pull request #1664 from mingpepe/master
Fix typo for log in dcd_rp2040.c
2022-10-10 20:15:32 +07:00
kkitayam
aed8051f50 Add motion jpeg 2022-10-08 21:53:32 +09:00
kkitayam
4be7ffd63f Fix max payload size to clip at 1023 2022-10-07 21:30:03 +09:00
kkitayam
3499aa2b21 Fix pointer 2022-10-06 21:10:27 +09:00
ReimuNotMoe
8096afc6de Microchip PIC24/dsPIC33 device mode support 2022-10-06 03:45:51 +08:00
mingpepe
988eeb50c6
Fix typo for log in dcd_rp2040.c 2022-10-05 21:26:22 +08:00
kkitayam
ee832e4e37 Fix descriptor searching 2022-10-03 21:41:58 +09:00
Mark K Cowan
6c3c2df823 audio_device: prototype added for function referenced before use 2022-09-17 21:27:04 +03:00
Ben Avison
73f22e31c7 [rp2040] Wrap GCC pragmas in #ifdef __GNUC__
IAR generates warning Pe161 'unrecognized #pragma'.
2022-09-13 18:00:51 +01:00
Ben Avison
01edbb8af6 IAR doesn't support __attribute__((fallthrough))
IAR generates warning Pa167 'the "fallthrough" attribute is not supported'.
It doesn't generate warnings when one switch case falls through to another,
so simply make TU_ATTR_FALLTHROUGH expand to an empty string.

Also replace one instance of __attribute__ with the macro.
2022-09-13 18:00:51 +01:00
Ben Avison
62d90c8500 Move variable into its own curly-brace scope
IAR generates warning Pe546 'transfer of control bypasses initialization of
variable "invInvTag"'.
2022-09-13 18:00:51 +01:00
Ben Avison
caff3b5c54 Remove unused static data
This affects struct rspMsg in usbtmc_app.c (unconditionally) and uint8_t
termChar in usbtmc_device.c (when NDEBUG is defined). IAR generates warning
Pe550 'variable was set but never used'.
2022-09-13 18:00:51 +01:00
Ben Avison
6a2d01bae4 Don't assume different enum types can be combined
IAR generates warning Pa089 'enumerated type mixed with another enumerated
type'.
2022-09-13 18:00:51 +01:00
Ben Avison
53f0d5538b Don't assume ints automatically convert to enums
IAR generates warning Pe188 'enumerated type mixed with another type'.
2022-09-13 18:00:50 +01:00
Ben Avison
65ba15c37d Remove unreachable code
IAR generates warning Pe111 'statement is unreachable'. In a couple of
cases, replace return statements with TU_ATTR_FALLTHROUGH; because some
compilers apparently can't figure out that the return statements are
unreachable but do whinge about an imagined fall-through without them!
2022-09-13 18:00:50 +01:00
Ben Avison
16518dcbbb Refactor pointer arithmetic on void*
This is a GCC extension, illegal in ISO C. IAR generates errors Pa152
'these operand types cannot be used here' and Pe852 'expression must be a
pointer to a complete object type'.

Replace with uint8_t*.
2022-09-13 18:00:49 +01:00
kkitayam
1debf62707 Fix compile errors 2022-09-13 21:22:02 +09:00
kkitayam
e80714740c Change images to MJPEG 2022-09-13 21:22:02 +09:00
Ha Thach
111515a29c
Merge pull request #1629 from jmark1m/master
Fix bug #1628 by preventing shared irq slots for filling up
2022-09-13 15:08:12 +07:00
Ha Thach
7ba950c006
Merge pull request #1642 from kasjer/kasjer/nrf5x-fix-out-iso-packet-size-report
nrf5x: Fix reception of large ISO packets
2022-09-13 14:57:01 +07:00
Jerzy Kasenberg
3133cacc6a nrf5x: Fix reception of large ISO packets
ISO packet size is up to 1023 for full speed device.
Upon completion of ISO reception, reported length of incoming packet
was truncated to one byte only.
This results in incorrect data stream for higher bit rates
48 samples * 4 bytes per sample * 2 channels = 384 bytes of data
and 128 was reported.

There is no change in logic extending xact_len to uint16_t fixes the issue.
2022-09-13 08:11:56 +02:00
Ha Thach
6393412380
Merge pull request #1641 from hathach/fix-1634
re-added code in pr 1438 to fix compile with h7 with 1 usb otg
2022-09-13 11:46:32 +07:00
hathach
7a48b1f0d1 re-added code in pr 1438 to fix compile with h7 with 1 usb otg 2022-09-13 11:04:48 +07:00
Ben Avison
6dfc857b91 [rp2040] Explicit cast value of hw_set_alias
Some compilers don't support the GNU extension `typeof` so their definitions
of `hw_set_alias` can't inherit their type from their argument, and the best
we can do is have `hw_set_alias` act the same as `hw_set_alias_untyped`.
This requires an explicit cast when the macro is used instead, otherwise
IAR generates error Pe132 'expression must have pointer-to-struct-or-union
type but it has type "void *"'.

The same goes for `hw_clear_alias`.
2022-09-12 18:46:09 +01:00
Ben Avison
e5355d0335 [rp2040] Remove non-portable return statements
IAR generates error Pe118 'a void function may not return a value'.
2022-09-12 18:46:09 +01:00
Ben Avison
d28ff1175d IAR declares strncasecmp in string.h not strings.h
strings.h is not an ISO header file, so IAR generates fatal error Pe1696
'cannot open source file "strings.h"'. Even though strncasecmp isn't an
ISO C library function, IAR's runtime library defines it, though it
declares it in string.h instead.
2022-09-12 18:46:01 +01:00
jmark1m
0931b52b66 Fix bug #1628 by preventing shared irq slots for filling up 2022-09-07 15:10:44 -05:00
ReimuNotMoe
c5992edc7d Initial PIC32MM/MX & PIC24 support 2022-09-03 05:19:50 +08:00
Ha Thach
b624664f52
Merge pull request #1614 from kasjer/kasjer/fix-nrf5x-with-iso
nrf5x: Fix endpoint internal state when closed
2022-08-26 13:47:36 +07:00
Jerzy Kasenberg
5e3cfe7b57 nrf5x: Fix endpoint internal state when closed
Field started (regardind transfer) was only cleaed when transfer
was finished.
For audio devices set interface is called many times.
When there is no audio (silence) set interface requests zero
lenght bandwithd that in turn calls dcd_edpt_close().

When endpoint is closed due to set interface request transfer
should not longer be started since it will block next start transfer
with assert.

This just sets 'started' to false when endpoint is closed.
2022-08-26 08:10:15 +02:00
Ha Thach
101cbf6e31
Merge pull request #1613 from Lan-Hekary/video-descriptors-fix
Remove Hardcoded interface numbers from video descriptors
2022-08-25 18:44:22 +07:00
Ahmed El-Sharnoby
8a537a0092
Remove Hardcoded interface numbers from video descriptors
Removing the Hardcoded interface numbers from the video descriptors allow the user to add other interfaces before or after the Video Control Interface and Video Streaming Interface
2022-08-23 17:18:32 +02:00
Ha Thach
e3b4d3f406
Merge pull request #1611 from hathach/fix-release-body
try to fix release body in tinyusb_src (not tested)
2022-08-23 14:44:02 +07:00
hathach
660e8f50a7
try to fix release body in tinyusb_src (not tested) 2022-08-23 14:43:09 +07:00
hathach
fe7fca7abb
minor clean up 2022-08-01 14:42:58 +07:00
hathach
4a47db97eb
test hw dfu_runtime 2022-07-29 11:32:17 +07:00
hathach
aa8880c681
clean up 2022-07-28 22:13:39 +07:00
hathach
292dea408f
add dfu test 2022-07-28 21:27:38 +07:00
hathach
cbb7c9f313
fix hw test 2022-07-28 13:31:42 +07:00
hathach
229a1c1458
update hw test 2022-07-28 11:37:09 +07:00
hathach
e01b437af5
more hw test 2022-07-28 11:10:54 +07:00
hathach
2d5be43747
fix typo 2022-07-27 20:31:57 +07:00
hathach
4411579ae0
ci update 2022-07-27 16:34:22 +07:00
hathach
05ccd6c32b
more hw test update 2022-07-27 15:44:21 +07:00
hathach
1ff0c7a52b
sleep 0.2 for new image take affect 2022-07-27 15:20:56 +07:00
hathach
f5f2433c5a
wait for enumeration before test 2022-07-27 12:08:50 +07:00
hathach
95c0262cd6
update test 2022-07-26 23:14:27 +07:00
hathach
d15a86bc69 test flash and hw test with cdc msc 2022-07-26 16:49:51 +07:00
hathach
0be6db50f8 test self-hosted 2022-07-26 16:31:07 +07:00
maddyaby
2cc2a90215 Allow more endpoint packet sizes for SAMD
Tested on SAMD51 - we can allow more packet sizes by checking that the set size value is greater than the requested packet size instead of exactly the same.
2022-06-17 16:07:32 -07:00
Rafael Silva
ea81d22f18 add __evenaccess keyword for CCRX compiler compatibility
Signed-off-by: Rafael Silva <rafaelsilva@ajtec.pt>
2022-06-02 09:35:30 +01:00
Rafael Silva
fbc2979428 fix iso int register typo
druing the renaming int and iso endpoint configurations were swapped

Co-authored-by: Koji KITAYAMA <45088311+kkitayam@users.noreply.github.com>
2022-06-02 09:35:30 +01:00
Rafael Silva
79fd23974c fix host preprocessor flag typo
Co-authored-by: Koji KITAYAMA <45088311+kkitayam@users.noreply.github.com>
2022-06-02 09:35:30 +01:00
Rafael Silva
60aae59eeb style code for consistency with existing codebase 2022-06-02 09:35:30 +01:00
Rafael Silva
e0220c6594 fix int handling for host in ek_ra4m3 port 2022-06-02 09:35:30 +01:00
Rafael Silva
c529d0b440 remove duplicate link register bit macros
Signed-off-by: Rafael Silva <rafaelsilva@ajtec.pt>
2022-06-02 09:35:30 +01:00
Rafael Silva
e7027efe7a add contributions to docs
Signed-off-by: Rafael Silva <rafaelsilva@ajtec.pt>
2022-06-02 09:35:30 +01:00
Rafael Silva
4c89776a27 add renesas ek-ra4m3 board port
Signed-off-by: Rafael Silva <rafaelsilva@ajtec.pt>
2022-06-02 09:35:30 +01:00
Rafael Silva
0bf0e0b35f add renesas ra mcu family to supported devices docs
Signed-off-by: Rafael Silva <rafaelsilva@ajtec.pt>
2022-06-02 09:35:30 +01:00
Rafael Silva
a936bafb8c add support for renesas ra family of mcus
Signed-off-by: Rafael Silva <rafaelsilva@ajtec.pt>
2022-06-02 09:35:30 +01:00
Rafael Silva
2a17a7e8f8 rework make freertos port handling
this allows ports to specify a freertos port outside the FreeRTOS-Kernel lib directory, which would otherwise not be possible

Signed-off-by: Rafael Silva <rafaelsilva@ajtec.pt>
2022-06-02 09:35:30 +01:00
Rafael Silva
03777f4a46 generalize renesas LINK core driver
create local register access struct and move mcu specific code
	in preparation of support for other mcu families that use the LINK usb core

Signed-off-by: Rafael Silva <rafaelsilva@ajtec.pt>
2022-06-02 09:35:30 +01:00
Rafael Silva
dcadbf3364 rename renesas driver to link
link was chosen according to the name for the usb core on datasheets, LINK core

Signed-off-by: Rafael Silva <rafaelsilva@ajtec.pt>
2022-06-02 09:35:30 +01:00
Rafael Silva
f2e8a60e6d add .vscode to gitignore
Signed-off-by: Rafael Silva <rafaelsilva@ajtec.pt>
2022-06-02 09:35:30 +01:00
Rafael Silva
0ee74a71e2 add renesas fsp submodule
Signed-off-by: Rafael Silva <rafaelsilva@ajtec.pt>
2022-06-02 09:35:28 +01:00
Ha Thach
2683deb0dd
Merge branch 'master' into ch32v307 2022-05-21 13:54:25 +07:00
Skyler Mansfield
35668fc523 hcd_rp2040: Add bulk in/out+interrupt out support.
Added support for allocating hw_endpoints for non-interrupt endpoints.
Allow endpoints to be used in either direction by updating bit checks.
2022-04-17 01:30:03 +01:00
Skyler Mansfield
16c13bc110 tusb_types:
Added descriptive strings for edpt_dir and edpt_type
2022-04-17 01:16:49 +01:00
Rafael Silva
817227a850
Add WCH CH32V307 to readme supported list 2022-04-01 10:05:14 +01:00
Greg Davill
7d395c674c Update supported table 2022-03-23 00:46:44 +10:30
Greg Davill
46fb850e02 Update support table 2022-03-23 00:06:51 +10:30
Greg Davill
cdb8a1a2a1 Clean up driver 2022-03-23 00:00:06 +10:30
Greg Davill
325923b6c6 Update comments about endpoint buffer modes 2022-03-22 23:40:54 +10:30
Greg Davill
a09c1648f5 Fix typo 2022-03-22 23:31:20 +10:30
Greg Davill
d828d203fc Skip freertos for ch32v307 2022-03-22 23:29:09 +10:30
Greg Davill
ac058a4c45 Add ch32v307 to build workflow 2022-03-22 22:32:53 +10:30
Greg Davill
1d254be1a4 Increase stack size to 4096 bytes 2022-03-22 16:03:53 +10:30
Greg Davill
fccbcfc889 Add WCH CH32V307 port
Add WCH mcu submodule
Add CH32V307V-R1-1v0 bsp
2022-03-22 00:30:46 +10:30
1571 changed files with 106798 additions and 32151 deletions

10
.codespellrc Normal file
View file

@ -0,0 +1,10 @@
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
# In the event of a false positive, add the problematic word, in all lowercase, to 'ignore-words.txt' (one word per line).
# Or copy & paste the whole problematic line to 'exclude-file.txt'
ignore-words = tools/codespell/ignore-words.txt
exclude-file = tools/codespell/exclude-file.txt
check-filenames =
check-hidden =
count =
skip = *.rb,.cproject,.git,./lib,./examples/*/*/_build,./examples/*/*/ses,./examples/*/*/ozone,./hw/mcu,./tests_obsolete

View file

@ -60,15 +60,15 @@ body:
- type: textarea
attributes:
label: Debug Log as txt file
label: Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
placeholder: |
Attach your debug log txt file here, where the issue occurred, best with comments to explain the actual events.
Note1: Please DO NOT paste your lengthy log contents here since it hurts the readibility.
Note2: To enable logging, add `LOG=3` to to the make command if building with stock examples or set `CFG_TUSB_DEBUG=3` in your tusb_config.h.
Note1: Please DO NOT paste your lengthy log contents here since it hurts the readability.
Note2: To enable logging, add `LOG=2` to to the make command if building with stock examples or set `CFG_TUSB_DEBUG=2` in your tusb_config.h.
More information can be found at [example's readme](https://github.com/hathach/tinyusb/blob/master/docs/getting_started.md)
validations:
required: false
required: true
- type: textarea
attributes:

View file

@ -1,11 +1,26 @@
name: Build AArch64
on:
pull_request:
workflow_dispatch:
push:
release:
types:
- created
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_aarch64.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_aarch64.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# ---------------------------------------
@ -21,14 +36,13 @@ jobs:
- 'broadcom_64bit'
steps:
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Checkout common submodules in lib
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
- name: Checkout hathach/linkermap
uses: actions/checkout@v3
with:
@ -39,7 +53,7 @@ jobs:
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz
- name: Cache Toolchain
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-toolchain
with:
path: ~/cache/
@ -56,7 +70,7 @@ jobs:
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
run: python3 tools/get_dependencies.py ${{ matrix.family }}
run: python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}

View file

@ -1,34 +1,28 @@
name: Build ARM
on:
pull_request:
workflow_dispatch:
push:
release:
types:
- created
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_arm.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_arm.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# ---------------------------------------
# Unit testing with Ceedling
# ---------------------------------------
unit-test:
runs-on: ubuntu-latest
steps:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Unit Tests
run: |
# Install Ceedling
gem install ceedling
cd test
ceedling test:all
# ---------------------------------------
# Build ARM family
# ---------------------------------------
@ -40,32 +34,19 @@ jobs:
family:
# Alphabetical order
- 'broadcom_32bit'
- 'imxrt'
- 'lpc15'
- 'lpc18'
- 'lpc54'
- 'lpc55'
- 'mm32'
- 'msp432e4'
- 'nrf'
- 'rp2040'
- 'samd11'
- 'samd21'
- 'samd51'
- 'saml2x'
- 'stm32f0'
- 'stm32f1'
- 'stm32f4'
- 'stm32f7'
- 'stm32g4'
- 'stm32h7'
- 'stm32l4'
- 'stm32wb'
- 'tm4c123'
- 'xmc4000'
- 'kinetis_k32l2'
- 'lpc11 lpc13 lpc15 lpc17'
- 'lpc51'
- 'mm32 msp432e4'
- 'samd11 same5x saml2x'
- 'stm32f2 stm32f3'
- 'stm32l0 stm32wb'
- 'tm4c123 xmc4000'
steps:
- name: Setup Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
@ -75,23 +56,14 @@ jobs:
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Checkout common submodules in lib
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel
- name: Checkout hathach/linkermap
uses: actions/checkout@v3
with:
repository: hathach/linkermap
path: linkermap
- name: Checkout pico-sdk for rp2040
if: matrix.family == 'rp2040'
run: |
git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
- name: Get Dependencies
run: python3 tools/get_dependencies.py ${{ matrix.family }}
run: python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
@ -99,41 +71,8 @@ jobs:
- name: Linker Map
run: |
pip install linkermap/
for ex in `ls -d examples/device/*/`; do \
find ${ex} -name *.map -print -quit | \
xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
# find -quit to only print linkermap of 1 board per example
for ex in `ls -d examples/*/*/`
do
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
done
# ---------------------------------------
# Build all no-family (orphaned) boards
# ---------------------------------------
build-board:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
# Alphabetical order, a group of 4
- 'device/audio_test device/board_test device/cdc_dual_ports device/cdc_msc'
- 'device/cdc_msc_freertos device/dfu_runtime device/hid_composite device/hid_composite_freertos'
- 'device/hid_generic_inout device/hid_multiple_interface device/midi_test device/msc_dual_lun'
- 'device/net_lwip_webserver'
- 'device/uac2_headset device/usbtmc device/webusb_serial host/cdc_msc_hid'
steps:
- name: Setup Python
uses: actions/setup-python@v3
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '11.2-2022.02'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Checkout common submodules in lib
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
- name: Build
run: python3 tools/build_board.py ${{ matrix.example }}

View file

@ -1,11 +1,26 @@
name: Build ESP
on:
pull_request:
workflow_dispatch:
push:
release:
types:
- created
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_esp.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_esp.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-esp:
@ -14,16 +29,16 @@ jobs:
fail-fast: false
matrix:
board:
# Alphabetical order
# ESP32-S2
- 'espressif_saola_1'
- 'espressif_kaluga_1'
# ESP32-S3
#- 'espressif_s3_devkitm'
# S3 compile error with "dangerous relocation: call8: call target out of range: memcpy"
- 'espressif_s3_devkitm'
steps:
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Pull ESP-IDF docker
run: docker pull espressif/idf:latest
@ -31,19 +46,5 @@ jobs:
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Checkout hathach/linkermap
uses: actions/checkout@v3
with:
repository: hathach/linkermap
path: linkermap
- name: Build
run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32sx.py ${{ matrix.board }}
- name: Linker Map
run: |
pip install linkermap/
for ex in `ls -d examples/device/*/`; do \
find ${ex} -maxdepth 3 -name *.map -print -quit | \
xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
done
run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32.py ${{ matrix.board }}

54
.github/workflows/build_iar.yml vendored Normal file
View file

@ -0,0 +1,54 @@
name: Build IAR
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_iar.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_iar.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
cmake:
runs-on: [self-hosted, Linux, X64, hifiphile]
strategy:
fail-fast: false
matrix:
family:
# Alphabetical order
# Note: bundle multiple families into a matrix since there is only one self-hosted instance can
# run IAR build. Too many matrix can hurt due to setup/teardown overhead.
- 'lpc43 stm32f0 stm32f1 stm32f4 stm32f7 stm32g0 stm32g4 stm32h7 stm32l4'
steps:
- name: Clean workspace
run: |
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Get Dependencies
run: python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=iar -DCMAKE_BUILD_TYPE=MinSizeRel
- name: Test on actual hardware (hardware in the loop)
run: |
python3 test/hil/hil_test.py hil_hfp.json

View file

@ -1,11 +1,26 @@
name: Build MSP430
on:
pull_request:
workflow_dispatch:
push:
release:
types:
- created
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_msp430.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_msp430.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-msp430:
@ -16,16 +31,16 @@ jobs:
family:
# Alphabetical order
- 'msp430'
steps:
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Checkout common submodules in lib
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
- name: Checkout hathach/linkermap
uses: actions/checkout@v3
with:
@ -36,7 +51,7 @@ jobs:
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2
- name: Cache Toolchain
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-toolchain
with:
path: ~/cache/
@ -53,7 +68,7 @@ jobs:
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
run: python3 tools/get_dependencies.py ${{ matrix.family }}
run: python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
@ -61,7 +76,8 @@ jobs:
- name: Linker Map
run: |
pip install linkermap/
for ex in `ls -d examples/device/*/`; do \
find ${ex} -name *.map -print -quit | \
xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
# find -quit to only print linkermap of 1 board per example
for ex in `ls -d examples/device/*/`
do
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
done

View file

@ -1,11 +1,26 @@
name: Build Renesas
on:
pull_request:
workflow_dispatch:
push:
release:
types:
- created
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_renesas.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_renesas.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-rx:
@ -18,14 +33,13 @@ jobs:
- 'rx'
steps:
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Checkout common submodules in lib
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
- name: Checkout hathach/linkermap
uses: actions/checkout@v3
with:
@ -36,7 +50,7 @@ jobs:
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run
- name: Cache Toolchain
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-toolchain
with:
path: ~/cache/
@ -54,7 +68,7 @@ jobs:
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
run: python3 tools/get_dependencies.py ${{ matrix.family }}
run: python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
@ -62,7 +76,8 @@ jobs:
- name: Linker Map
run: |
pip install linkermap/
for ex in `ls -d examples/device/*/`; do \
find ${ex} -name *.map -print -quit | \
xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
# find -quit to only print linkermap of 1 board per example
for ex in `ls -d examples/device/*/`
do
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
done

View file

@ -1,11 +1,26 @@
name: Build RISC-V
on:
pull_request:
workflow_dispatch:
push:
release:
types:
- created
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_riscv.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_riscv.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-riscv:
@ -15,18 +30,18 @@ jobs:
matrix:
family:
# Alphabetical order
- 'ch32v307'
- 'fomu'
- 'gd32vf103'
steps:
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Checkout common submodules in lib
run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip
- name: Checkout hathach/linkermap
uses: actions/checkout@v3
with:
@ -37,7 +52,7 @@ jobs:
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.1.0-1.1/xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz
- name: Cache Toolchain
uses: actions/cache@v2
uses: actions/cache@v3
id: cache-toolchain
with:
path: ~/cache/
@ -54,7 +69,7 @@ jobs:
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
run: python3 tools/get_dependencies.py ${{ matrix.family }}
run: python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
@ -62,7 +77,8 @@ jobs:
- name: Linker Map
run: |
pip install linkermap/
for ex in `ls -d examples/device/*/`; do \
find ${ex} -name *.map -print -quit | \
xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'; \
# find -quit to only print linkermap of 1 board per example
for ex in `ls -d examples/device/*/`
do
find ${ex} -name *.map -print -quit | xargs -I % sh -c 'echo "::group::%"; linkermap -v %; echo "::endgroup::"'
done

54
.github/workflows/build_win_mac.yml vendored Normal file
View file

@ -0,0 +1,54 @@
name: Build Windows/MacOS
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_win_mac.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/build_win_mac.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# ---------------------------------------
# Build ARM family
# ---------------------------------------
build-arm:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '10.3-2021.10'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Get Dependencies
run: python3 tools/get_deps.py stm32f4
- name: Build
run: python3 tools/build_family.py stm32f4 stm32f411disco

34
.github/workflows/cifuzz.yml vendored Normal file
View file

@ -0,0 +1,34 @@
name: CIFuzz
on:
workflow_dispatch:
pull_request:
branches:
- master
paths:
- '**.c'
- '**.cc'
- '**.cpp'
- '**.cxx'
- '**.h'
jobs:
Fuzzing:
runs-on: ubuntu-latest
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'tinyusb'
language: c++
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'tinyusb'
language: c++
fuzz-seconds: 600
- name: Upload Crash
uses: actions/upload-artifact@v3
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts

164
.github/workflows/cmake_arm.yml vendored Normal file
View file

@ -0,0 +1,164 @@
name: CMake ARM
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/cmake_arm.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- '.github/workflows/cmake_arm.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# ---------------------------------------
# Build ARM family
# ---------------------------------------
build-arm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
family:
# Alphabetical order
- 'imxrt'
- 'kinetis_kl'
- 'lpc18 lpc40 lpc43'
- 'lpc54 lpc55'
- 'mcx'
- 'nrf'
- 'ra'
- 'rp2040'
- 'samd21'
- 'samd51'
- 'stm32f0'
- 'stm32f1'
- 'stm32f4'
- 'stm32f7'
- 'stm32g0'
- 'stm32g4'
- 'stm32h7'
- 'stm32l4'
- 'stm32u5'
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '11.2-2022.02'
- name: Install Ninja
run: sudo apt install -y ninja-build
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Checkout pico-sdk for rp2040
if: matrix.family == 'rp2040'
uses: actions/checkout@v3
with:
repository: raspberrypi/pico-sdk
ref: develop
path: pico-sdk
- name: Get Dependencies
run: python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python tools/build_cmake.py ${{ matrix.family }} -DCMAKE_BUILD_TYPE=MinSizeRel
env:
# for rp2040, there is no harm if defined for other families
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
# Upload binaries for hardware test with self-hosted
- name: Prepare rp2040 Artifacts
if: contains(matrix.family, 'rp2040') && github.repository_owner == 'hathach'
working-directory: ${{github.workspace}}/cmake-build/cmake-build-raspberry_pi_pico
run: |
find device/ -name "*.elf" -exec mv {} ../../ \;
# find host/ -name "*.elf" -exec mv {} ../../ \;
# find dual/ -name "*.elf" -exec mv {} ../../ \;
- name: Upload Artifacts for rp2040
if: contains(matrix.family,'rp2040') && github.repository_owner == 'hathach'
uses: actions/upload-artifact@v3
with:
name: rp2040
path: |
*.elf
# ---------------------------------------
# Hardware in the loop (HIL)
# Current self-hosted instance is running on an RPI4 with
# - pico + pico-probe connected via USB
# - pico-probe is /dev/ttyACM0
# ---------------------------------------
hw-rp2040-test:
# run only with hathach's commit due to limited resource on RPI4
if: github.repository_owner == 'hathach'
needs: build-arm
runs-on: [self-hosted, Linux, ARM64, rp2040]
steps:
- name: Clean workspace
run: |
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"
- name: Download rp2040 Artifacts
uses: actions/download-artifact@v3
with:
name: rp2040
- name: Create flash.sh
run: |
echo > flash.sh 'cmdout=$(openocd -f "interface/cmsis-dap.cfg" -f "target/rp2040.cfg" -c "adapter speed 5000" -c "program $1 reset exit")'
echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi'
chmod +x flash.sh
- name: Test cdc_dual_ports
run: |
./flash.sh cdc_dual_ports.elf
while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 10 ]; do :; done
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
test -e /dev/ttyACM2 && echo "ttyACM2 exists"
- name: Test cdc_msc
run: |
./flash.sh cdc_msc.elf
readme='/media/pi/TinyUSB MSC/README.TXT'
while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 10 ]; do :; done
test -e /dev/ttyACM1 && echo "ttyACM1 exists"
test -f "$readme" && echo "$readme exists"
cat "$readme"
- name: Test dfu
run: |
./flash.sh dfu.elf
while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 10 ]; do :; done
dfu-util -d cafe -a 0 -U dfu0
dfu-util -d cafe -a 1 -U dfu1
grep "TinyUSB DFU! - Partition 0" dfu0
grep "TinyUSB DFU! - Partition 1" dfu1
- name: Test dfu_runtime
run: |
./flash.sh dfu_runtime.elf
while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 10 ]; do :; done

48
.github/workflows/pre-commit.yml vendored Normal file
View file

@ -0,0 +1,48 @@
name: pre-commit
on:
workflow_dispatch:
push:
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Checkout TinyUSB
uses: actions/checkout@v3
- name: Get Dependencies
run: |
gem install ceedling
#cd test/unit-test
#ceedling test:all
- name: Run pre-commit
uses: pre-commit/action@v3.0.0
- name: Build Fuzzer
run: |
export CC=clang
export CXX=clang++
fuzz_harness=$(ls -d test/fuzz/device/*/)
for h in $fuzz_harness
do
make -C $h get-deps
make -C $h all
done

View file

@ -1,6 +1,7 @@
name: Trigger Repos
on:
workflow_dispatch:
push:
branches: master
release:
@ -55,4 +56,5 @@ jobs:
git push origin ${{ github.event.release.tag_name }}
# Send POST reqwuest to release https://docs.github.com/en/rest/reference/repos#create-a-release
curl -X POST -H "Authorization: token ${{ secrets.API_TOKEN_GITHUB }}" -H "Accept: application/vnd.github.v3+json" --data '{"tag_name": "${{ github.event.release.tag_name }}", "name": "${{ github.event.release.name }}", "body": "${{ github.event.release.body }}", "draft": ${{ github.event.release.draft }}, "prerelease": ${{ github.event.release.prerelease }}}' https://api.github.com/repos/hathach/tinyusb_src/releases
bb="For release note, please checkout https://github.com/hathach/tinyusb/releases/tag/${{ github.event.release.tag_name }}"
curl -X POST -H "Authorization: token ${{ secrets.API_TOKEN_GITHUB }}" -H "Accept: application/vnd.github.v3+json" --data '{"tag_name": "${{ github.event.release.tag_name }}", "name": "${{ github.event.release.name }}", "body": "$bb", "draft": ${{ github.event.release.draft }}, "prerelease": ${{ github.event.release.prerelease }}}' https://api.github.com/repos/hathach/tinyusb_src/releases

60
.gitignore vendored
View file

@ -12,7 +12,7 @@ latex
*.ind
.env
.settings/
.idea/
.vscode/
.gdb_history
/examples/*/*/build*
test_old/
@ -21,10 +21,68 @@ _build
/examples/*/*/ses
/examples/*/*/ozone
/examples/obsolete
hw/bsp/**/cubemx/*/
.mxproject
# coverity intermediate files
cov-int
# cppcheck build directories
*-build-dir
/_bin/
__pycache__
cmake-build-*
sdkconfig
# submodules
hw/mcu/allwinner
hw/mcu/bridgetek/ft9xx/ft90x-sdk
hw/mcu/broadcom
hw/mcu/gd/nuclei-sdk
hw/mcu/infineon/mtb-xmclib-cat3
hw/mcu/microchip
hw/mcu/mindmotion/mm32sdk
hw/mcu/nordic/nrfx
hw/mcu/nuvoton
hw/mcu/nxp/lpcopen
hw/mcu/nxp/mcux-sdk
hw/mcu/nxp/nxp_sdk
hw/mcu/raspberry_pi/Pico-PIO-USB
hw/mcu/renesas/rx
hw/mcu/silabs/cmsis-dfp-efm32gg12b
hw/mcu/sony/cxd56/spresense-exported-sdk
hw/mcu/st/cmsis_device_f0
hw/mcu/st/cmsis_device_f1
hw/mcu/st/cmsis_device_f2
hw/mcu/st/cmsis_device_f3
hw/mcu/st/cmsis_device_f4
hw/mcu/st/cmsis_device_f7
hw/mcu/st/cmsis_device_g0
hw/mcu/st/cmsis_device_g4
hw/mcu/st/cmsis_device_h7
hw/mcu/st/cmsis_device_l0
hw/mcu/st/cmsis_device_l1
hw/mcu/st/cmsis_device_l4
hw/mcu/st/cmsis_device_l5
hw/mcu/st/cmsis_device_u5
hw/mcu/st/cmsis_device_wb
hw/mcu/st/stm32f0xx_hal_driver
hw/mcu/st/stm32f1xx_hal_driver
hw/mcu/st/stm32f2xx_hal_driver
hw/mcu/st/stm32f3xx_hal_driver
hw/mcu/st/stm32f4xx_hal_driver
hw/mcu/st/stm32f7xx_hal_driver
hw/mcu/st/stm32g0xx_hal_driver
hw/mcu/st/stm32g4xx_hal_driver
hw/mcu/st/stm32h7xx_hal_driver
hw/mcu/st/stm32l0xx_hal_driver
hw/mcu/st/stm32l1xx_hal_driver
hw/mcu/st/stm32l4xx_hal_driver
hw/mcu/st/stm32l5xx_hal_driver
hw/mcu/st/stm32u5xx_hal_driver
hw/mcu/st/stm32wbxx_hal_driver
hw/mcu/ti
hw/mcu/wch/ch32v307
lib/CMSIS_5
lib/FreeRTOS-Kernel
lib/lwip
lib/sct_neopixel
tools/uf2

151
.gitmodules vendored
View file

@ -1,151 +0,0 @@
[submodule "hw/mcu/nordic/nrfx"]
path = hw/mcu/nordic/nrfx
url = https://github.com/NordicSemiconductor/nrfx.git
[submodule "tools/uf2"]
path = tools/uf2
url = https://github.com/microsoft/uf2.git
[submodule "hw/mcu/sony/cxd56/spresense-exported-sdk"]
path = hw/mcu/sony/cxd56/spresense-exported-sdk
url = https://github.com/sonydevworld/spresense-exported-sdk.git
[submodule "hw/mcu/ti"]
path = hw/mcu/ti
url = https://github.com/hathach/ti_driver.git
[submodule "hw/mcu/microchip"]
path = hw/mcu/microchip
url = https://github.com/hathach/microchip_driver.git
[submodule "hw/mcu/nuvoton"]
path = hw/mcu/nuvoton
url = https://github.com/majbthrd/nuc_driver.git
[submodule "lib/lwip"]
path = lib/lwip
url = https://github.com/lwip-tcpip/lwip.git
[submodule "hw/mcu/st/cmsis_device_f4"]
path = hw/mcu/st/cmsis_device_f4
url = https://github.com/STMicroelectronics/cmsis_device_f4.git
[submodule "hw/mcu/st/stm32f4xx_hal_driver"]
path = hw/mcu/st/stm32f4xx_hal_driver
url = https://github.com/STMicroelectronics/stm32f4xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_f0"]
path = hw/mcu/st/cmsis_device_f0
url = https://github.com/STMicroelectronics/cmsis_device_f0.git
[submodule "hw/mcu/st/stm32f0xx_hal_driver"]
path = hw/mcu/st/stm32f0xx_hal_driver
url = https://github.com/STMicroelectronics/stm32f0xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_f1"]
path = hw/mcu/st/cmsis_device_f1
url = https://github.com/STMicroelectronics/cmsis_device_f1.git
[submodule "hw/mcu/st/stm32f1xx_hal_driver"]
path = hw/mcu/st/stm32f1xx_hal_driver
url = https://github.com/STMicroelectronics/stm32f1xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_f2"]
path = hw/mcu/st/cmsis_device_f2
url = https://github.com/STMicroelectronics/cmsis_device_f2.git
[submodule "hw/mcu/st/stm32f2xx_hal_driver"]
path = hw/mcu/st/stm32f2xx_hal_driver
url = https://github.com/STMicroelectronics/stm32f2xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_f3"]
path = hw/mcu/st/cmsis_device_f3
url = https://github.com/STMicroelectronics/cmsis_device_f3.git
[submodule "hw/mcu/st/stm32f3xx_hal_driver"]
path = hw/mcu/st/stm32f3xx_hal_driver
url = https://github.com/STMicroelectronics/stm32f3xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_f7"]
path = hw/mcu/st/cmsis_device_f7
url = https://github.com/STMicroelectronics/cmsis_device_f7.git
[submodule "hw/mcu/st/stm32f7xx_hal_driver"]
path = hw/mcu/st/stm32f7xx_hal_driver
url = https://github.com/STMicroelectronics/stm32f7xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_h7"]
path = hw/mcu/st/cmsis_device_h7
url = https://github.com/STMicroelectronics/cmsis_device_h7.git
[submodule "hw/mcu/st/stm32h7xx_hal_driver"]
path = hw/mcu/st/stm32h7xx_hal_driver
url = https://github.com/STMicroelectronics/stm32h7xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_l0"]
path = hw/mcu/st/cmsis_device_l0
url = https://github.com/STMicroelectronics/cmsis_device_l0.git
[submodule "hw/mcu/st/stm32l0xx_hal_driver"]
path = hw/mcu/st/stm32l0xx_hal_driver
url = https://github.com/STMicroelectronics/stm32l0xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_l1"]
path = hw/mcu/st/cmsis_device_l1
url = https://github.com/STMicroelectronics/cmsis_device_l1.git
[submodule "hw/mcu/st/stm32l1xx_hal_driver"]
path = hw/mcu/st/stm32l1xx_hal_driver
url = https://github.com/STMicroelectronics/stm32l1xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_l4"]
path = hw/mcu/st/cmsis_device_l4
url = https://github.com/STMicroelectronics/cmsis_device_l4.git
[submodule "hw/mcu/st/stm32l4xx_hal_driver"]
path = hw/mcu/st/stm32l4xx_hal_driver
url = https://github.com/STMicroelectronics/stm32l4xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_g0"]
path = hw/mcu/st/cmsis_device_g0
url = https://github.com/STMicroelectronics/cmsis_device_g0.git
[submodule "hw/mcu/st/stm32g0xx_hal_driver"]
path = hw/mcu/st/stm32g0xx_hal_driver
url = https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_g4"]
path = hw/mcu/st/cmsis_device_g4
url = https://github.com/STMicroelectronics/cmsis_device_g4.git
[submodule "hw/mcu/st/stm32g4xx_hal_driver"]
path = hw/mcu/st/stm32g4xx_hal_driver
url = https://github.com/STMicroelectronics/stm32g4xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_l5"]
path = hw/mcu/st/cmsis_device_l5
url = https://github.com/STMicroelectronics/cmsis_device_l5.git
[submodule "hw/mcu/st/stm32l5xx_hal_driver"]
path = hw/mcu/st/stm32l5xx_hal_driver
url = https://github.com/STMicroelectronics/stm32l5xx_hal_driver.git
[submodule "hw/mcu/st/cmsis_device_wb"]
path = hw/mcu/st/cmsis_device_wb
url = https://github.com/STMicroelectronics/cmsis_device_wb.git
[submodule "hw/mcu/st/stm32wbxx_hal_driver"]
path = hw/mcu/st/stm32wbxx_hal_driver
url = https://github.com/STMicroelectronics/stm32wbxx_hal_driver.git
[submodule "lib/sct_neopixel"]
path = lib/sct_neopixel
url = https://github.com/gsteiert/sct_neopixel
[submodule "lib/FreeRTOS-Kernel"]
path = lib/FreeRTOS-Kernel
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
[submodule "lib/CMSIS_5"]
path = lib/CMSIS_5
url = https://github.com/ARM-software/CMSIS_5.git
[submodule "hw/mcu/silabs/cmsis-dfp-efm32gg12b"]
path = hw/mcu/silabs/cmsis-dfp-efm32gg12b
url = https://github.com/cmsis-packs/cmsis-dfp-efm32gg12b
[submodule "hw/mcu/renesas/rx"]
path = hw/mcu/renesas/rx
url = https://github.com/kkitayam/rx_device.git
[submodule "hw/mcu/nxp/lpcopen"]
path = hw/mcu/nxp/lpcopen
url = https://github.com/hathach/nxp_lpcopen.git
[submodule "hw/mcu/nxp/mcux-sdk"]
path = hw/mcu/nxp/mcux-sdk
url = https://github.com/NXPmicro/mcux-sdk.git
[submodule "hw/mcu/nxp/nxp_sdk"]
path = hw/mcu/nxp/nxp_sdk
url = https://github.com/hathach/nxp_sdk.git
[submodule "hw/mcu/gd/nuclei-sdk"]
path = hw/mcu/gd/nuclei-sdk
url = https://github.com/Nuclei-Software/nuclei-sdk.git
[submodule "hw/mcu/bridgetek/ft9xx/ft90x-sdk"]
path = hw/mcu/bridgetek/ft9xx/ft90x-sdk
url = https://github.com/BRTSG-FOSS/ft90x-sdk
[submodule "hw/mcu/mindmotion/mm32sdk"]
path = hw/mcu/mindmotion/mm32sdk
url = https://github.com/hathach/mm32sdk.git
[submodule "hw/mcu/broadcom"]
path = hw/mcu/broadcom
url = https://github.com/adafruit/broadcom-peripherals.git
branch = main-build
[submodule "hw/mcu/infineon/mtb-xmclib-cat3"]
path = hw/mcu/infineon/mtb-xmclib-cat3
url = https://github.com/Infineon/mtb-xmclib-cat3.git
[submodule "hw/mcu/allwinner"]
path = hw/mcu/allwinner
url = https://github.com/hathach/allwinner_driver.git
[submodule "hw/mcu/raspberry_pi/Pico-PIO-USB"]
path = hw/mcu/raspberry_pi/Pico-PIO-USB
url = https://github.com/sekigon-gonnoc/Pico-PIO-USB.git

8
.idea/.gitignore generated vendored Normal file
View file

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

70
.idea/cmake.xml generated Normal file
View file

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeSharedSettings">
<configurations>
<configuration PROFILE_NAME="esp32s2" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=espressif_saola_1">
<ADDITIONAL_GENERATION_ENVIRONMENT>
<envs>
<env name="ESPBAUD" value="1500000" />
</envs>
</ADDITIONAL_GENERATION_ENVIRONMENT>
</configuration>
<configuration PROFILE_NAME="kaluga" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=espressif_kaluga_1 -DMAX3421_HOST=1 -DLOG=2">
<ADDITIONAL_GENERATION_ENVIRONMENT>
<envs>
<env name="ESPBAUD" value="1500000" />
</envs>
</ADDITIONAL_GENERATION_ENVIRONMENT>
</configuration>
<configuration PROFILE_NAME="esp32s3" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=espressif_s3_devkitm">
<ADDITIONAL_GENERATION_ENVIRONMENT>
<envs>
<env name="ESPBAUD" value="1500000" />
</envs>
</ADDITIONAL_GENERATION_ENVIRONMENT>
</configuration>
<configuration PROFILE_NAME="rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=raspberry_pi_pico -DLOG=2" />
<configuration PROFILE_NAME="feather_rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pico_sdk -DPICO_BOARD=adafruit_feather_rp2040" />
<configuration PROFILE_NAME="metro m7 1011" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m7_1011 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
<configuration PROFILE_NAME="rt1010 evk" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mimxrt1010_evk -DLOG=3 -DLOGGER=RTT" />
<configuration PROFILE_NAME="rt1060 evk" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mimxrt1060_evk -DLOG=3 -DLOGGER=RTT" />
<configuration PROFILE_NAME="mcb1800" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mcb1800 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
<configuration PROFILE_NAME="ea4088 quickstart" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ea4088_quickstart -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
<configuration PROFILE_NAME="ea4357" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ea4357 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
<configuration PROFILE_NAME="lpc54628" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=lpcxpresso54628 -DLOG=4 -DLOGGER=RTT" />
<configuration PROFILE_NAME="lpc55s69" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=lpcxpresso55s69 -DLOG=4 -DLOGGER=RTT" />
<configuration PROFILE_NAME="mcxn947" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mcxn947brk -DLOG=3 -DLOGGER=RTT" />
<configuration PROFILE_NAME="feather_nrf52840_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_nrf52840_express -DLOG=3 -DLOGGER=RTT -DMAX3421_HOST=1" />
<configuration PROFILE_NAME="pca10056" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10056 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
<configuration PROFILE_NAME="pca10095" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10095 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
<configuration PROFILE_NAME="stm32g0b1nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32g0b1nucleo" />
<configuration PROFILE_NAME="stm32g474nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32g474nucleo" />
<configuration PROFILE_NAME="b_g474e_dpow1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=b_g474e_dpow1 -DLOG=3 -DLOGGER=RTT" />
<configuration PROFILE_NAME="b_g474e_dpow1 iar" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=b_g474e_dpow1 -DTOOLCHAIN=iar" />
<configuration PROFILE_NAME="frdm_kl25z" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=frdm_kl25z -DLOG=3 -DLOGGER=RTT" />
<configuration PROFILE_NAME="stm32f072disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f072disco" />
<configuration PROFILE_NAME="stm32f103_mini_2" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f103_mini_2" />
<configuration PROFILE_NAME="stm32f411disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f411disco -DLOG=2 -DLOGGER=RTT" />
<configuration PROFILE_NAME="stm32f769disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f769disco -DLOG=3 -DLOGGER=RTT" />
<configuration PROFILE_NAME="stm32h743eval" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32h743eval -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
<configuration PROFILE_NAME="stm32l476disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32l476disco" />
<configuration PROFILE_NAME="ra4m1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra4m1_ek -DLOG=3 -DLOGGER=RTT" />
<configuration PROFILE_NAME="ra6m1" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m1_ek -DLOG=3 -DLOGGER=RTT" />
<configuration PROFILE_NAME="ra6m5" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
<configuration PROFILE_NAME="ra6m5 PORT0" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=ra6m5_ek -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1 -DPORT=0" />
<configuration PROFILE_NAME="uno_r4" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=uno_r4 -DLOG=4 -DLOGGER=RTT" />
<configuration PROFILE_NAME="portenta_c33" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=portenta_c33 -DLOG=3" />
<configuration PROFILE_NAME="metro_m4_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m4_express -DLOG=3 -DLOGGER=RTT -DMAX3421_HOST=1" />
<configuration PROFILE_NAME="metro_m0_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m0_express -DLOG=3 -DLOGGER=RTT -DMAX3421_HOST=1" />
<configuration PROFILE_NAME="metro esp32s2" ENABLED="false" TOOLCHAIN_NAME="ESP-IDF" GENERATION_OPTIONS="-DBOARD=adafruit_metro_esp32s2 -DMAX3421_HOST=1 -DLOG=2">
<ADDITIONAL_GENERATION_ENVIRONMENT>
<envs>
<env name="ESPBAUD" value="1500000" />
</envs>
</ADDITIONAL_GENERATION_ENVIRONMENT>
</configuration>
<configuration PROFILE_NAME="stm32u575eval" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u575eval" />
<configuration PROFILE_NAME="stm32u575nucleo" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32u575nucleo -DLOG=3" />
</configurations>
</component>
</project>

10
.idea/runConfigurations/kl25.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="kl25" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;MKL25Z128xxx4&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/lpc1857.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="lpc1857" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;lpc1857&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/lpc4088.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="lpc4088" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;lpc4088&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/lpc54628.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="lpc54628" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;LPC54628J512&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/lpc55s69.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="lpc55s69" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;lpc55s69&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/mcx947.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="mcx947" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;MCXN947_M33_0&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $ProjectFileDir$/hw/bsp/mcx/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/nrf52840.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="nrf52840" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-select usb=752001685 -device &quot;nrf52840_xxaa&quot; -if swd -speed 8000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/nrf5340.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="nrf5340" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-select usb=752001685 -device &quot;nrf5340_xxaa_app&quot; -if swd -speed 16000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/ra4m1.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ra4m1" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;R7FA4M1AB&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $PROJECT_DIR$/hw/bsp/ra/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/ra6m1.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ra6m1" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;R7FA6M1AD&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $PROJECT_DIR$/hw/bsp/ra/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/ra6m5.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ra6m5" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;R7FA6M5BH&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $PROJECT_DIR$/hw/bsp/ra/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/rp2040.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="rp2040" type="com.jetbrains.cidr.embedded.openocd.conf.type" factoryName="com.jetbrains.cidr.embedded.openocd.conf.factory" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="rp2040" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<openocd version="1" gdb-port="3333" telnet-port="4444" board-config="$PROJECT_DIR$/hw/bsp/rp2040/rp2040-openocd.cfg" reset-type="INIT" download-type="UPDATED_ONLY">
<debugger kind="GDB" isBundled="true" />
</openocd>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/rt1010.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="rt1010" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;MIMXRT1011xxx5A&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun -jlinkscriptfile $ProjectFileDir$/hw/bsp/imxrt/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="ALWAYS" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/rt1060.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="rt1060" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;MIMXRT1062xxx5A&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/samd21g18.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="samd21g18" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;ATSAMD21G18&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/samd51j19.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="samd51j19" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;ATSAMD51J19A&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/stlink.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="stlink" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-p 62847 -cp &quot;/opt/st/stm32cubeide_1.12.1/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64_2.0.600.202301161003/tools/bin&quot; --frequency 24000 --swd" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::62847" executable="/opt/st/stm32cubeide_1.12.1/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.linux64_2.0.500.202301161003/tools/bin/ST-LINK_gdbserver" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/stm32g474.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="stm32g474" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;stm32g474re&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/stm32h743.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="stm32h743" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;stm32h743xi&quot; -if swd -speed 50000 -port 25321 -nogui -singlerun" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

10
.idea/runConfigurations/uno_r4.xml generated Normal file
View file

@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="uno_r4" type="com.jetbrains.cidr.embedded.customgdbserver.type" factoryName="com.jetbrains.cidr.embedded.customgdbserver.factory" PROGRAM_PARAMS="-device &quot;R7FA4M1AB&quot; -if swd -speed 20000 -port 25321 -nogui -singlerun -jlinkscriptfile $PROJECT_DIR$/hw/bsp/ra/debug.jlinkscript" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="tinyusb_examples" TARGET_NAME="cdc_msc" CONFIG_NAME="feather_nrf52840_express" version="1" RUN_TARGET_PROJECT_NAME="tinyusb_examples" RUN_TARGET_NAME="cdc_msc">
<custom-gdb-server version="1" gdb-connect="tcp::25321" executable="/usr/bin/JLinkGDBServer" warmup-ms="0" download-type="UPDATED_ONLY" reset-cmd="monitor reset" reset-type="AFTER_DOWNLOAD">
<debugger kind="GDB" isBundled="true" />
</custom-gdb-server>
<method v="2">
<option name="CLION.COMPOUND.BUILD" enabled="true" />
</method>
</configuration>
</component>

6
.idea/vcs.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

42
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,42 @@
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
#
# SPDX-License-Identifier: Unlicense
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: trailing-whitespace
exclude: |
(?x)^(
hw/bsp/mcx/sdk/
)
- id: end-of-file-fixer
exclude: |
(?x)^(
.idea/|
hw/bsp/mcx/sdk/
)
- id: forbid-submodules
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
args: [-w]
exclude: |
(?x)^(
lib/|
hw/bsp/mcx/sdk/
)
- repo: local
hooks:
- id: unit-test
name: unit-test
files: ^(src/|test/unit-test/)
entry: sh -c "cd test/unit-test && ceedling test:all"
pass_filenames: false
types_or: [c, header]
language: system

View file

@ -4,15 +4,21 @@
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# Optionally declare the Python requirements required to build your docs
python:
version: 3.8
install:
- requirements: docs/requirements.txt
submodules:
include: []
recursive: false

View file

@ -119,6 +119,7 @@ Notable contributors
- Port DCD Synopsys to support Silabs EFM32GG12 with SLTB009A board
- Rewrite documentation in rst and setup for readthedocs
- Generalize Renesas driver and support RA family with EK-RA4M3 board
`Raspberry Pi Team <https://github.com/raspberrypi>`__
@ -199,6 +200,8 @@ Notable contributors
- Add new DCD port for Microchip SAMx7x
- Add IAR compiler support
- Improve UAC2, CDC, DFU class driver
- Improve stm32_fsdev, chipidea_ci_hs, lpc_ip3511 DCD
- Host IAR Build CI & hardware in the loop (HITL) test
`Full contributors list <https://github.com/hathach/tinyusb/contributors>`__

View file

@ -1,7 +1,7 @@
.. figure:: docs/assets/logo.svg
:alt: TinyUSB
|Build Status| |Documentation Status| |License|
|Build Status| |Documentation Status| |Fuzzing Status| |License|
TinyUSB is an open-source cross-platform USB Host/Device stack for
embedded system, designed to be memory-safe with no dynamic allocation
@ -20,8 +20,8 @@ Please take a look at the online `documentation <https://docs.tinyusb.org/>`__.
├── docs # Documentation
├── examples # Sample with Makefile build support
├── hw
   ├── bsp # Supported boards source files
   └── mcu # Low level mcu core & peripheral drivers
├── bsp # Supported boards source files
└── mcu # Low level mcu core & peripheral drivers
├── lib # Sources from 3rd party such as freeRTOS, fatfs ...
├── src # All sources files for TinyUSB stack itself.
├── test # Unit tests for the stack
@ -33,6 +33,7 @@ Supported MCUs
The stack supports the following MCUs:
- **Allwinner:** F1C100s/F1C200s
- **Analog:** MAX3421e (aka Arduino usb host shield)
- **Broadcom:** BCM2837, BCM2711
- **Dialog:** DA1469x
- **Espressif:** ESP32-S2, ESP32-S3
@ -46,14 +47,20 @@ The stack supports the following MCUs:
- iMX RT Series: RT10xx, RT11xx
- Kinetis: KL25, K32L2
- LPC Series: 11u, 13, 15, 17, 18, 40, 43, 51u, 54, 55
- MCX: N9x
- **Raspberry Pi:** RP2040
- **Renesas:** RX63N, RX65N, RX72N
- **Renesas:**
- RX Series: 63n, 65n, 72n
- RA Series: 4m1, 4m3, 6m1, 6m5
- **Silabs:** EFM32GG
- **Sony:** CXD56
- **ST:** STM32 series: F0, F1, F2, F3, F4, F7, H7, G4, L0, L1, L4, L4+, WB
- **ST:** STM32 series: F0, F1, F2, F3, F4, F7, H7, G0, G4, L0, L1, L4, L4+, WB
- **TI:** MSP430, MSP432E4, TM4C123
- **ValentyUSB:** eptri
- **WCH:** CH32V307
Here is the list of `Supported Devices`_ that can be used with provided examples.
@ -82,8 +89,19 @@ Host Stack
- Human Interface Device (HID): Keyboard, Mouse, Generic
- Mass Storage Class (MSC)
- Communication Device Class: CDC-ACM
- Vendor serial over USB: FTDI, CP210x
- 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.
TypeC PD Stack
==============
- Power Delivery 3.0 (PD3.0) with USB Type-C support (WIP)
- Super early stage, only for testing purpose
- Only support STM32 G4
OS Abstraction layer
====================
@ -107,6 +125,7 @@ Docs
- `Supported Devices`_
- `Getting Started`_
- `Dependencies`_
- `Concurrency`_
- `Contributing`_
@ -125,10 +144,12 @@ Please make sure you understand all the license term for files you use
in your project.
.. |Build Status| image:: https://github.com/hathach/tinyusb/workflows/Build/badge.svg
.. |Build Status| image:: https://github.com/hathach/tinyusb/actions/workflows/cmake_arm.yml/badge.svg
:target: https://github.com/hathach/tinyusb/actions
.. |Documentation Status| image:: https://readthedocs.org/projects/tinyusb/badge/?version=latest
:target: https://docs.tinyusb.org/en/latest/?badge=latest
.. |Fuzzing Status| image:: https://oss-fuzz-build-logs.storage.googleapis.com/badges/tinyusb.svg
:target: https://oss-fuzz-build-logs.storage.googleapis.com/index.html#tinyusb
.. |License| image:: https://img.shields.io/badge/license-MIT-brightgreen.svg
:target: https://opensource.org/licenses/MIT
@ -139,6 +160,7 @@ in your project.
.. _Reference: docs/reference/index.rst
.. _Supported Devices: docs/reference/supported.rst
.. _Getting Started: docs/reference/getting_started.rst
.. _Dependencies: docs/reference/dependencies.rst
.. _Concurrency: docs/reference/concurrency.rst
.. _Contributing: docs/contributing/index.rst
.. _Code of Conduct: CODE_OF_CONDUCT.rst

View file

@ -6,7 +6,7 @@ Contributing can be highly rewarding, but it can also be frustrating at times.
It takes time to review patches, and as this is an open source project, that
sometimes can take a while. The reviewing process depends on the availability
of the maintainers, who may not be always available. Please try to be
understanding throught the process.
understanding through the process.
There a few guidelines you need to keep in mind when contributing. Please have
a look at them as that will make the contribution process easier for all

View file

@ -62,9 +62,9 @@ Feel free to skip this until you want to verify your demo code is running. To im
OS Abstraction Layer (OSAL)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
The OS Abstraction Layer is responsible for providing basic data structures for TinyUSB that may allow for concurrency when used with an RTOS. Without an RTOS it simply handles concurrency issues between the main code and interrupts.
The OS Abstraction Layer is responsible for providing basic data structures for TinyUSB that may allow for concurrency when used with an RTOS. Without an RTOS it simply handles concurrency issues between the main code and interrupts. The code is almost entirely agnostic of MCU and lives in ``src/osal``.
The code is almost entirely agnostic of MCU and lives in ``src/osal``.
In RTOS configurations, tud_task()/tuh_task() blocks behind a synchronization structure when the event queue is empty, so that the scheduler may give the CPU to a different task. To take advantage of the library's capability to yield the CPU when there are no actionable USB device events, ensure that the `CFG_TUSB_OS` symbol is defined, e.g `OPT_OS_FREERTOS` enables the FreeRTOS scheduler to schedule other threads than that which calls `tud_task()/tuh_task()`.
Device API
^^^^^^^^^^
@ -195,7 +195,7 @@ Others (like the nRF52) may need each USB packet queued individually. To make th
some state for yourself and queue up an intermediate USB packet from the interrupt handler.
Once the transaction is going, the interrupt handler will notify TinyUSB of transfer completion.
During transmission, the IN data buffer is guarenteed to remain unchanged in memory until the ``dcd_xfer_complete`` function is called.
During transmission, the IN data buffer is guaranteed to remain unchanged in memory until the ``dcd_xfer_complete`` function is called.
The dcd_edpt_xfer function must never add zero-length-packets (ZLP) on its own to a transfer. If a ZLP is required,
then it must be explicitly sent by the stack calling dcd_edpt_xfer(), by calling dcd_edpt_xfer() a second time with len=0.
@ -238,4 +238,4 @@ Use `WireShark <https://www.wireshark.org/>`_ or `a Beagle <https://www.totalpha
* If the host sends a SETUP packet and its not ACKed then your USB peripheral probably isn't started correctly.
* If the peripheral is started correctly but it still didn't work, then verify your usb clock is correct. (You did output a PWM based on it right? ;-) )
* If the SETUP packet is ACKed but nothing is sent back then you interrupt handler isn't queueing the setup packet correctly. (Also, if you are using your own code instead of an example ``tud_task`` may not be called.) If thats OK, the ``dcd_xfer_complete`` may not be setting up the next transaction correctly.
* If the SETUP packet is ACKed but nothing is sent back then you interrupt handler isn't queueing the setup packet correctly. (Also, if you are using your own code instead of an example ``tud_task`` may not be called.) If that's OK, the ``dcd_xfer_complete`` may not be setting up the next transaction correctly.

View file

@ -2,6 +2,78 @@
Changelog
*********
0.15.0
======
- Add codespell to detect typo
- Add support for fuzzing and bagde for oss-fuzz
- [osal]
- Allow the use of non-static allocation for FreeRTOS
- Fix FreeRTOS wrong task switch in some cases
- Fix tu_fifo memory overflown when repeatedly write to overwritable fifo (accumulated more than 2 depths)
- Better support for IAR (ARM) with ci build check for stm32 mcus.
- Fix Windows build for some mingw gnu make situations
Controller Driver (DCD & HCD)
-----------------------------
- Add new port support (WIP) for WCH CH32V307 USB Highspeed
- Add new port support (WIP) for PIC32MM/MX & PIC24
- [nRF]
- Fix endpoint internal state when closed
- Fix reception of large ISO packets
- [rp2040]
- [dcd] Implement workaround for Errata 15. This enable SOF when bulk-in endpoint is in use and reduce its bandwidth to only 80%
- [hcd] Fix shared irq slots filling up when hcd_init() is called multiple times
- [hcd] Support host bulk endpoint using hw "interrupt" endpoint. Note speed limit is 64KB/s
- [samd][dcd] Add support for ISO endpoint
- [dwc2][dcd] Add support for stm32u5xx
- [esp32sx] Fix Isochronous transfers only transmitted on even frame
- [lpc_ip3511][dcd] Add isochronous support and fix endpoint accidental write
- [ft90x] Improve and enhance support for FT9xx MCU, tested with more examples
Device Stack
------------
- [Video]
- Add support for MJPEG
- Fix probe on macOS
- [MIDI]
- Support port name strings
- fix MS Header wTotalLength computation
- [HID]
- Add FIDO descriptor template
- change length in tud_hid_report_complete_cb() from uint8 to uint16
- [CDC]
- Fix autoflush for FIFO < MPS
- Fix tx fifo memory overflown when DTR is not set and tud_cdc_write() is called repeatedly with large enough data
- [USBTMC] Fix packet size with highspeed
Host Stack
----------
- Retry a few times with transfers in enumeration since device can be unstable when starting up
- [MSC] Rework host masstorage API. Add new **host/msc_file_explorer** example
- [CDC]
- Add support for host cdc
- Fix host cdc with device without IAD e.g Arduino Due
0.14.0
======
@ -10,6 +82,7 @@ Changelog
- Add tud_task_ext(timeout, in_isr) as generic version of tud_task(). Same as tuh_task_ext(), tuh_task()
- Enable more warnings -Wnull-dereference -Wuninitialized -Wunused -Wredundant-decls -Wconversion
- Add new examples
- host/bare_api to demonstrate generic (app-level) enumeration and endpoint transfer
- dual/host_hid_to_device_cdc to run both device and host stack concurrently, get HID report from host and print out to device CDC. This example only work with multiple-controller MCUs and rp2040 with the help of pio-usb as added controller.
@ -17,10 +90,12 @@ Controller Driver (DCD & HCD)
-----------------------------
- Enhance rhports management to better support dual roles
- CFG_TUD_ENABLED/CFG_TUH_ENABLED, CFG_TUD_MAX_SPEED/CFG_TUH_MAX_SPEED can be used to replace CFG_TUSB_RHPORT0_MODE/CFG_TUSB_RHPORT1_MODE
- tud_init(rphort), tuh_init(rhport) can be used to init stack on specified roothub port (controller) instead of tusb_init(void)
- Add dcd/hcd port specific defines TUP_ (stand for tinyusb port-specific)
- Add dcd/hcd port specific defines `TUP_` (stand for tinyusb port-specific)
- [dwc2]
- Update to support stm32 h72x, h73x with only 1 otg controller
- Fix overwrite with grstctl when disable endpoint
- [EHCI] Fix an issue with EHCI driver
@ -28,6 +103,7 @@ Controller Driver (DCD & HCD)
- [nrf5x] Fix DMA access race condition using atomic function
- [pic32] Fix PIC32 santiy
- [rp2040]
- Add PICO-PIO-USB as controller (device/host) support for rp2040
- Use shared IRQ handlers, so user can also hook the USB IRQ
- Fix resumed signal not reported to device stack
@ -37,10 +113,12 @@ Device Stack
------------
- [Audio] Add support for feedback endpoint computation
- New API tud_audio_feedback_params_cb(), tud_audio_feedback_interval_isr().
- Supported computation method are: frequency with fixed/float or power of 2. Feedback with fifo count is not yet supported.
- Fix nitfs (should be 3) in TUD_AUDIO_HEADSET_STEREO_DESCRIPTOR
- Fix typo in audiod_rx_done_cb()
- [DFU] Fix coexistence with other interfaces BTH, RNDIS
- [MSC] Fix inquiry response additional length field
- [Venndor] Improve write performance
@ -52,14 +130,15 @@ Host Stack
- [HID] Open OUT endpoint if available
- [Hub] hub clear port and device interrupts
- [USBH] Major improvement
- Rework usbh control transfer with complete callback. New API tuh_control_xfer() though still only carry 1 usbh (no queueing) at a time.
- Add generic endpoint transfer with tuh_edpt_open(), tuh_edpt_xfer(). Require `CFG_TUH_API_EDPT_XFER=1`
- Support app-level enumeration with new APIs
- tuh_descriptor_get(), tuh_descriptor_get_device(), tuh_descriptor_get_configuration(), tuh_descriptor_get_hid_report()
- tuh_descriptor_get_string(), tuh_descriptor_get_manufacturer_string(), tuh_descriptor_get_product_string(), tuh_descriptor_get_serial_string()
- Also add _sync() as sync/blocking version for above APIs
0.13.0
======
@ -79,14 +158,14 @@ Controller Driver (DCD & HCD)
- [MUSB] Add new DCD and HCD for Mentor musb with TI MSP432E4
- [F1C100s] Add new DCD for Allwinner F1C100s family
- [PIC32MZ] Add new DCD for PIC32MZ
- [nRF] Fix/Enhance varous race condtion with: EASY DMA, request HFXO, EPOUT
- [nRF] Fix/Enhance various race condition with: EASY DMA, request HFXO, EPOUT
- [ChipIdea] rename Transdimension to more popular ChipIdea Highspeed,
- [RP2040] various update/fix for hcd/dcd
- [FT9XX] new DCD port for Bridgetek FT90x and FT93x devices
- [DA1469X] Fix resume
- [OHCI] Fix device array out of bound
Note: legacy drivers such as st/synopsys, nxp/transdimension are still present in this release but won't recieve more update and could be removed in the future.
Note: legacy drivers such as st/synopsys, nxp/transdimension are still present in this release but won't receive more update and could be removed in the future.
Device Stack
------------
@ -167,7 +246,7 @@ RP2040
^^^^^^
- Add RP2040 suspend & resume support
- Implement double buffer for both host and device (#891). Howver device EPOUT is still single bufferred due to techinical issue with short packet
- Implement double buffer for both host and device (#891). However device EPOUT is still single buffered due to techinical issue with short packet
Device Stack
------------
@ -176,7 +255,7 @@ USBD
^^^^
- Better support big endian mcu
- Add tuh_inited() and tud_inited(), will separte tusb_init/inited() to tud/tuh init/inited
- Add tuh_inited() and tud_inited(), will separate tusb_init/inited() to tud/tuh init/inited
- Add dcd_attr.h for defining common controller attribute such as max endpoints
Bluetooth
@ -221,8 +300,8 @@ Host Controller Driver (HCD)
RP2040
^^^^^^
- Implement double bufferred to fix E4 errata and boost performance
- Lots of rp2040 update and enhancment
- Implement double buffered to fix E4 errata and boost performance
- Lots of rp2040 update and enhancement
Host Stack
----------
@ -230,7 +309,7 @@ Host Stack
- Major update and rework most of host stack, still needs more improvement
- Lots of improvement and update in parsing configuration and control
- Rework and major update to HID driver. Will default to enable boot interface if available
- Sepearate CFG_TUH_DEVICE_MAX and CFG_TUH_HUB for better management and reduce SRAM usage
- Separate CFG_TUH_DEVICE_MAX and CFG_TUH_HUB for better management and reduce SRAM usage
0.10.1 (2021-06-03)
===================
@ -307,12 +386,12 @@ MIDI
Host Controller Driver (HCD)
----------------------------
- No noticable changes
- No noticeable changes
USB Host Driver (USBH)
----------------------
- No noticable changes
- No noticeable changes
Host Class Driver
-----------------
@ -385,7 +464,7 @@ HID
MIDI
- Fix dropping MIDI sysex message when fifo is full
- Fix typo in tud_midi_write24(), make example less ambigous for cable and channel
- Fix typo in tud_midi_write24(), make example less ambiguous for cable and channel
- Fix incorrect endpoint descriptor length, MIDI v1 use Audio v1 which has 9-byte endpoint descriptor (instead of 7)
Host Stack
@ -700,7 +779,7 @@ Changed
- Generalized dcd_stm32f4.c to dcd_synopsys.c
- Changed cdc_msc_hid to cdc_msc (drop hid) due to limited endpoints number of some MCUs
- Improved DCD SAMD stability, fix missing setup packet occasionally
- Improved usbd/usbd_control with proper hanlding of zero-length packet (ZLP)
- Improved usbd/usbd_control with proper handling of zero-length packet (ZLP)
- Improved STM32 DCD FSDev
- Improved STM32 DCD Synopsys
- Migrated CI from Travis to Github Action

View file

@ -0,0 +1,64 @@
************
Dependencies
************
MCU low-level peripheral driver and external libraries for building TinyUSB examples
======================================== ============================================================== ========================================
Path Project Commit
======================================== ============================================================== ========================================
hw/mcu/allwinner https://github.com/hathach/allwinner_driver.git 8e5e89e8e132c0fd90e72d5422e5d3d68232b756
hw/mcu/bridgetek/ft9xx/ft90x-sdk https://github.com/BRTSG-FOSS/ft90x-sdk.git 91060164afe239fcb394122e8bf9eb24d3194eb1
hw/mcu/broadcom https://github.com/adafruit/broadcom-peripherals.git 08370086080759ed54ac1136d62d2ad24c6fa267
hw/mcu/gd/nuclei-sdk https://github.com/Nuclei-Software/nuclei-sdk.git 7eb7bfa9ea4fbeacfafe1d5f77d5a0e6ed3922e7
hw/mcu/infineon/mtb-xmclib-cat3 https://github.com/Infineon/mtb-xmclib-cat3.git daf5500d03cba23e68c2f241c30af79cd9d63880
hw/mcu/microchip https://github.com/hathach/microchip_driver.git 9e8b37e307d8404033bb881623a113931e1edf27
hw/mcu/mindmotion/mm32sdk https://github.com/hathach/mm32sdk.git 0b79559eb411149d36e073c1635c620e576308d4
hw/mcu/nordic/nrfx https://github.com/NordicSemiconductor/nrfx.git 281cc2e178fd9a470d844b3afdea9eb322a0b0e8
hw/mcu/nuvoton https://github.com/majbthrd/nuc_driver.git 2204191ec76283371419fbcec207da02e1bc22fa
hw/mcu/nxp/lpcopen https://github.com/hathach/nxp_lpcopen.git 43c45c85405a5dd114fff0ea95cca62837740c13
hw/mcu/nxp/mcux-sdk https://github.com/NXPmicro/mcux-sdk.git ae2ab01d9d70ad00cd0e935c2552bd5f0e5c0294
hw/mcu/nxp/nxp_sdk https://github.com/hathach/nxp_sdk.git 845c8fc49b6fb660f06a5c45225494eacb06f00c
hw/mcu/raspberry_pi/Pico-PIO-USB https://github.com/sekigon-gonnoc/Pico-PIO-USB.git c3715ce94b6f6391856de56081d4d9b3e98fa93d
hw/mcu/renesas/fsp https://github.com/renesas/fsp.git 8dc14709f2a6518b43f71efad70d900b7718d9f1
hw/mcu/renesas/rx https://github.com/kkitayam/rx_device.git 706b4e0cf485605c32351e2f90f5698267996023
hw/mcu/silabs/cmsis-dfp-efm32gg12b https://github.com/cmsis-packs/cmsis-dfp-efm32gg12b.git f1c31b7887669cb230b3ea63f9b56769078960bc
hw/mcu/sony/cxd56/spresense-exported-sdk https://github.com/sonydevworld/spresense-exported-sdk.git 2ec2a1538362696118dc3fdf56f33dacaf8f4067
hw/mcu/st/cmsis_device_f0 https://github.com/STMicroelectronics/cmsis_device_f0.git 2fc25ee22264bc27034358be0bd400b893ef837e
hw/mcu/st/cmsis_device_f1 https://github.com/STMicroelectronics/cmsis_device_f1.git 6601104a6397299b7304fd5bcd9a491f56cb23a6
hw/mcu/st/cmsis_device_f2 https://github.com/STMicroelectronics/cmsis_device_f2.git 182fcb3681ce116816feb41b7764f1b019ce796f
hw/mcu/st/cmsis_device_f3 https://github.com/STMicroelectronics/cmsis_device_f3.git 5e4ee5ed7a7b6c85176bb70a9fd3c72d6eb99f1b
hw/mcu/st/cmsis_device_f4 https://github.com/STMicroelectronics/cmsis_device_f4.git 2615e866fa48fe1ff1af9e31c348813f2b19e7ec
hw/mcu/st/cmsis_device_f7 https://github.com/STMicroelectronics/cmsis_device_f7.git fc676ef1ad177eb874eaa06444d3d75395fc51f4
hw/mcu/st/cmsis_device_g0 https://github.com/STMicroelectronics/cmsis_device_g0.git 08258b28ee95f50cb9624d152a1cbf084be1f9a5
hw/mcu/st/cmsis_device_g4 https://github.com/STMicroelectronics/cmsis_device_g4.git ce822adb1dc552b3aedd13621edbc7fdae124878
hw/mcu/st/cmsis_device_h7 https://github.com/STMicroelectronics/cmsis_device_h7.git 60dc2c913203dc8629dc233d4384dcc41c91e77f
hw/mcu/st/cmsis_device_l0 https://github.com/STMicroelectronics/cmsis_device_l0.git 06748ca1f93827befdb8b794402320d94d02004f
hw/mcu/st/cmsis_device_l1 https://github.com/STMicroelectronics/cmsis_device_l1.git 7f16ec0a1c4c063f84160b4cc6bf88ad554a823e
hw/mcu/st/cmsis_device_l4 https://github.com/STMicroelectronics/cmsis_device_l4.git 6ca7312fa6a5a460b5a5a63d66da527fdd8359a6
hw/mcu/st/cmsis_device_l5 https://github.com/STMicroelectronics/cmsis_device_l5.git d922865fc0326a102c26211c44b8e42f52c1e53d
hw/mcu/st/cmsis_device_u5 https://github.com/STMicroelectronics/cmsis_device_u5.git bc00f3c9d8a4e25220f84c26d414902cc6bdf566
hw/mcu/st/cmsis_device_wb https://github.com/STMicroelectronics/cmsis_device_wb.git 9c5d1920dd9fabbe2548e10561d63db829bb744f
hw/mcu/st/stm32f0xx_hal_driver https://github.com/STMicroelectronics/stm32f0xx_hal_driver.git 0e95cd88657030f640a11e690a8a5186c7712ea5
hw/mcu/st/stm32f1xx_hal_driver https://github.com/STMicroelectronics/stm32f1xx_hal_driver.git 1dd9d3662fb7eb2a7f7d3bc0a4c1dc7537915a29
hw/mcu/st/stm32f2xx_hal_driver https://github.com/STMicroelectronics/stm32f2xx_hal_driver.git c75ace9b908a9aca631193ebf2466963b8ea33d0
hw/mcu/st/stm32f3xx_hal_driver https://github.com/STMicroelectronics/stm32f3xx_hal_driver.git 1761b6207318ede021706e75aae78f452d72b6fa
hw/mcu/st/stm32f4xx_hal_driver https://github.com/STMicroelectronics/stm32f4xx_hal_driver.git 04e99fbdabd00ab8f370f377c66b0a4570365b58
hw/mcu/st/stm32f7xx_hal_driver https://github.com/STMicroelectronics/stm32f7xx_hal_driver.git f7ffdf6bf72110e58b42c632b0a051df5997e4ee
hw/mcu/st/stm32g0xx_hal_driver https://github.com/STMicroelectronics/stm32g0xx_hal_driver.git 5b53e6cee664a82b16c86491aa0060e2110c00cb
hw/mcu/st/stm32g4xx_hal_driver https://github.com/STMicroelectronics/stm32g4xx_hal_driver.git 8b4518417706d42eef5c14e56a650005abf478a8
hw/mcu/st/stm32h7xx_hal_driver https://github.com/STMicroelectronics/stm32h7xx_hal_driver.git d8461b980b59b1625207d8c4f2ce0a9c2a7a3b04
hw/mcu/st/stm32l0xx_hal_driver https://github.com/STMicroelectronics/stm32l0xx_hal_driver.git fbdacaf6f8c82a4e1eb9bd74ba650b491e97e17b
hw/mcu/st/stm32l1xx_hal_driver https://github.com/STMicroelectronics/stm32l1xx_hal_driver.git 44efc446fa69ed8344e7fd966e68ed11043b35d9
hw/mcu/st/stm32l4xx_hal_driver https://github.com/STMicroelectronics/stm32l4xx_hal_driver.git aee3d5bf283ae5df87532b781bdd01b7caf256fc
hw/mcu/st/stm32l5xx_hal_driver https://github.com/STMicroelectronics/stm32l5xx_hal_driver.git 675c32a75df37f39d50d61f51cb0dcf53f07e1cb
hw/mcu/st/stm32u5xx_hal_driver https://github.com/STMicroelectronics/stm32u5xx_hal_driver.git 2e1d4cdb386e33391cb261dfff4fefa92e4aa35a
hw/mcu/st/stm32wbxx_hal_driver https://github.com/STMicroelectronics/stm32wbxx_hal_driver.git 2c5f06638be516c1b772f768456ba637f077bac8
hw/mcu/ti https://github.com/hathach/ti_driver.git 143ed6cc20a7615d042b03b21e070197d473e6e5
hw/mcu/wch/ch32v307 https://github.com/openwch/ch32v307.git 17761f5cf9dbbf2dcf665b7c04934188add20082
lib/CMSIS_5 https://github.com/ARM-software/CMSIS_5.git 20285262657d1b482d132d20d755c8c330d55c1f
lib/FreeRTOS-Kernel https://github.com/FreeRTOS/FreeRTOS-Kernel.git def7d2df2b0506d3d249334974f51e427c17a41c
lib/lwip https://github.com/lwip-tcpip/lwip.git 159e31b689577dbf69cf0683bbaffbd71fa5ee10
lib/sct_neopixel https://github.com/gsteiert/sct_neopixel.git e73e04ca63495672d955f9268e003cffe168fcd8
tools/uf2 https://github.com/microsoft/uf2.git 19615407727073e36d81bf239c52108ba92e7660
======================================== ============================================================== ========================================

View file

@ -44,12 +44,6 @@ For your convenience, TinyUSB contains a handful of examples for both host and d
$ git clone https://github.com/hathach/tinyusb tinyusb
$ cd tinyusb
Some TinyUSB examples also requires external submodule libraries in ``/lib`` such as FreeRTOS, Lightweight IP to build. Run following command to fetch them
.. code-block::
$ git submodule update --init lib
Some ports will also require a port-specific SDK (e.g. RP2040) or binary (e.g. Sony Spresense) to build examples. They are out of scope for tinyusb, you should download/install it first according to its manufacturer guide.
Build
@ -61,23 +55,25 @@ To build example, first change directory to an example folder.
$ cd examples/device/cdc_msc
Before building, we need to download MCU driver submodule to provide low-level MCU peripheral's driver first. Run the ``get-dpes`` target in one of the example folder as follow. You only need to do this once per mcu
Before building, we firstly need to download dependencies such as: MCU low-level peripheral driver and external libraries e.g FreeRTOS (required by some examples). Run the ``get-deps`` target in one of the example folder as follow. You only need to do this once per mcu. Check out `complete list of dependencies and their designated path here <dependencies.rst>`_
.. code-block::
$ make BOARD=feather_nrf52840_express get-deps
Some modules (e.g. RP2040 and ESP32s2) require the project makefiles to be customized using CMake. If necessary apply any setup steps for the platform's SDK.
$ make BOARD=raspberry_pi_pico get-deps
Then compile with ``make BOARD=[board_name] all``\ , for example
.. code-block::
$ make BOARD=feather_nrf52840_express all
$ make BOARD=raspberry_pi_pico all
Note: ``BOARD`` can be found as directory name in ``hw/bsp``\ , either in its family/boards or directly under bsp (no family).
Note: some examples especially those that uses Vendor class (e.g webUSB) may requires udev permission on Linux (and/or macOS) to access usb device. It depends on your OS distro, typically copy ``/examples/device/99-tinyusb.rules`` file to /etc/udev/rules.d/ then run ``sudo udevadm control --reload-rules && sudo udevadm trigger`` is good enough.
Note: some examples especially those that uses Vendor class (e.g webUSB) may requires udev permission on Linux (and/or macOS) to access usb device. It depends on your OS distro, typically copy ``99-tinyusb.rules`` and reload your udev is good to go
.. code-block::
$ cp examples/device/99-tinyusb.rules /etc/udev/rules.d/
$ sudo udevadm control --reload-rules && sudo udevadm trigger
Port Selection
~~~~~~~~~~~~~~

View file

@ -56,4 +56,5 @@ Index
supported
getting_started
dependencies
concurrency

View file

@ -61,9 +61,11 @@ Supported MCUs
| | | 55 | ✔ | | ✔ | lpc_ip3511 | |
+--------------+---------+-------------+--------+------+-----------+-------------------+--------------+
| Raspberry Pi | RP2040 | ✔ | ✔ | ✖ | rp2040, pio_usb | |
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
| Renesas | RX 63N, 65N, 72N | ✔ | ✔ | ✖ | usba | |
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+
| Renesas | RX | 63N, 65N, 72N | ✔ | ✔ | ✖ | rusb2 | |
| +-----+-----------------+--------+------+-----------+-------------------+--------------+
| | RA | XXX | ✔ | ✔ | | rusb2 | |
+--------------+-----+-----------------+--------+------+-----------+-------------------+--------------+
| Silabs | EFM32GG12 | ✔ | | ✖ | dwc2 | |
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
| Sony | CXD56 | ✔ | ✖ | ✔ | cxd56 | |
@ -106,6 +108,8 @@ Supported MCUs
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
| ValentyUSB | eptri | ✔ | ✖ | ✖ | eptri | |
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
| WCH | CH32V307 | ✔ | | ✔ | ch32v307 | |
+--------------+-----------------------+--------+------+-----------+-------------------+--------------+
Table Legend
@ -171,7 +175,7 @@ SAMD11 & SAMD21
- `Adafruit Feather M0 Express <https://www.adafruit.com/product/3403>`__
- `Adafruit ItsyBitsy M0 Express <https://www.adafruit.com/product/3727>`__
- `Adafruit Metro M0 Express <https://www.adafruit.com/product/3505>`__
- `Great Scott Gadgets LUNA <https://greatscottgadgets.com/luna/>`__
- `Great Scott Gadgets Cynthion <https://greatscottgadgets.com/cynthion/>`__
- `Microchip SAMD11 Xplained Pro <https://www.microchip.com/developmenttools/ProductDetails/atsamd11-xpro>`__
- `Microchip SAMD21 Xplained Pro <https://www.microchip.com/DevelopmentTools/ProductDetails/ATSAMD21-XPRO>`__
- `Seeeduino Xiao <https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html>`__
@ -249,6 +253,7 @@ Kinetis
^^^^^^^
- `Freedom FRDM-KL25Z <https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/freedom-development-platform-for-kinetis-kl14-kl15-kl24-kl25-mcus:FRDM-KL25Z>`__
- `Freedom FRDM-K32L2A4S <https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/nxp-freedom-platform-for-k32-l2a-mcus:FRDM-K32L2A4S>`__
- `Freedom FRDM-K32L2B3 <https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/nxp-freedom-development-platform-for-k32-l2b-mcus:FRDM-K32L2B3>`__
- `KUIIC <https://github.com/nxf58843/kuiic>`__
@ -293,8 +298,17 @@ LPC55
- `LPCXpresso 55s69 EVK <https://www.nxp.com/design/development-boards/lpcxpresso-boards/lpcxpresso55s69-development-board:LPC55S69-EVK>`__
- `MCU-Link <https://www.nxp.com/design/development-boards/lpcxpresso-boards/mcu-link-debug-probe:MCU-LINK>`__
Renesas RX
----------
Renesas
-------
RA
^^
- `Evaluation Kit for RA4M1 <https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ek-ra4m1-evaluation-kit-ra4m1-mcu-group>`__
- `Evaluation Kit for RA4M3 <https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ek-ra4m3-evaluation-kit-ra4m3-mcu-group>`__
RX
^^
- `GR-CITRUS <https://www.renesas.com/us/en/products/gadget-renesas/boards/gr-citrus>`__
- `Renesas RX65N Target Board <https://www.renesas.com/us/en/products/microcontrollers-microprocessors/rx-32-bit-performance-efficiency-mcus/rtk5rx65n0c00000br-target-board-rx65n>`__
@ -397,3 +411,8 @@ Tomu
----
- `Fomu <https://www.crowdsupply.com/sutajio-kosagi/fomu>`__
WCH
---
- `CH32V307V-R1-1v0 <https://lcsc.com/product-detail/Development-Boards-Kits_WCH-Jiangsu-Qin-Heng-CH32V307V-EVT-R1_C2943980.html>`

View file

@ -1,4 +1,4 @@
sphinx~=3.0
sphinx>=5.0
furo>=2020.12.30.b24
sphinx-autodoc-typehints>=1.10
jinja2==3.0.3
jinja2>=3.0.3

11
examples/CMakeLists.txt Normal file
View file

@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.17)
#set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(${CMAKE_CURRENT_SOURCE_DIR}/../hw/bsp/family_support.cmake)
project(tinyusb_examples C CXX ASM)
add_subdirectory(device)
add_subdirectory(dual)
add_subdirectory(host)
add_subdirectory(typec)

View file

@ -1,20 +1,23 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.17)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
project(tinyusb_device_examples)
project(tinyusb_device_examples C CXX ASM)
family_initialize_project(tinyusb_device_examples ${CMAKE_CURRENT_LIST_DIR})
# family_add_subdirectory will filter what to actually add based on selected FAMILY
family_add_subdirectory(audio_4_channel_mic)
family_add_subdirectory(audio_test)
family_add_subdirectory(audio_test_multi_rate)
family_add_subdirectory(board_test)
family_add_subdirectory(cdc_dual_ports)
family_add_subdirectory(cdc_msc)
family_add_subdirectory(cdc_msc_freertos)
family_add_subdirectory(cdc_uac2)
family_add_subdirectory(dfu)
family_add_subdirectory(dfu_runtime)
family_add_subdirectory(dynamic_configuration)
family_add_subdirectory(hid_boot_interface)
family_add_subdirectory(hid_composite)
family_add_subdirectory(hid_composite_freertos)
family_add_subdirectory(hid_generic_inout)

View file

@ -1,15 +1,20 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.17)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
project(${PROJECT})
project(${PROJECT} C CXX ASM)
# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
# Espressif has its own cmake build system
if(FAMILY STREQUAL "espressif")
return()
endif()
add_executable(${PROJECT})
# Example source
@ -23,6 +28,11 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
# Add libm for GCC
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_link_libraries(${PROJECT} PUBLIC m)
endif()
# Configure compilation flags and libraries for the example without RTOS.
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT} noos)

View file

@ -1,4 +1,3 @@
include ../../../tools/top.mk
include ../../make.mk
INC += \
@ -6,7 +5,10 @@ INC += \
$(TOP)/hw \
# Example source
EXAMPLE_SOURCE += $(wildcard src/*.c)
EXAMPLE_SOURCE += \
src/main.c \
src/usb_descriptors.c \
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
include ../../rules.mk

View file

@ -1,3 +1,4 @@
mcu:SAMD11
mcu:SAME5X
mcu:SAMG
family:broadcom_64bit

View file

@ -34,17 +34,16 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "bsp/board.h"
#include "bsp/board_api.h"
#include "tusb.h"
#include "tusb_config.h"
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF PROTYPES
//--------------------------------------------------------------------+
#ifndef AUDIO_SAMPLE_RATE
#define AUDIO_SAMPLE_RATE 48000
#endif
#define AUDIO_SAMPLE_RATE CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE
/* Blink pattern
* - 250 ms : device not mounted
@ -70,8 +69,13 @@ uint8_t clkValid;
audio_control_range_2_n_t(1) volumeRng[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX+1]; // Volume range state
audio_control_range_4_n_t(1) sampleFreqRng; // Sample frequency range state
// Audio test data
#if CFG_TUD_AUDIO_ENABLE_ENCODING
// Audio test data, each buffer contains 2 channels, buffer[0] for CH0-1, buffer[1] for CH1-2
uint16_t i2s_dummy_buffer[CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO][CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ/2]; // Ensure half word aligned
#else
// Audio test data, 4 channels muxed together, buffer[0] for CH0, buffer[1] for CH1, buffer[2] for CH2, buffer[3] for CH3
uint16_t i2s_dummy_buffer[CFG_TUD_AUDIO_EP_SZ_IN]; // Ensure half word aligned
#endif
void led_blinking_task(void);
void audio_task(void);
@ -84,6 +88,10 @@ int main(void)
// init device stack on configured roothub port
tud_init(BOARD_TUD_RHPORT);
if (board_init_after_tusb) {
board_init_after_tusb();
}
// Init values
sampFreq = AUDIO_SAMPLE_RATE;
clkValid = 1;
@ -93,15 +101,51 @@ int main(void)
sampleFreqRng.subrange[0].bMax = AUDIO_SAMPLE_RATE;
sampleFreqRng.subrange[0].bRes = 0;
// Generate dummy data
#if CFG_TUD_AUDIO_ENABLE_ENCODING
uint16_t * p_buff = i2s_dummy_buffer[0];
uint16_t dataVal = 1;
for (uint16_t cnt = 0; cnt < AUDIO_SAMPLE_RATE/1000; cnt++)
{
// CH0 saw wave
*p_buff++ = dataVal;
// CH1 inverted saw wave
*p_buff++ = 60 + AUDIO_SAMPLE_RATE/1000 - dataVal;
dataVal++;
}
p_buff = i2s_dummy_buffer[1];
for (uint16_t cnt = 0; cnt < AUDIO_SAMPLE_RATE/1000; cnt++)
{
// CH3 square wave
*p_buff++ = cnt < (AUDIO_SAMPLE_RATE/1000/2) ? 120:170;
// CH4 sinus wave
float t = 2*3.1415f * cnt / (AUDIO_SAMPLE_RATE/1000);
*p_buff++ = (uint16_t)(sinf(t) * 25) + 200;
}
#else
uint16_t * p_buff = i2s_dummy_buffer;
uint16_t dataVal = 1;
for (uint16_t cnt = 0; cnt < AUDIO_SAMPLE_RATE/1000; cnt++)
{
// CH0 saw wave
*p_buff++ = dataVal;
// CH1 inverted saw wave
*p_buff++ = 60 + AUDIO_SAMPLE_RATE/1000 - dataVal;
dataVal++;
// CH3 square wave
*p_buff++ = cnt < (AUDIO_SAMPLE_RATE/1000/2) ? 120:170;
// CH4 sinus wave
float t = 2*3.1415f * cnt / (AUDIO_SAMPLE_RATE/1000);
*p_buff++ = (uint16_t)(sinf(t) * 25) + 200;
}
#endif
while (1)
{
tud_task(); // tinyusb device task
led_blinking_task();
audio_task();
}
return 0;
}
//--------------------------------------------------------------------+
@ -132,7 +176,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
// Invoked when usb bus is resumed
void tud_resume_cb(void)
{
blink_interval_ms = BLINK_MOUNTED;
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
}
//--------------------------------------------------------------------+
@ -290,7 +334,7 @@ bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const *
// Those are dummy values for now
ret.bNrChannels = 1;
ret.bmChannelConfig = 0;
ret.bmChannelConfig = (audio_channel_config_t) 0;
ret.iChannelNames = 0;
TU_LOG2(" Get terminal connector\r\n");
@ -363,7 +407,8 @@ bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const *
{
case AUDIO_CS_REQ_CUR:
TU_LOG2(" Get Sample Freq.\r\n");
return tud_control_xfer(rhport, p_request, &sampFreq, sizeof(sampFreq));
// Buffered control transfer is needed for IN flow control to work
return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, &sampFreq, sizeof(sampFreq));
case AUDIO_CS_REQ_RANGE:
TU_LOG2(" Get Sample Freq. range\r\n");
@ -399,11 +444,24 @@ bool tud_audio_tx_done_pre_load_cb(uint8_t rhport, uint8_t itf, uint8_t ep_in, u
(void) ep_in;
(void) cur_alt_setting;
for (uint8_t cnt=0; cnt < CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO; cnt++)
// In read world application data flow is driven by I2S clock,
// both tud_audio_tx_done_pre_load_cb() & tud_audio_tx_done_post_load_cb() are hardly used.
// For example in your I2S receive callback:
// void I2S_Rx_Callback(int channel, const void* data, uint16_t samples)
// {
// tud_audio_write_support_ff(channel, data, samples * N_BYTES_PER_SAMPLE * N_CHANNEL_PER_FIFO);
// }
#if CFG_TUD_AUDIO_ENABLE_ENCODING
// Write I2S buffer into FIFO
for (uint8_t cnt=0; cnt < 2; cnt++)
{
tud_audio_write_support_ff(cnt, i2s_dummy_buffer[cnt], AUDIO_SAMPLE_RATE/1000 * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX);
}
#else
tud_audio_write(i2s_dummy_buffer, AUDIO_SAMPLE_RATE/1000 * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX);
#endif
return true;
}
@ -415,22 +473,6 @@ bool tud_audio_tx_done_post_load_cb(uint8_t rhport, uint16_t n_bytes_copied, uin
(void) ep_in;
(void) cur_alt_setting;
uint16_t dataVal;
// Generate dummy data
for (uint16_t cnt = 0; cnt < CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO; cnt++)
{
uint16_t * p_buff = i2s_dummy_buffer[cnt]; // 2 bytes per sample
dataVal = 1;
for (uint16_t cnt2 = 0; cnt2 < AUDIO_SAMPLE_RATE/1000; cnt2++)
{
for (uint8_t cnt3 = 0; cnt3 < CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX; cnt3++)
{
*p_buff++ = dataVal;
}
dataVal++;
}
}
return true;
}

View file

@ -10,11 +10,11 @@ if __name__ == '__main__':
# print(sd.query_devices())
fs = 48000 # Sample rate
duration = 100e-3 # Duration of recording
duration = 1 # Duration of recording
if platform.system() == 'Windows':
# WDM-KS is needed since there are more than one MicNode device APIs (at least in Windows)
device = 'Microphone (MicNode_4_Ch), Windows WDM-KS'
device = 'Microphone (MicNode_4_Ch), Windows WASAPI'
elif platform.system() == 'Darwin':
device = 'MicNode_4_Ch'
else:
@ -25,10 +25,13 @@ if __name__ == '__main__':
sd.wait() # Wait until recording is finished
print('Done!')
time = np.arange(0, duration, 1 / fs) # time vector
# strip starting zero
plt.plot(time, myrecording)
plt.xlabel('Time [s]')
plt.ylabel('Amplitude')
plt.title('MicNode 4 Channel')
plt.legend(['CH-1', 'CH-2', 'CH-3','CH-4'])
plt.show()

View file

@ -103,6 +103,7 @@ extern "C" {
//--------------------------------------------------------------------
// Have a look into audio_device.h for all configurations
#define CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE 48000
#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_MIC_FOUR_CH_DESC_LEN
@ -112,15 +113,27 @@ extern "C" {
#define CFG_TUD_AUDIO_ENABLE_EP_IN 1
#define CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX 2 // This value is not required by the driver, it parses this information from the descriptor once the alternate interface is set by the host - we use it for the setup
#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 4 // This value is not required by the driver, it parses this information from the descriptor once the alternate interface is set by the host - we use it for the setup
#define CFG_TUD_AUDIO_EP_SZ_IN (48 + 1) * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX // 48 Samples (48 kHz) x 2 Bytes/Sample x CFG_TUD_AUDIO_N_CHANNELS_TX Channels - the Windows driver always needs an extra sample per channel of space more, otherwise it complains... found by trial and error
#define CFG_TUD_AUDIO_EP_SZ_IN TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX)
#define CFG_TUD_AUDIO_ENABLE_ENCODING 1
#define CFG_TUD_AUDIO_EP_IN_FLOW_CONTROL 1
#if CFG_TUD_AUDIO_ENABLE_ENCODING
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_EP_SZ_IN
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ CFG_TUD_AUDIO_EP_SZ_IN
#define CFG_TUD_AUDIO_ENABLE_ENCODING 1
#define CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING 1
#define CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX 2 // One I2S stream contains two channels, each stream is saved within one support FIFO - this value is currently fixed, the driver does not support a changing value
#define CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO (CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX / CFG_TUD_AUDIO_FUNC_1_CHANNEL_PER_FIFO_TX)
#define CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ (CFG_TUD_AUDIO_EP_SZ_IN / CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO)
#define CFG_TUD_AUDIO_FUNC_1_TX_SUPP_SW_FIFO_SZ 4 * (CFG_TUD_AUDIO_EP_SZ_IN / CFG_TUD_AUDIO_FUNC_1_N_TX_SUPP_SW_FIFO) // Minimum 4*EP size is needed for flow control
#else
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_EP_SZ_IN
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ 4 * CFG_TUD_AUDIO_EP_SZ_IN // Minimum 4*EP size is needed for flow control
#endif
#ifdef __cplusplus
}

View file

@ -23,6 +23,7 @@
*
*/
#include "bsp/board_api.h"
#include "tusb.h"
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
@ -44,7 +45,7 @@ tusb_desc_device_t const desc_device =
.bDescriptorType = TUSB_DESC_DEVICE,
.bcdUSB = 0x0200,
// Use Interface Association Descriptor (IAD) for CDC
// Use Interface Association Descriptor (IAD) for Audio
// As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
.bDeviceClass = TUSB_CLASS_MISC,
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
@ -96,7 +97,7 @@ enum
uint8_t const desc_configuration[] =
{
// Interface count, string index, total length, attribute, power in mA
// Config number, interface count, string index, total length, attribute, power in mA
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
// Interface number, string index, EP Out & EP In address, EP size
@ -116,46 +117,59 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
// String Descriptors
//--------------------------------------------------------------------+
// String Descriptor Index
enum {
STRID_LANGID = 0,
STRID_MANUFACTURER,
STRID_PRODUCT,
STRID_SERIAL,
};
// array of pointer to string descriptors
char const* string_desc_arr [] =
{
char const* string_desc_arr [] = {
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
"PaniRCorp", // 1: Manufacturer
"MicNode_4_Ch", // 2: Product
"123458", // 3: Serials, should use chip ID
NULL, // 3: Serials will use unique ID if possible
"UAC2", // 4: Audio Interface
};
static uint16_t _desc_str[32];
static uint16_t _desc_str[32 + 1];
// Invoked when received GET STRING DESCRIPTOR request
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
{
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
(void) langid;
size_t chr_count;
uint8_t chr_count;
if ( index == 0)
{
switch ( index ) {
case STRID_LANGID:
memcpy(&_desc_str[1], string_desc_arr[0], 2);
chr_count = 1;
}else
{
// Convert ASCII string into UTF-16
break;
case STRID_SERIAL:
chr_count = board_usb_get_serial(_desc_str + 1, 32);
break;
default:
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
const char *str = string_desc_arr[index];
// Cap at max char
chr_count = (uint8_t) strlen(str);
if ( chr_count > 31 ) chr_count = 31;
chr_count = strlen(str);
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
if ( chr_count > max_count ) chr_count = max_count;
for(uint8_t i=0; i<chr_count; i++)
{
// Convert ASCII string into UTF-16
for ( size_t i = 0; i < chr_count; i++ ) {
_desc_str[1 + i] = str[i];
}
break;
}
// first byte is length (including header), second byte is string type

View file

@ -1,15 +1,20 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.17)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
project(${PROJECT})
project(${PROJECT} C CXX ASM)
# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
# Espressif has its own cmake build system
if(FAMILY STREQUAL "espressif")
return()
endif()
add_executable(${PROJECT})
# Example source
@ -23,6 +28,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
# Configure compilation flags and libraries for the example without RTOS.
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT} noos)

View file

@ -1,4 +1,3 @@
include ../../../tools/top.mk
include ../../make.mk
INC += \

View file

@ -35,7 +35,7 @@
#include <stdio.h>
#include <string.h>
#include "bsp/board.h"
#include "bsp/board_api.h"
#include "tusb.h"
//--------------------------------------------------------------------+
@ -71,7 +71,7 @@ audio_control_range_2_n_t(1) volumeRng[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX+1];
audio_control_range_4_n_t(1) sampleFreqRng; // Sample frequency range state
// Audio test data
uint16_t test_buffer_audio[CFG_TUD_AUDIO_EP_SZ_IN/2];
uint16_t test_buffer_audio[(CFG_TUD_AUDIO_EP_SZ_IN - 2) / 2];
uint16_t startVal = 0;
void led_blinking_task(void);
@ -85,6 +85,10 @@ int main(void)
// init device stack on configured roothub port
tud_init(BOARD_TUD_RHPORT);
if (board_init_after_tusb) {
board_init_after_tusb();
}
// Init values
sampFreq = AUDIO_SAMPLE_RATE;
clkValid = 1;
@ -100,9 +104,6 @@ int main(void)
led_blinking_task();
audio_task();
}
return 0;
}
//--------------------------------------------------------------------+
@ -133,7 +134,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
// Invoked when usb bus is resumed
void tud_resume_cb(void)
{
blink_interval_ms = BLINK_MOUNTED;
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
}
//--------------------------------------------------------------------+
@ -291,7 +292,7 @@ bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const *
// Those are dummy values for now
ret.bNrChannels = 1;
ret.bmChannelConfig = 0;
ret.bmChannelConfig = (audio_channel_config_t) 0;
ret.iChannelNames = 0;
TU_LOG2(" Get terminal connector\r\n");
@ -400,7 +401,7 @@ bool tud_audio_tx_done_pre_load_cb(uint8_t rhport, uint8_t itf, uint8_t ep_in, u
(void) ep_in;
(void) cur_alt_setting;
tud_audio_write ((uint8_t *)test_buffer_audio, CFG_TUD_AUDIO_EP_SZ_IN);
tud_audio_write ((uint8_t *)test_buffer_audio, CFG_TUD_AUDIO_EP_SZ_IN - 2);
return true;
}
@ -413,7 +414,7 @@ bool tud_audio_tx_done_post_load_cb(uint8_t rhport, uint16_t n_bytes_copied, uin
(void) ep_in;
(void) cur_alt_setting;
for (size_t cnt = 0; cnt < CFG_TUD_AUDIO_EP_SZ_IN/2; cnt++)
for (size_t cnt = 0; cnt < (CFG_TUD_AUDIO_EP_SZ_IN - 2) / 2; cnt++)
{
test_buffer_audio[cnt] = startVal++;
}

View file

@ -2,6 +2,7 @@ import sounddevice as sd
import matplotlib.pyplot as plt
import numpy as np
import platform
import csv
if __name__ == '__main__':
@ -32,3 +33,5 @@ if __name__ == '__main__':
plt.title('MicNode')
plt.show()
samples = np.array(myrecording)
np.savetxt('Output.csv', samples, delimiter=",", fmt='%s')

View file

@ -114,7 +114,7 @@ extern "C" {
#define CFG_TUD_AUDIO_ENABLE_EP_IN 1
#define CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX 2 // Driver gets this info from the descriptors - we define it here to use it to setup the descriptors and to do calculations with it below
#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 1 // Driver gets this info from the descriptors - we define it here to use it to setup the descriptors and to do calculations with it below - be aware: for different number of channels you need another descriptor!
#define CFG_TUD_AUDIO_EP_SZ_IN 48 * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX // 48 Samples (48 kHz) x 2 Bytes/Sample x 1 Channel
#define CFG_TUD_AUDIO_EP_SZ_IN (48 + 1) * CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX * CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX // 48 Samples (48 kHz) x 2 Bytes/Sample x CFG_TUD_AUDIO_N_CHANNELS_TX Channels - One extra sample is needed for asynchronous transfer adjustment, see feedback EP
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX CFG_TUD_AUDIO_EP_SZ_IN // Maximum EP IN size for all AS alternate settings used
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ CFG_TUD_AUDIO_EP_SZ_IN + 1

View file

@ -23,6 +23,7 @@
*
*/
#include "bsp/board_api.h"
#include "tusb.h"
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
@ -44,7 +45,7 @@ tusb_desc_device_t const desc_device =
.bDescriptorType = TUSB_DESC_DEVICE,
.bcdUSB = 0x0200,
// Use Interface Association Descriptor (IAD) for CDC
// Use Interface Association Descriptor (IAD) for Audio
// As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
.bDeviceClass = TUSB_CLASS_MISC,
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
@ -96,7 +97,7 @@ enum
uint8_t const desc_configuration[] =
{
// Interface count, string index, total length, attribute, power in mA
// Config number, interface count, string index, total length, attribute, power in mA
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
// Interface number, string index, EP Out & EP In address, EP size
@ -116,46 +117,61 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
// String Descriptors
//--------------------------------------------------------------------+
// String Descriptor Index
enum {
STRID_LANGID = 0,
STRID_MANUFACTURER,
STRID_PRODUCT,
STRID_SERIAL,
};
// array of pointer to string descriptors
char const* string_desc_arr [] =
{
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
"PaniRCorp", // 1: Manufacturer
"MicNode", // 2: Product
"123456", // 3: Serials, should use chip ID
NULL, // 3: Serials will use unique ID if possible
"UAC2", // 4: Audio Interface
};
static uint16_t _desc_str[32];
static uint16_t _desc_str[32 + 1];
// Invoked when received GET STRING DESCRIPTOR request
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
{
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
(void) langid;
size_t chr_count;
uint8_t chr_count;
if ( index == 0)
{
switch ( index ) {
case STRID_LANGID:
memcpy(&_desc_str[1], string_desc_arr[0], 2);
chr_count = 1;
}else
{
// Convert ASCII string into UTF-16
break;
case STRID_SERIAL:
chr_count = board_usb_get_serial(_desc_str + 1, 32);
break;
default:
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
const char *str = string_desc_arr[index];
// Cap at max char
chr_count = (uint8_t) strlen(str);
if ( chr_count > 31 ) chr_count = 31;
chr_count = strlen(str);
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
if ( chr_count > max_count ) chr_count = max_count;
for(uint8_t i=0; i<chr_count; i++)
{
// Convert ASCII string into UTF-16
for ( size_t i = 0; i < chr_count; i++ ) {
_desc_str[1 + i] = str[i];
}
break;
}
// first byte is length (including header), second byte is string type

View file

@ -0,0 +1,33 @@
cmake_minimum_required(VERSION 3.17)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
project(${PROJECT} C CXX ASM)
# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
# Espressif has its own cmake build system
if(FAMILY STREQUAL "espressif")
return()
endif()
add_executable(${PROJECT})
# Example source
target_sources(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
)
# Example include
target_include_directories(${PROJECT} PUBLIC
${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.
family_configure_device_example(${PROJECT} noos)

View file

@ -0,0 +1,11 @@
include ../../make.mk
INC += \
src \
$(TOP)/hw \
# Example source
EXAMPLE_SOURCE += $(wildcard src/*.c)
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
include ../../rules.mk

View file

@ -0,0 +1,3 @@
mcu:SAMD11
mcu:SAME5X
mcu:SAMG

View file

@ -0,0 +1,525 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2020 Reinhard Panhuber
* Copyright (c) 2022 HiFiPhile
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
/* plot_audio_samples.py requires following modules:
* $ sudo apt install libportaudio
* $ pip3 install sounddevice matplotlib
*
* Then run
* $ python3 plot_audio_samples.py
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "bsp/board_api.h"
#include "tusb.h"
#include "usb_descriptors.h"
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF PROTYPES
//--------------------------------------------------------------------+
/* Blink pattern
* - 250 ms : device not mounted
* - 1000 ms : device mounted
* - 2500 ms : device is suspended
*/
enum {
BLINK_NOT_MOUNTED = 250,
BLINK_MOUNTED = 1000,
BLINK_SUSPENDED = 2500,
};
static uint32_t blink_interval_ms = BLINK_NOT_MOUNTED;
// Audio controls
// Current states
bool mute[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX + 1]; // +1 for master channel 0
uint16_t volume[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX + 1]; // +1 for master channel 0
uint32_t sampFreq;
uint8_t bytesPerSample;
uint8_t clkValid;
// Range states
// List of supported sample rates
static const uint32_t sampleRatesList[] =
{
32000, 48000, 96000
};
#define N_sampleRates TU_ARRAY_SIZE(sampleRatesList)
// Bytes per format of every Alt settings
static const uint8_t bytesPerSampleAltList[CFG_TUD_AUDIO_FUNC_1_N_FORMATS] =
{
CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX,
CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX,
};
audio_control_range_2_n_t(1) volumeRng[CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX+1]; // Volume range state
// Audio test data
CFG_TUSB_MEM_ALIGN uint8_t test_buffer_audio[CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX];
uint16_t startVal = 0;
void led_blinking_task(void);
void audio_task(void);
/*------------- MAIN -------------*/
int main(void)
{
board_init();
// init device stack on configured roothub port
tud_init(BOARD_TUD_RHPORT);
if (board_init_after_tusb) {
board_init_after_tusb();
}
// Init values
sampFreq = sampleRatesList[0];
clkValid = 1;
while (1)
{
tud_task(); // tinyusb device task
led_blinking_task();
audio_task();
}
return 0;
}
//--------------------------------------------------------------------+
// Device callbacks
//--------------------------------------------------------------------+
// Invoked when device is mounted
void tud_mount_cb(void)
{
blink_interval_ms = BLINK_MOUNTED;
}
// Invoked when device is unmounted
void tud_umount_cb(void)
{
blink_interval_ms = BLINK_NOT_MOUNTED;
}
// Invoked when usb bus is suspended
// remote_wakeup_en : if host allow us to perform remote wakeup
// Within 7ms, device must draw an average of current less than 2.5 mA from bus
void tud_suspend_cb(bool remote_wakeup_en)
{
(void) remote_wakeup_en;
blink_interval_ms = BLINK_SUSPENDED;
}
// Invoked when usb bus is resumed
void tud_resume_cb(void)
{
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
}
//--------------------------------------------------------------------+
// AUDIO Task
//--------------------------------------------------------------------+
void audio_task(void)
{
// Yet to be filled - e.g. put meas data into TX FIFOs etc.
// asm("nop");
}
//--------------------------------------------------------------------+
// Application Callback API Implementations
//--------------------------------------------------------------------+
// Invoked when set interface is called, typically on start/stop streaming or format change
bool tud_audio_set_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request)
{
(void)rhport;
//uint8_t const itf = tu_u16_low(tu_le16toh(p_request->wIndex));
uint8_t const alt = tu_u16_low(tu_le16toh(p_request->wValue));
// Clear buffer when streaming format is changed
if(alt != 0)
{
bytesPerSample = bytesPerSampleAltList[alt-1];
}
return true;
}
// Invoked when audio class specific set request received for an EP
bool tud_audio_set_req_ep_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff)
{
(void) rhport;
(void) pBuff;
// We do not support any set range requests here, only current value requests
TU_VERIFY(p_request->bRequest == AUDIO_CS_REQ_CUR);
// Page 91 in UAC2 specification
uint8_t channelNum = TU_U16_LOW(p_request->wValue);
uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
uint8_t ep = TU_U16_LOW(p_request->wIndex);
(void) channelNum; (void) ctrlSel; (void) ep;
return false; // Yet not implemented
}
// Invoked when audio class specific set request received for an interface
bool tud_audio_set_req_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff)
{
(void) rhport;
(void) pBuff;
// We do not support any set range requests here, only current value requests
TU_VERIFY(p_request->bRequest == AUDIO_CS_REQ_CUR);
// Page 91 in UAC2 specification
uint8_t channelNum = TU_U16_LOW(p_request->wValue);
uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
uint8_t itf = TU_U16_LOW(p_request->wIndex);
(void) channelNum; (void) ctrlSel; (void) itf;
return false; // Yet not implemented
}
// Invoked when audio class specific set request received for an entity
bool tud_audio_set_req_entity_cb(uint8_t rhport, tusb_control_request_t const * p_request, uint8_t *pBuff)
{
(void) rhport;
// Page 91 in UAC2 specification
uint8_t channelNum = TU_U16_LOW(p_request->wValue);
uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
uint8_t itf = TU_U16_LOW(p_request->wIndex);
uint8_t entityID = TU_U16_HIGH(p_request->wIndex);
(void) itf;
// We do not support any set range requests here, only current value requests
TU_VERIFY(p_request->bRequest == AUDIO_CS_REQ_CUR);
// If request is for our feature unit
if ( entityID == UAC2_ENTITY_FEATURE_UNIT )
{
switch ( ctrlSel )
{
case AUDIO_FU_CTRL_MUTE:
// Request uses format layout 1
TU_VERIFY(p_request->wLength == sizeof(audio_control_cur_1_t));
mute[channelNum] = ((audio_control_cur_1_t*) pBuff)->bCur;
TU_LOG2(" Set Mute: %d of channel: %u\r\n", mute[channelNum], channelNum);
return true;
case AUDIO_FU_CTRL_VOLUME:
// Request uses format layout 2
TU_VERIFY(p_request->wLength == sizeof(audio_control_cur_2_t));
volume[channelNum] = (uint16_t) ((audio_control_cur_2_t*) pBuff)->bCur;
TU_LOG2(" Set Volume: %d dB of channel: %u\r\n", volume[channelNum], channelNum);
return true;
// Unknown/Unsupported control
default:
TU_BREAKPOINT();
return false;
}
}
// Clock Source unit
if ( entityID == UAC2_ENTITY_CLOCK )
{
switch ( ctrlSel )
{
case AUDIO_CS_CTRL_SAM_FREQ:
TU_VERIFY(p_request->wLength == sizeof(audio_control_cur_4_t));
sampFreq = (uint32_t)((audio_control_cur_4_t *)pBuff)->bCur;
TU_LOG2("Clock set current freq: %lu\r\n", sampFreq);
return true;
break;
// Unknown/Unsupported control
default:
TU_BREAKPOINT();
return false;
}
}
return false; // Yet not implemented
}
// Invoked when audio class specific get request received for an EP
bool tud_audio_get_req_ep_cb(uint8_t rhport, tusb_control_request_t const * p_request)
{
(void) rhport;
// Page 91 in UAC2 specification
uint8_t channelNum = TU_U16_LOW(p_request->wValue);
uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
uint8_t ep = TU_U16_LOW(p_request->wIndex);
(void) channelNum; (void) ctrlSel; (void) ep;
// return tud_control_xfer(rhport, p_request, &tmp, 1);
return false; // Yet not implemented
}
// Invoked when audio class specific get request received for an interface
bool tud_audio_get_req_itf_cb(uint8_t rhport, tusb_control_request_t const * p_request)
{
(void) rhport;
// Page 91 in UAC2 specification
uint8_t channelNum = TU_U16_LOW(p_request->wValue);
uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
uint8_t itf = TU_U16_LOW(p_request->wIndex);
(void) channelNum; (void) ctrlSel; (void) itf;
return false; // Yet not implemented
}
// Invoked when audio class specific get request received for an entity
bool tud_audio_get_req_entity_cb(uint8_t rhport, tusb_control_request_t const * p_request)
{
(void) rhport;
// Page 91 in UAC2 specification
uint8_t channelNum = TU_U16_LOW(p_request->wValue);
uint8_t ctrlSel = TU_U16_HIGH(p_request->wValue);
// uint8_t itf = TU_U16_LOW(p_request->wIndex); // Since we have only one audio function implemented, we do not need the itf value
uint8_t entityID = TU_U16_HIGH(p_request->wIndex);
// Input terminal (Microphone input)
if (entityID == UAC2_ENTITY_INPUT_TERMINAL)
{
switch ( ctrlSel )
{
case AUDIO_TE_CTRL_CONNECTOR:
{
// The terminal connector control only has a get request with only the CUR attribute.
audio_desc_channel_cluster_t ret;
// Those are dummy values for now
ret.bNrChannels = 1;
ret.bmChannelConfig = 0;
ret.iChannelNames = 0;
TU_LOG2(" Get terminal connector\r\n");
return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, (void*) &ret, sizeof(ret));
}
break;
// Unknown/Unsupported control selector
default:
TU_BREAKPOINT();
return false;
}
}
// Feature unit
if (entityID == UAC2_ENTITY_FEATURE_UNIT)
{
switch ( ctrlSel )
{
case AUDIO_FU_CTRL_MUTE:
// Audio control mute cur parameter block consists of only one byte - we thus can send it right away
// There does not exist a range parameter block for mute
TU_LOG2(" Get Mute of channel: %u\r\n", channelNum);
return tud_control_xfer(rhport, p_request, &mute[channelNum], 1);
case AUDIO_FU_CTRL_VOLUME:
switch ( p_request->bRequest )
{
case AUDIO_CS_REQ_CUR:
TU_LOG2(" Get Volume of channel: %u\r\n", channelNum);
return tud_control_xfer(rhport, p_request, &volume[channelNum], sizeof(volume[channelNum]));
case AUDIO_CS_REQ_RANGE:
TU_LOG2(" Get Volume range of channel: %u\r\n", channelNum);
// Copy values - only for testing - better is version below
audio_control_range_2_n_t(1)
ret;
ret.wNumSubRanges = 1;
ret.subrange[0].bMin = -90; // -90 dB
ret.subrange[0].bMax = 30; // +30 dB
ret.subrange[0].bRes = 1; // 1 dB steps
return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, (void*) &ret, sizeof(ret));
// Unknown/Unsupported control
default:
TU_BREAKPOINT();
return false;
}
break;
// Unknown/Unsupported control
default:
TU_BREAKPOINT();
return false;
}
}
// Clock Source unit
if ( entityID == UAC2_ENTITY_CLOCK )
{
switch ( ctrlSel )
{
case AUDIO_CS_CTRL_SAM_FREQ:
// channelNum is always zero in this case
switch ( p_request->bRequest )
{
case AUDIO_CS_REQ_CUR:
TU_LOG2(" Get Sample Freq.\r\n");
return tud_control_xfer(rhport, p_request, &sampFreq, sizeof(sampFreq));
case AUDIO_CS_REQ_RANGE:
{
TU_LOG2(" Get Sample Freq. range\r\n");
audio_control_range_4_n_t(N_sampleRates) rangef =
{
.wNumSubRanges = tu_htole16(N_sampleRates)
};
TU_LOG1("Clock get %d freq ranges\r\n", N_sampleRates);
for(uint8_t i = 0; i < N_sampleRates; i++)
{
rangef.subrange[i].bMin = (int32_t)sampleRatesList[i];
rangef.subrange[i].bMax = (int32_t)sampleRatesList[i];
rangef.subrange[i].bRes = 0;
TU_LOG1("Range %d (%d, %d, %d)\r\n", i, (int)rangef.subrange[i].bMin, (int)rangef.subrange[i].bMax, (int)rangef.subrange[i].bRes);
}
return tud_audio_buffer_and_schedule_control_xfer(rhport, p_request, &rangef, sizeof(rangef));
}
// Unknown/Unsupported control
default:
TU_BREAKPOINT();
return false;
}
break;
case AUDIO_CS_CTRL_CLK_VALID:
// Only cur attribute exists for this request
TU_LOG2(" Get Sample Freq. valid\r\n");
return tud_control_xfer(rhport, p_request, &clkValid, sizeof(clkValid));
// Unknown/Unsupported control
default:
TU_BREAKPOINT();
return false;
}
}
TU_LOG2(" Unsupported entity: %d\r\n", entityID);
return false; // Yet not implemented
}
bool tud_audio_tx_done_pre_load_cb(uint8_t rhport, uint8_t itf, uint8_t ep_in, uint8_t cur_alt_setting)
{
(void) rhport;
(void) itf;
(void) ep_in;
(void) cur_alt_setting;
tud_audio_write((uint8_t *)test_buffer_audio, (uint16_t)(sampFreq / (TUD_OPT_HIGH_SPEED ? 8000 : 1000) * bytesPerSample));
return true;
}
bool tud_audio_tx_done_post_load_cb(uint8_t rhport, uint16_t n_bytes_copied, uint8_t itf, uint8_t ep_in, uint8_t cur_alt_setting)
{
(void) rhport;
(void) n_bytes_copied;
(void) itf;
(void) ep_in;
(void) cur_alt_setting;
// 16bit
if(bytesPerSample == 2)
{
uint16_t* pData_16 = (uint16_t*)((void*)test_buffer_audio);
for (size_t cnt = 0; cnt < sampFreq / (TUD_OPT_HIGH_SPEED ? 8000 : 1000); cnt++)
{
pData_16[cnt] = startVal++;
}
}
// 24bit in 32bit slot
else if(bytesPerSample == 4)
{
uint32_t* pData_32 = (uint32_t*)((void*)test_buffer_audio);
for (size_t cnt = 0; cnt < sampFreq / (TUD_OPT_HIGH_SPEED ? 8000 : 1000); cnt++)
{
pData_32[cnt] = (uint32_t)startVal++ << 16U;
}
}
return true;
}
bool tud_audio_set_itf_close_EP_cb(uint8_t rhport, tusb_control_request_t const * p_request)
{
(void) rhport;
(void) p_request;
startVal = 0;
return true;
}
//--------------------------------------------------------------------+
// BLINKING TASK
//--------------------------------------------------------------------+
void led_blinking_task(void)
{
static uint32_t start_ms = 0;
static bool led_state = false;
// Blink every interval ms
if ( board_millis() - start_ms < blink_interval_ms) return; // not enough time
start_ms += blink_interval_ms;
board_led_write(led_state);
led_state = 1 - led_state; // toggle
}

View file

@ -0,0 +1,37 @@
import sounddevice as sd
import matplotlib.pyplot as plt
import numpy as np
import platform
import csv
if __name__ == '__main__':
# If you got "ValueError: No input device matching", that is because your PC name example device
# differently from tested list below. Uncomment the next line to see full list and try to pick correct one
# print(sd.query_devices())
fs = 96000 # Sample rate
duration = 100e-3 # Duration of recording
if platform.system() == 'Windows':
# MME is needed since there are more than one MicNode device APIs (at least in Windows)
device = 'Microphone (MicNode) MME'
elif platform.system() == 'Darwin':
device = 'MicNode'
else:
device ='default'
myrecording = sd.rec(int(duration * fs), samplerate=fs, channels=1, dtype='int16', device=device)
print('Waiting...')
sd.wait() # Wait until recording is finished
print('Done!')
time = np.arange(0, duration, 1 / fs) # time vector
plt.plot(time, myrecording)
plt.xlabel('Time [s]')
plt.ylabel('Amplitude')
plt.title('MicNode')
plt.show()
samples = np.array(myrecording)
np.savetxt('Output.csv', samples, delimiter=",", fmt='%s')

View file

@ -0,0 +1,141 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Ha Thach (tinyusb.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#ifndef _TUSB_CONFIG_H_
#define _TUSB_CONFIG_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "usb_descriptors.h"
//--------------------------------------------------------------------+
// Board Specific Configuration
//--------------------------------------------------------------------+
// RHPort number used for device can be defined by board.mk, default to port 0
#ifndef BOARD_TUD_RHPORT
#define BOARD_TUD_RHPORT 0
#endif
// RHPort max operational speed can defined by board.mk
#ifndef BOARD_TUD_MAX_SPEED
#define BOARD_TUD_MAX_SPEED OPT_MODE_DEFAULT_SPEED
#endif
//--------------------------------------------------------------------
// COMMON CONFIGURATION
//--------------------------------------------------------------------
// defined by compiler flags for flexibility
#ifndef CFG_TUSB_MCU
#error CFG_TUSB_MCU must be defined
#endif
#ifndef CFG_TUSB_OS
#define CFG_TUSB_OS OPT_OS_NONE
#endif
#ifndef CFG_TUSB_DEBUG
#define CFG_TUSB_DEBUG 0
#endif
// Enable Device stack
#define CFG_TUD_ENABLED 1
// Default is max speed that hardware controller could support with on-chip PHY
#define CFG_TUD_MAX_SPEED BOARD_TUD_MAX_SPEED
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
// #define CFG_TUSB_DEBUG 0
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
* Tinyusb use follows macros to declare transferring memory so that they can be put
* into those specific section.
* e.g
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
*/
#ifndef CFG_TUSB_MEM_SECTION
#define CFG_TUSB_MEM_SECTION
#endif
#ifndef CFG_TUSB_MEM_ALIGN
#define CFG_TUSB_MEM_ALIGN __attribute__ ((aligned(4)))
#endif
//--------------------------------------------------------------------
// DEVICE CONFIGURATION
//--------------------------------------------------------------------
#ifndef CFG_TUD_ENDPOINT0_SIZE
#define CFG_TUD_ENDPOINT0_SIZE 64
#endif
//------------- CLASS -------------//
#define CFG_TUD_AUDIO 1
#define CFG_TUD_CDC 0
#define CFG_TUD_MSC 0
#define CFG_TUD_HID 0
#define CFG_TUD_MIDI 0
#define CFG_TUD_VENDOR 0
//--------------------------------------------------------------------
// AUDIO CLASS DRIVER CONFIGURATION
//--------------------------------------------------------------------
#define CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE 96000
// How many formats are used, need to adjust USB descriptor if changed
#define CFG_TUD_AUDIO_FUNC_1_N_FORMATS 2
// 16bit in 16bit slots
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX 2
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_RX 16
// 24bit in 32bit slots
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX 4
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_RX 24
// Have a look into audio_device.h for all configurations
#define CFG_TUD_AUDIO_FUNC_1_DESC_LEN TUD_AUDIO_MIC_ONE_CH_2_FORMAT_DESC_LEN
#define CFG_TUD_AUDIO_FUNC_1_N_AS_INT 1 // Number of Standard AS Interface Descriptors (4.9.1) defined per audio function - this is required to be able to remember the current alternate settings of these interfaces - We restrict us here to have a constant number for all audio functions (which means this has to be the maximum number of AS interfaces an audio function has and a second audio function with less AS interfaces just wastes a few bytes)
#define CFG_TUD_AUDIO_FUNC_1_CTRL_BUF_SZ 64 // Size of control request buffer
#define CFG_TUD_AUDIO_ENABLE_EP_IN 1
#define CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX 1 // Driver gets this info from the descriptors - we define it here to use it to setup the descriptors and to do calculations with it below - be aware: for different number of channels you need another descriptor!
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_IN TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX)
#define CFG_TUD_AUDIO_FUNC_1_FORMAT_2_EP_SZ_IN TUD_AUDIO_EP_SIZE(CFG_TUD_AUDIO_FUNC_1_MAX_SAMPLE_RATE, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_N_CHANNELS_TX)
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX TU_MAX(CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_IN, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_EP_SZ_IN) // Maximum EP IN size for all AS alternate settings used
#define CFG_TUD_AUDIO_FUNC_1_EP_IN_SW_BUF_SZ CFG_TUD_AUDIO_FUNC_1_EP_IN_SZ_MAX
#ifdef __cplusplus
}
#endif
#endif /* _TUSB_CONFIG_H_ */

View file

@ -0,0 +1,185 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Ha Thach (tinyusb.org)
* Copyright (c) 2022 HiFiPhile
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#include "bsp/board_api.h"
#include "tusb.h"
#include "usb_descriptors.h"
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
* Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
*
* Auto ProductID layout's Bitmap:
* [MSB] AUDIO | MIDI | HID | MSC | CDC [LSB]
*/
#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
_PID_MAP(MIDI, 3) | _PID_MAP(AUDIO, 4) | _PID_MAP(VENDOR, 5) )
//--------------------------------------------------------------------+
// Device Descriptors
//--------------------------------------------------------------------+
tusb_desc_device_t const desc_device =
{
.bLength = sizeof(tusb_desc_device_t),
.bDescriptorType = TUSB_DESC_DEVICE,
.bcdUSB = 0x0200,
// Use Interface Association Descriptor (IAD) for Audio
// As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1)
.bDeviceClass = TUSB_CLASS_MISC,
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
.bDeviceProtocol = MISC_PROTOCOL_IAD,
.bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE,
.idVendor = 0xCafe,
.idProduct = USB_PID,
.bcdDevice = 0x0100,
.iManufacturer = 0x01,
.iProduct = 0x02,
.iSerialNumber = 0x03,
.bNumConfigurations = 0x01
};
// Invoked when received GET DEVICE DESCRIPTOR
// Application return pointer to descriptor
uint8_t const * tud_descriptor_device_cb(void)
{
return (uint8_t const *) &desc_device;
}
//--------------------------------------------------------------------+
// Configuration Descriptor
//--------------------------------------------------------------------+
enum
{
ITF_NUM_AUDIO_CONTROL = 0,
ITF_NUM_AUDIO_STREAMING,
ITF_NUM_TOTAL
};
#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + CFG_TUD_AUDIO * TUD_AUDIO_MIC_ONE_CH_2_FORMAT_DESC_LEN)
#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X || CFG_TUSB_MCU == OPT_MCU_LPC177X_8X || CFG_TUSB_MCU == OPT_MCU_LPC40XX
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
#define EPNUM_AUDIO 0x03
#elif TU_CHECK_MCU(OPT_MCU_NRF5X)
// nRF5x ISO can only be endpoint 8
#define EPNUM_AUDIO 0x08
#else
#define EPNUM_AUDIO 0x01
#endif
uint8_t const desc_configuration[] =
{
// Config number, interface count, string index, total length, attribute, power in mA
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
// Interface number, string index, EP Out & EP In address, EP size
TUD_AUDIO_MIC_ONE_CH_2_FORMAT_DESCRIPTOR(/*_itfnum*/ ITF_NUM_AUDIO_CONTROL, /*_stridx*/ 0, /*_epin*/ 0x80 | EPNUM_AUDIO)
};
TU_VERIFY_STATIC(sizeof(desc_configuration) == CONFIG_TOTAL_LEN, "Incorrect size");
// Invoked when received GET CONFIGURATION DESCRIPTOR
// Application return pointer to descriptor
// Descriptor contents must exist long enough for transfer to complete
uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
{
(void) index; // for multiple configurations
return desc_configuration;
}
//--------------------------------------------------------------------+
// String Descriptors
//--------------------------------------------------------------------+
// String Descriptor Index
enum {
STRID_LANGID = 0,
STRID_MANUFACTURER,
STRID_PRODUCT,
STRID_SERIAL,
};
// array of pointer to string descriptors
char const* string_desc_arr [] =
{
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
"PaniRCorp", // 1: Manufacturer
"MicNode", // 2: Product
NULL, // 3: Serials will use unique ID if possible
"UAC2", // 4: Audio Interface
};
static uint16_t _desc_str[32 + 1];
// Invoked when received GET STRING DESCRIPTOR request
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
(void) langid;
size_t chr_count;
switch ( index ) {
case STRID_LANGID:
memcpy(&_desc_str[1], string_desc_arr[0], 2);
chr_count = 1;
break;
case STRID_SERIAL:
chr_count = board_usb_get_serial(_desc_str + 1, 32);
break;
default:
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
if ( !(index < sizeof(string_desc_arr) / sizeof(string_desc_arr[0])) ) return NULL;
const char *str = string_desc_arr[index];
// Cap at max char
chr_count = strlen(str);
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
if ( chr_count > max_count ) chr_count = max_count;
// Convert ASCII string into UTF-16
for ( size_t i = 0; i < chr_count; i++ ) {
_desc_str[1 + i] = str[i];
}
break;
}
// first byte is length (including header), second byte is string type
_desc_str[0] = (uint16_t) ((TUSB_DESC_STRING << 8) | (2 * chr_count + 2));
return _desc_str;
}

View file

@ -0,0 +1,102 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2022 HiFiPhile
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#ifndef _USB_DESCRIPTORS_H_
#define _USB_DESCRIPTORS_H_
// #include "tusb.h"
// Unit numbers are arbitrary selected
#define UAC2_ENTITY_CLOCK 0x04
#define UAC2_ENTITY_INPUT_TERMINAL 0x01
#define UAC2_ENTITY_OUTPUT_TERMINAL 0x03
#define UAC2_ENTITY_FEATURE_UNIT 0x02
#define TUD_AUDIO_MIC_ONE_CH_2_FORMAT_DESC_LEN (TUD_AUDIO_DESC_IAD_LEN\
+ TUD_AUDIO_DESC_STD_AC_LEN\
+ TUD_AUDIO_DESC_CS_AC_LEN\
+ TUD_AUDIO_DESC_CLK_SRC_LEN\
+ TUD_AUDIO_DESC_INPUT_TERM_LEN\
+ TUD_AUDIO_DESC_OUTPUT_TERM_LEN\
+ TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL_LEN\
/* Interface 1, Alternate 0 */\
+ TUD_AUDIO_DESC_STD_AS_INT_LEN\
/* Interface 1, Alternate 1 */\
+ TUD_AUDIO_DESC_STD_AS_INT_LEN\
+ TUD_AUDIO_DESC_CS_AS_INT_LEN\
+ TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN\
+ TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN\
+ TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN\
/* Interface 1, Alternate 2 */\
+ TUD_AUDIO_DESC_STD_AS_INT_LEN\
+ TUD_AUDIO_DESC_CS_AS_INT_LEN\
+ TUD_AUDIO_DESC_TYPE_I_FORMAT_LEN\
+ TUD_AUDIO_DESC_STD_AS_ISO_EP_LEN\
+ TUD_AUDIO_DESC_CS_AS_ISO_EP_LEN)
#define TUD_AUDIO_MIC_ONE_CH_2_FORMAT_DESCRIPTOR(_itfnum, _stridx, _epin) \
/* Standard Interface Association Descriptor (IAD) */\
TUD_AUDIO_DESC_IAD(/*_firstitf*/ _itfnum, /*_nitfs*/ 0x02, /*_stridx*/ 0x00),\
/* Standard AC Interface Descriptor(4.7.1) */\
TUD_AUDIO_DESC_STD_AC(/*_itfnum*/ _itfnum, /*_nEPs*/ 0x00, /*_stridx*/ _stridx),\
/* Class-Specific AC Interface Header Descriptor(4.7.2) */\
TUD_AUDIO_DESC_CS_AC(/*_bcdADC*/ 0x0200, /*_category*/ AUDIO_FUNC_MICROPHONE, /*_totallen*/ TUD_AUDIO_DESC_CLK_SRC_LEN+TUD_AUDIO_DESC_INPUT_TERM_LEN+TUD_AUDIO_DESC_OUTPUT_TERM_LEN+TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL_LEN, /*_ctrl*/ AUDIO_CS_AS_INTERFACE_CTRL_LATENCY_POS),\
/* Clock Source Descriptor(4.7.2.1) */\
TUD_AUDIO_DESC_CLK_SRC(/*_clkid*/ UAC2_ENTITY_CLOCK, /*_attr*/ AUDIO_CLOCK_SOURCE_ATT_INT_PRO_CLK, /*_ctrl*/ AUDIO_CTRL_RW << AUDIO_CLOCK_SOURCE_CTRL_CLK_FRQ_POS | AUDIO_CTRL_R << AUDIO_CLOCK_SOURCE_CTRL_CLK_VAL_POS, /*_assocTerm*/ 0x01, /*_stridx*/ 0x00),\
/* Input Terminal Descriptor(4.7.2.4) */\
TUD_AUDIO_DESC_INPUT_TERM(/*_termid*/ UAC2_ENTITY_INPUT_TERMINAL, /*_termtype*/ AUDIO_TERM_TYPE_IN_GENERIC_MIC, /*_assocTerm*/ UAC2_ENTITY_OUTPUT_TERMINAL, /*_clkid*/ UAC2_ENTITY_CLOCK, /*_nchannelslogical*/ 0x01, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_idxchannelnames*/ 0x00, /*_ctrl*/ AUDIO_CTRL_R << AUDIO_IN_TERM_CTRL_CONNECTOR_POS, /*_stridx*/ 0x00),\
/* Output Terminal Descriptor(4.7.2.5) */\
TUD_AUDIO_DESC_OUTPUT_TERM(/*_termid*/ UAC2_ENTITY_OUTPUT_TERMINAL, /*_termtype*/ AUDIO_TERM_TYPE_USB_STREAMING, /*_assocTerm*/ UAC2_ENTITY_INPUT_TERMINAL, /*_srcid*/ UAC2_ENTITY_FEATURE_UNIT, /*_clkid*/ UAC2_ENTITY_CLOCK, /*_ctrl*/ 0x0000, /*_stridx*/ 0x00),\
/* Feature Unit Descriptor(4.7.2.8) */\
TUD_AUDIO_DESC_FEATURE_UNIT_ONE_CHANNEL(/*_unitid*/ UAC2_ENTITY_FEATURE_UNIT, /*_srcid*/ 0x01, /*_ctrlch0master*/ AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS, /*_ctrlch1*/ AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_MUTE_POS | AUDIO_CTRL_RW << AUDIO_FEATURE_UNIT_CTRL_VOLUME_POS, /*_stridx*/ 0x00),\
/* Standard AS Interface Descriptor(4.9.1) */\
/* Interface 1, Alternate 0 - default alternate setting with 0 bandwidth */\
TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)((_itfnum)+1), /*_altset*/ 0x00, /*_nEPs*/ 0x00, /*_stridx*/ 0x00),\
/* Standard AS Interface Descriptor(4.9.1) */\
/* Interface 1, Alternate 1 - alternate interface for data streaming */\
TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)((_itfnum)+1), /*_altset*/ 0x01, /*_nEPs*/ 0x01, /*_stridx*/ 0x00),\
/* Class-Specific AS Interface Descriptor(4.9.2) */\
TUD_AUDIO_DESC_CS_AS_INT(/*_termid*/ UAC2_ENTITY_OUTPUT_TERMINAL, /*_ctrl*/ AUDIO_CTRL_NONE, /*_formattype*/ AUDIO_FORMAT_TYPE_I, /*_formats*/ AUDIO_DATA_FORMAT_TYPE_I_PCM, /*_nchannelsphysical*/ 0x01, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_stridx*/ 0x00),\
/* Type I Format Type Descriptor(2.3.1.6 - Audio Formats) */\
TUD_AUDIO_DESC_TYPE_I_FORMAT(CFG_TUD_AUDIO_FUNC_1_FORMAT_1_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_FORMAT_1_RESOLUTION_RX),\
/* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
TUD_AUDIO_DESC_STD_AS_ISO_EP(/*_ep*/ _epin, /*_attr*/ (TUSB_XFER_ISOCHRONOUS | TUSB_ISO_EP_ATT_ASYNCHRONOUS | TUSB_ISO_EP_ATT_DATA), /*_maxEPsize*/ CFG_TUD_AUDIO_FUNC_1_FORMAT_1_EP_SZ_IN, /*_interval*/ 0x01),\
/* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_UNDEFINED, /*_lockdelay*/ 0x0000),\
/* Interface 1, Alternate 2 - alternate interface for data streaming */\
TUD_AUDIO_DESC_STD_AS_INT(/*_itfnum*/ (uint8_t)((_itfnum)+1), /*_altset*/ 0x02, /*_nEPs*/ 0x01, /*_stridx*/ 0x00),\
/* Class-Specific AS Interface Descriptor(4.9.2) */\
TUD_AUDIO_DESC_CS_AS_INT(/*_termid*/ UAC2_ENTITY_OUTPUT_TERMINAL, /*_ctrl*/ AUDIO_CTRL_NONE, /*_formattype*/ AUDIO_FORMAT_TYPE_I, /*_formats*/ AUDIO_DATA_FORMAT_TYPE_I_PCM, /*_nchannelsphysical*/ 0x01, /*_channelcfg*/ AUDIO_CHANNEL_CONFIG_NON_PREDEFINED, /*_stridx*/ 0x00),\
/* Type I Format Type Descriptor(2.3.1.6 - Audio Formats) */\
TUD_AUDIO_DESC_TYPE_I_FORMAT(CFG_TUD_AUDIO_FUNC_1_FORMAT_2_N_BYTES_PER_SAMPLE_TX, CFG_TUD_AUDIO_FUNC_1_FORMAT_2_RESOLUTION_RX),\
/* Standard AS Isochronous Audio Data Endpoint Descriptor(4.10.1.1) */\
TUD_AUDIO_DESC_STD_AS_ISO_EP(/*_ep*/ _epin, /*_attr*/ (TUSB_XFER_ISOCHRONOUS | TUSB_ISO_EP_ATT_ASYNCHRONOUS | TUSB_ISO_EP_ATT_DATA), /*_maxEPsize*/ CFG_TUD_AUDIO_FUNC_1_FORMAT_2_EP_SZ_IN, /*_interval*/ 0x01),\
/* Class-Specific AS Isochronous Audio Data Endpoint Descriptor(4.10.1.2) */\
TUD_AUDIO_DESC_CS_AS_ISO_EP(/*_attr*/ AUDIO_CS_AS_ISO_DATA_EP_ATT_NON_MAX_PACKETS_OK, /*_ctrl*/ AUDIO_CTRL_NONE, /*_lockdelayunit*/ AUDIO_CS_AS_ISO_DATA_EP_LOCK_DELAY_UNIT_UNDEFINED, /*_lockdelay*/ 0x0000)
#endif

View file

@ -1,29 +1,20 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.17)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
# Check for -DFAMILY=
if(FAMILY MATCHES "^esp32s[2-3]")
# use BOARD-Directory name for project id
get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(PROJECT ${BOARD}-${PROJECT})
# TOP is absolute path to root directory of TinyUSB git repo
set(TOP "../../..")
get_filename_component(TOP "${TOP}" REALPATH)
project(${PROJECT})
else()
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
project(${PROJECT})
project(${PROJECT} C CXX ASM)
# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
# Espressif has its own cmake build system
if(FAMILY STREQUAL "espressif")
return()
endif()
add_executable(${PROJECT})
# Example source
@ -36,7 +27,6 @@ else()
${CMAKE_CURRENT_SOURCE_DIR}/src
)
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
endif()
# Configure compilation flags and libraries for the example without RTOS.
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT} noos)

View file

@ -1,4 +1,3 @@
include ../../../tools/top.mk
include ../../make.mk
INC += \
@ -9,10 +8,4 @@ INC += \
EXAMPLE_SOURCE += $(wildcard src/*.c)
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
# board_test example is special example that doesn't enable device or host stack
# This can cause some TinyUSB API missing, this hack to allow us to fill those API
# to pass the compilation process
CFLAGS += \
-D"tud_int_handler(x)= " \
include ../../rules.mk

View file

@ -1,17 +1,3 @@
# FAMILY = esp32sx
idf_component_register(SRCS "main.c"
INCLUDE_DIRS "."
REQUIRES freertos soc)
file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake)
if(EXISTS ${board_cmake})
include(${board_cmake})
endif()
idf_component_get_property( FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH)
target_include_directories(${COMPONENT_TARGET} PUBLIC
"${FREERTOS_ORIG_INCLUDE_PATH}"
"${TOP}/hw"
"${TOP}/src"
)
REQUIRES boards tinyusb_src)

View file

@ -27,10 +27,10 @@
#include <stdio.h>
#include <string.h>
#include "bsp/board.h"
#include "bsp/board_api.h"
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF PROTYPES
// MACRO CONSTANT TYPEDEF PROTOTYPES
//--------------------------------------------------------------------+
/* Blink pattern
@ -56,7 +56,7 @@ int main(void)
{
uint32_t interval_ms = board_button_read() ? BLINK_PRESSED : BLINK_UNPRESSED;
// Blink every interval ms
// Blink and print every interval ms
if ( !(board_millis() - start_ms < interval_ms) )
{
board_uart_write(HELLO_STR, strlen(HELLO_STR));
@ -66,9 +66,14 @@ int main(void)
board_led_write(led_state);
led_state = 1 - led_state; // toggle
}
}
return 0;
// echo
uint8_t ch;
if ( board_uart_read(&ch, 1) > 0 )
{
board_uart_write(&ch, 1);
}
}
}
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3

View file

@ -30,6 +30,11 @@
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
//--------------------------------------------------------------------

View file

@ -1,15 +1,20 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.17)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
project(${PROJECT})
project(${PROJECT} C CXX ASM)
# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
# Espressif has its own cmake build system
if(FAMILY STREQUAL "espressif")
return()
endif()
add_executable(${PROJECT})
# Example source
@ -23,6 +28,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
# Configure compilation flags and libraries for the example without RTOS.
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT} noos)

View file

@ -1,4 +1,3 @@
include ../../../tools/top.mk
include ../../make.mk
INC += \

View file

@ -28,7 +28,7 @@
#include <string.h>
#include <ctype.h>
#include "bsp/board.h"
#include "bsp/board_api.h"
#include "tusb.h"
//------------- prototypes -------------//
@ -42,13 +42,15 @@ int main(void)
// init device stack on configured roothub port
tud_init(BOARD_TUD_RHPORT);
if (board_init_after_tusb) {
board_init_after_tusb();
}
while (1)
{
tud_task(); // tinyusb device task
cdc_task();
}
return 0;
}
// echo to either Serial0 or Serial1

View file

@ -23,13 +23,14 @@
*
*/
#include "bsp/board_api.h"
#include "tusb.h"
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
* Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC.
*
* Auto ProductID layout's Bitmap:
* [MSB] MIDI | HID | MSC | CDC [LSB]
* [MSB] HID | MSC | CDC [LSB]
*/
#define _PID_MAP(itf, n) ( (CFG_TUD_##itf) << (n) )
#define USB_PID (0x4000 | _PID_MAP(CDC, 0) | _PID_MAP(MSC, 1) | _PID_MAP(HID, 2) | \
@ -108,6 +109,17 @@ enum
#define EPNUM_CDC_1_OUT 0x05
#define EPNUM_CDC_1_IN 0x86
#elif CFG_TUSB_MCU == OPT_MCU_FT90X || CFG_TUSB_MCU == OPT_MCU_FT93X
// FT9XX doesn't support a same endpoint number with different direction IN and OUT
// e.g EP1 OUT & EP1 IN cannot exist together
#define EPNUM_CDC_0_NOTIF 0x81
#define EPNUM_CDC_0_OUT 0x02
#define EPNUM_CDC_0_IN 0x83
#define EPNUM_CDC_1_NOTIF 0x84
#define EPNUM_CDC_1_OUT 0x05
#define EPNUM_CDC_1_IN 0x86
#else
#define EPNUM_CDC_0_NOTIF 0x81
#define EPNUM_CDC_0_OUT 0x02
@ -202,32 +214,43 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
// String Descriptors
//--------------------------------------------------------------------+
// String Descriptor Index
enum {
STRID_LANGID = 0,
STRID_MANUFACTURER,
STRID_PRODUCT,
STRID_SERIAL,
};
// array of pointer to string descriptors
char const *string_desc_arr[] =
{
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
"TinyUSB", // 1: Manufacturer
"TinyUSB Device", // 2: Product
"123456", // 3: Serials, should use chip ID
NULL, // 3: Serials will use unique ID if possible
"TinyUSB CDC", // 4: CDC Interface
};
static uint16_t _desc_str[32];
static uint16_t _desc_str[32 + 1];
// Invoked when received GET STRING DESCRIPTOR request
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
{
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
(void) langid;
size_t chr_count;
uint8_t chr_count;
if ( index == 0)
{
switch ( index ) {
case STRID_LANGID:
memcpy(&_desc_str[1], string_desc_arr[0], 2);
chr_count = 1;
}else
{
break;
case STRID_SERIAL:
chr_count = board_usb_get_serial(_desc_str + 1, 32);
break;
default:
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
@ -236,14 +259,15 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
const char *str = string_desc_arr[index];
// Cap at max char
chr_count = (uint8_t) strlen(str);
if ( chr_count > 31 ) chr_count = 31;
chr_count = strlen(str);
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
if ( chr_count > max_count ) chr_count = max_count;
// Convert ASCII string into UTF-16
for(uint8_t i=0; i<chr_count; i++)
{
for ( size_t i = 0; i < chr_count; i++ ) {
_desc_str[1 + i] = str[i];
}
break;
}
// first byte is length (including header), second byte is string type

View file

@ -1,15 +1,21 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.17)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
project(${PROJECT})
project(${PROJECT} C CXX ASM)
# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
# Espressif has its own cmake build system
if(FAMILY STREQUAL "espressif")
return()
endif()
add_executable(${PROJECT})
# Example source
@ -26,4 +32,4 @@ target_include_directories(${PROJECT} PUBLIC
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
family_configure_device_example(${PROJECT} noos)

View file

@ -1,4 +1,3 @@
include ../../../tools/top.mk
include ../../make.mk
INC += \
@ -6,7 +5,11 @@ INC += \
$(TOP)/hw \
# Example source
EXAMPLE_SOURCE += $(wildcard src/*.c)
EXAMPLE_SOURCE += \
src/main.c \
src/msc_disk.c \
src/usb_descriptors.c \
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
include ../../rules.mk

View file

@ -27,7 +27,7 @@
#include <stdio.h>
#include <string.h>
#include "bsp/board.h"
#include "bsp/board_api.h"
#include "tusb.h"
//--------------------------------------------------------------------+
@ -58,6 +58,10 @@ int main(void)
// init device stack on configured roothub port
tud_init(BOARD_TUD_RHPORT);
if (board_init_after_tusb) {
board_init_after_tusb();
}
while (1)
{
tud_task(); // tinyusb device task
@ -65,8 +69,6 @@ int main(void)
cdc_task();
}
return 0;
}
//--------------------------------------------------------------------+
@ -97,7 +99,7 @@ void tud_suspend_cb(bool remote_wakeup_en)
// Invoked when usb bus is resumed
void tud_resume_cb(void)
{
blink_interval_ms = BLINK_MOUNTED;
blink_interval_ms = tud_mounted() ? BLINK_MOUNTED : BLINK_NOT_MOUNTED;
}
@ -113,7 +115,7 @@ void cdc_task(void)
// connected and there are data available
if ( tud_cdc_available() )
{
// read datas
// read data
char buf[64];
uint32_t count = tud_cdc_read(buf, sizeof(buf));
(void) count;

View file

@ -23,7 +23,7 @@
*
*/
#include "bsp/board.h"
#include "bsp/board_api.h"
#include "tusb.h"
#if CFG_TUD_MSC

View file

@ -23,6 +23,7 @@
*
*/
#include "bsp/board_api.h"
#include "tusb.h"
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
@ -41,8 +42,7 @@
//--------------------------------------------------------------------+
// Device Descriptors
//--------------------------------------------------------------------+
tusb_desc_device_t const desc_device =
{
tusb_desc_device_t const desc_device = {
.bLength = sizeof(tusb_desc_device_t),
.bDescriptorType = TUSB_DESC_DEVICE,
.bcdUSB = USB_BCD,
@ -68,8 +68,7 @@ tusb_desc_device_t const desc_device =
// Invoked when received GET DEVICE DESCRIPTOR
// Application return pointer to descriptor
uint8_t const * tud_descriptor_device_cb(void)
{
uint8_t const *tud_descriptor_device_cb(void) {
return (uint8_t const *) &desc_device;
}
@ -77,8 +76,7 @@ uint8_t const * tud_descriptor_device_cb(void)
// Configuration Descriptor
//--------------------------------------------------------------------+
enum
{
enum {
ITF_NUM_CDC = 0,
ITF_NUM_CDC_DATA,
ITF_NUM_MSC,
@ -140,8 +138,7 @@ enum
#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_CDC_DESC_LEN + TUD_MSC_DESC_LEN)
// full speed configuration
uint8_t const desc_fs_configuration[] =
{
uint8_t const desc_fs_configuration[] = {
// Config number, interface count, string index, total length, attribute, power in mA
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
@ -156,8 +153,7 @@ uint8_t const desc_fs_configuration[] =
// Per USB specs: high speed capable device must report device_qualifier and other_speed_configuration
// high speed configuration
uint8_t const desc_hs_configuration[] =
{
uint8_t const desc_hs_configuration[] = {
// Config number, interface count, string index, total length, attribute, power in mA
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
@ -172,8 +168,7 @@ uint8_t const desc_hs_configuration[] =
uint8_t desc_other_speed_config[CONFIG_TOTAL_LEN];
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
tusb_desc_device_qualifier_t const desc_device_qualifier =
{
tusb_desc_device_qualifier_t const desc_device_qualifier = {
.bLength = sizeof(tusb_desc_device_qualifier_t),
.bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
.bcdUSB = USB_BCD,
@ -191,16 +186,14 @@ tusb_desc_device_qualifier_t const desc_device_qualifier =
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete.
// device_qualifier descriptor describes information about a high-speed capable device that would
// change if the device were operating at the other speed. If not highspeed capable stall this request.
uint8_t const* tud_descriptor_device_qualifier_cb(void)
{
uint8_t const *tud_descriptor_device_qualifier_cb(void) {
return (uint8_t const *) &desc_device_qualifier;
}
// Invoked when received GET OTHER SEED CONFIGURATION DESCRIPTOR request
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
// Configuration descriptor in the other speed e.g if high speed then this is for full speed and vice versa
uint8_t const* tud_descriptor_other_speed_configuration_cb(uint8_t index)
{
uint8_t const *tud_descriptor_other_speed_configuration_cb(uint8_t index) {
(void) index; // for multiple configurations
// if link speed is high return fullspeed config, and vice versa
@ -220,8 +213,7 @@ uint8_t const* tud_descriptor_other_speed_configuration_cb(uint8_t index)
// Invoked when received GET CONFIGURATION DESCRIPTOR
// Application return pointer to descriptor
// Descriptor contents must exist long enough for transfer to complete
uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
{
uint8_t const *tud_descriptor_configuration_cb(uint8_t index) {
(void) index; // for multiple configurations
#if TUD_OPT_HIGH_SPEED
@ -236,33 +228,43 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
// String Descriptors
//--------------------------------------------------------------------+
// String Descriptor Index
enum {
STRID_LANGID = 0,
STRID_MANUFACTURER,
STRID_PRODUCT,
STRID_SERIAL,
};
// array of pointer to string descriptors
char const* string_desc_arr [] =
{
char const *string_desc_arr[] = {
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
"TinyUSB", // 1: Manufacturer
"TinyUSB Device", // 2: Product
"123456789012", // 3: Serials, should use chip ID
NULL, // 3: Serials will use unique ID if possible
"TinyUSB CDC", // 4: CDC Interface
"TinyUSB MSC", // 5: MSC Interface
};
static uint16_t _desc_str[32];
static uint16_t _desc_str[32 + 1];
// Invoked when received GET STRING DESCRIPTOR request
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
{
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
(void) langid;
size_t chr_count;
uint8_t chr_count;
if ( index == 0)
{
switch ( index ) {
case STRID_LANGID:
memcpy(&_desc_str[1], string_desc_arr[0], 2);
chr_count = 1;
}else
{
break;
case STRID_SERIAL:
chr_count = board_usb_get_serial(_desc_str + 1, 32);
break;
default:
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
@ -271,14 +273,15 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
const char *str = string_desc_arr[index];
// Cap at max char
chr_count = (uint8_t) strlen(str);
if ( chr_count > 31 ) chr_count = 31;
chr_count = strlen(str);
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
if ( chr_count > max_count ) chr_count = max_count;
// Convert ASCII string into UTF-16
for(uint8_t i=0; i<chr_count; i++)
{
for ( size_t i = 0; i < chr_count; i++ ) {
_desc_str[1 + i] = str[i];
}
break;
}
// first byte is length (including header), second byte is string type

View file

@ -1,22 +1,35 @@
cmake_minimum_required(VERSION 3.5)
# TOP is absolute path to root directory of TinyUSB git repo
# needed for esp32sx build. TOOD could be removed later on
set(TOP "../../..")
get_filename_component(TOP "${TOP}" REALPATH)
cmake_minimum_required(VERSION 3.17)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
project(${PROJECT})
project(${PROJECT} C CXX ASM)
# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
# Check for -DFAMILY=
if(FAMILY MATCHES "^esp32s[2-3]")
else()
message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}")
# Espressif has its own cmake build system
if(FAMILY STREQUAL "espressif")
return()
endif()
add_executable(${PROJECT})
# Example source
target_sources(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/freertos_hook.c
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
)
# Example include
target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
# Configure compilation flags and libraries for the example with FreeRTOS.
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT} freertos)

View file

@ -1,16 +1,14 @@
DEPS_SUBMODULES += lib/FreeRTOS-Kernel
include ../../../tools/top.mk
include ../../make.mk
FREERTOS_SRC = lib/FreeRTOS-Kernel
FREERTOS_PORTABLE_PATH= $(FREERTOS_SRC)/portable/$(if $(USE_IAR),IAR,GCC)
INC += \
src \
src/FreeRTOSConfig \
$(TOP)/hw \
$(TOP)/$(FREERTOS_SRC)/include \
$(TOP)/$(FREERTOS_SRC)/portable/GCC/$(FREERTOS_PORT)
$(TOP)/$(FREERTOS_PORTABLE_SRC) \
# Example source
EXAMPLE_SOURCE = \
@ -27,12 +25,22 @@ SRC_C += \
$(FREERTOS_SRC)/queue.c \
$(FREERTOS_SRC)/tasks.c \
$(FREERTOS_SRC)/timers.c \
$(subst ../../../,,$(wildcard ../../../$(FREERTOS_SRC)/portable/GCC/$(FREERTOS_PORT)/*.c))
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.c))
# Suppress FreeRTOS warnings
CFLAGS += -Wno-error=cast-qual -Wno-error=redundant-decls
SRC_S += \
$(subst $(TOP)/,,$(wildcard $(TOP)/$(FREERTOS_PORTABLE_SRC)/*.s))
# include heap manage if configSUPPORT_DYNAMIC_ALLOCATION = 1
# SRC_C += $(FREERTOS_SRC)/portable/MemMang/heap_1.c
# CFLAGS += -Wno-error=sign-compare
# Suppress FreeRTOSConfig.h warnings
CFLAGS_GCC += -Wno-error=redundant-decls
# Suppress FreeRTOS source warnings
CFLAGS_GCC += -Wno-error=cast-qual
# FreeRTOS (lto + Os) linker issue
LDFLAGS += -Wl,--undefined=vTaskSwitchContext
LDFLAGS_GCC += -Wl,--undefined=vTaskSwitchContext
include ../../rules.mk

View file

@ -1,3 +1,4 @@
mcu:CH32V307
mcu:CXD56
mcu:F1C100S
mcu:GD32VF103
@ -7,5 +8,6 @@ mcu:RP2040
mcu:SAMD11
mcu:SAMX7X
mcu:VALENTYUSB_EPTRI
mcu:RAXXX
family:broadcom_32bit
family:broadcom_64bit

View file

@ -1,35 +1,4 @@
# This file is for ESP-IDF only
idf_component_register(SRCS "main.c" "usb_descriptors.c" "msc_disk.c"
INCLUDE_DIRS "."
REQUIRES freertos soc)
file(TO_NATIVE_PATH "${TOP}/hw/bsp/${FAMILY}/boards/${BOARD}/board.cmake" board_cmake)
if(EXISTS ${board_cmake})
include(${board_cmake})
endif()
target_include_directories(${COMPONENT_TARGET} PUBLIC
"${TOP}/hw"
"${TOP}/src"
)
target_compile_definitions(${COMPONENT_TARGET} PUBLIC
ESP_PLATFORM
)
target_sources(${COMPONENT_TARGET} PUBLIC
"${TOP}/src/tusb.c"
"${TOP}/src/common/tusb_fifo.c"
"${TOP}/src/device/usbd.c"
"${TOP}/src/device/usbd_control.c"
"${TOP}/src/class/cdc/cdc_device.c"
"${TOP}/src/class/dfu/dfu_rt_device.c"
"${TOP}/src/class/hid/hid_device.c"
"${TOP}/src/class/midi/midi_device.c"
"${TOP}/src/class/msc/msc_device.c"
"${TOP}/src/class/net/ecm_rndis_device.c"
"${TOP}/src/class/net/ncm_device.c"
"${TOP}/src/class/usbtmc/usbtmc_device.c"
"${TOP}/src/class/vendor/vendor_device.c"
"${TOP}/src/portable/synopsys/dwc2/dcd_dwc2.c"
)
REQUIRES boards tinyusb_src)

View file

@ -42,6 +42,9 @@
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
// skip if included from IAR assembler
#ifndef __IASMARM__
// Include MCU header
#include "bsp/board_mcu.h"
@ -57,6 +60,8 @@
extern uint32_t SystemCoreClock;
#endif
#endif
/* Cortex M23/M33 port configuration. */
#define configENABLE_MPU 0
#define configENABLE_FPU 1
@ -69,14 +74,14 @@
#define configTICK_RATE_HZ ( 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( 128 )
#define configTOTAL_HEAP_SIZE ( 0*1024 ) // dynamic is not used
#define configTOTAL_HEAP_SIZE ( configSUPPORT_DYNAMIC_ALLOCATION*4*1024 )
#define configMAX_TASK_NAME_LEN 16
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_COUNTING_SEMAPHORES 1
#define configQUEUE_REGISTRY_SIZE 2
#define configQUEUE_REGISTRY_SIZE 4
#define configUSE_QUEUE_SETS 0
#define configUSE_TIME_SLICING 0
#define configUSE_NEWLIB_REENTRANT 0
@ -163,9 +168,18 @@
#if defined(__NVIC_PRIO_BITS)
// For Cortex-M specific: __NVIC_PRIO_BITS is defined in core_cmx.h
#define configPRIO_BITS __NVIC_PRIO_BITS
#elif defined(__ECLIC_INTCTLBITS)
// RISC-V Bumblebee core from nuclei
#define configPRIO_BITS __ECLIC_INTCTLBITS
#elif defined(__IASMARM__)
// FIXME: IAR Assembler cannot include mcu header directly to get __NVIC_PRIO_BITS.
// Therefore we will hard coded it to minimum value of 2 to get pass ci build.
// IAR user must update this to correct value of the target MCU
#message "configPRIO_BITS is hard coded to 2 to pass IAR build only. User should update it per MCU"
#define configPRIO_BITS 2
#else
#error "FreeRTOS configPRIO_BITS to be defined"
#endif

View file

@ -27,7 +27,7 @@
#include <stdio.h>
#include <string.h>
#include "bsp/board.h"
#include "bsp/board_api.h"
#include "tusb.h"
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
@ -41,6 +41,7 @@
#define USBD_STACK_SIZE 4096
#else
#include "FreeRTOS.h"
#include "semphr.h"
#include "queue.h"
@ -51,8 +52,10 @@
#define USBD_STACK_SIZE (3*configMINIMAL_STACK_SIZE/2) * (CFG_TUSB_DEBUG ? 2 : 1)
#endif
#define CDC_STACK_SZIE configMINIMAL_STACK_SIZE
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF PROTYPES
// MACRO CONSTANT TYPEDEF PROTOTYPES
//--------------------------------------------------------------------+
/* Blink pattern
@ -66,41 +69,46 @@ enum {
BLINK_SUSPENDED = 2500,
};
// static timer
// static timer & task
#if configSUPPORT_STATIC_ALLOCATION
StaticTimer_t blinky_tmdef;
TimerHandle_t blinky_tm;
// static task
StackType_t usb_device_stack[USBD_STACK_SIZE];
StaticTask_t usb_device_taskdef;
// static task for cdc
#define CDC_STACK_SZIE configMINIMAL_STACK_SIZE
StackType_t cdc_stack[CDC_STACK_SZIE];
StaticTask_t cdc_taskdef;
#endif
TimerHandle_t blinky_tm;
void led_blinky_cb(TimerHandle_t xTimer);
void usb_device_task(void* param);
static void led_blinky_cb(TimerHandle_t xTimer);
static void usb_device_task(void *param);
void cdc_task(void *params);
//--------------------------------------------------------------------+
// Main
//--------------------------------------------------------------------+
int main(void)
{
int main(void) {
board_init();
#if configSUPPORT_STATIC_ALLOCATION
// soft timer for blinky
blinky_tm = xTimerCreateStatic(NULL, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), true, NULL, led_blinky_cb, &blinky_tmdef);
xTimerStart(blinky_tm, 0);
// Create a task for tinyusb device stack
(void) xTaskCreateStatic( usb_device_task, "usbd", USBD_STACK_SIZE, NULL, configMAX_PRIORITIES-1, usb_device_stack, &usb_device_taskdef);
xTaskCreateStatic(usb_device_task, "usbd", USBD_STACK_SIZE, NULL, configMAX_PRIORITIES-1, usb_device_stack, &usb_device_taskdef);
// Create CDC task
(void) xTaskCreateStatic( cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, cdc_stack, &cdc_taskdef);
xTaskCreateStatic(cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, cdc_stack, &cdc_taskdef);
#else
blinky_tm = xTimerCreate(NULL, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), true, NULL, led_blinky_cb);
xTaskCreate(usb_device_task, "usbd", USBD_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL);
xTaskCreate(cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES - 2, NULL);
#endif
xTimerStart(blinky_tm, 0);
// skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
#if !TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
@ -111,16 +119,14 @@ int main(void)
}
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
void app_main(void)
{
void app_main(void) {
main();
}
#endif
// USB Device Driver task
// This top level thread process all usb events and invoke callbacks
void usb_device_task(void* param)
{
static void usb_device_task(void *param) {
(void) param;
// init device stack on configured roothub port
@ -128,9 +134,12 @@ void usb_device_task(void* param)
// Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API.
tud_init(BOARD_TUD_RHPORT);
if (board_init_after_tusb) {
board_init_after_tusb();
}
// RTOS forever loop
while (1)
{
while (1) {
// put this thread to waiting state until there is new events
tud_task();
@ -144,49 +153,46 @@ void usb_device_task(void* param)
//--------------------------------------------------------------------+
// Invoked when device is mounted
void tud_mount_cb(void)
{
void tud_mount_cb(void) {
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
}
// Invoked when device is unmounted
void tud_umount_cb(void)
{
void tud_umount_cb(void) {
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), 0);
}
// Invoked when usb bus is suspended
// remote_wakeup_en : if host allow us to perform remote wakeup
// Within 7ms, device must draw an average of current less than 2.5 mA from bus
void tud_suspend_cb(bool remote_wakeup_en)
{
void tud_suspend_cb(bool remote_wakeup_en) {
(void) remote_wakeup_en;
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_SUSPENDED), 0);
}
// Invoked when usb bus is resumed
void tud_resume_cb(void)
{
void tud_resume_cb(void) {
if (tud_mounted()) {
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_MOUNTED), 0);
} else {
xTimerChangePeriod(blinky_tm, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), 0);
}
}
//--------------------------------------------------------------------+
// USB CDC
//--------------------------------------------------------------------+
void cdc_task(void* params)
{
void cdc_task(void *params) {
(void) params;
// RTOS forever loop
while ( 1 )
{
while (1) {
// connected() check for DTR bit
// Most but not all terminal client set this when making connection
// if ( tud_cdc_connected() )
{
// There are data available
while ( tud_cdc_available() )
{
while (tud_cdc_available()) {
uint8_t buf[64];
// read and echo back
@ -209,32 +215,27 @@ void cdc_task(void* params)
}
// Invoked when cdc when line state changed e.g connected/disconnected
void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
{
void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) {
(void) itf;
(void) rts;
// TODO set some indicator
if ( dtr )
{
if (dtr) {
// Terminal connected
}else
{
} else {
// Terminal disconnected
}
}
// Invoked when CDC interface received data from host
void tud_cdc_rx_cb(uint8_t itf)
{
void tud_cdc_rx_cb(uint8_t itf) {
(void) itf;
}
//--------------------------------------------------------------------+
// BLINKING TASK
//--------------------------------------------------------------------+
void led_blinky_cb(TimerHandle_t xTimer)
{
static void led_blinky_cb(TimerHandle_t xTimer) {
(void) xTimer;
static bool led_state = false;

View file

@ -23,7 +23,7 @@
*
*/
#include "bsp/board.h"
#include "bsp/board_api.h"
#include "tusb.h"
#if CFG_TUD_MSC

View file

@ -54,7 +54,9 @@
#endif
// This examples use FreeRTOS
#ifndef CFG_TUSB_OS
#define CFG_TUSB_OS OPT_OS_FREERTOS
#endif
// Espressif IDF requires "freertos/" prefix in include path
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)

View file

@ -23,6 +23,7 @@
*
*/
#include "bsp/board_api.h"
#include "tusb.h"
/* A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
@ -212,33 +213,44 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
// String Descriptors
//--------------------------------------------------------------------+
// String Descriptor Index
enum {
STRID_LANGID = 0,
STRID_MANUFACTURER,
STRID_PRODUCT,
STRID_SERIAL,
};
// array of pointer to string descriptors
char const *string_desc_arr[] =
{
(const char[]) { 0x09, 0x04 }, // 0: is supported language is English (0x0409)
"TinyUSB", // 1: Manufacturer
"TinyUSB Device", // 2: Product
"123456789012", // 3: Serials, should use chip ID
NULL, // 3: Serials will use unique ID if possible
"TinyUSB CDC", // 4: CDC Interface
"TinyUSB MSC", // 5: MSC Interface
};
static uint16_t _desc_str[32];
static uint16_t _desc_str[32 + 1];
// Invoked when received GET STRING DESCRIPTOR request
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
{
uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
(void) langid;
size_t chr_count;
uint8_t chr_count;
if ( index == 0)
{
switch ( index ) {
case STRID_LANGID:
memcpy(&_desc_str[1], string_desc_arr[0], 2);
chr_count = 1;
}else
{
break;
case STRID_SERIAL:
chr_count = board_usb_get_serial(_desc_str + 1, 32);
break;
default:
// Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
// https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
@ -247,14 +259,15 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
const char *str = string_desc_arr[index];
// Cap at max char
chr_count = (uint8_t) strlen(str);
if ( chr_count > 31 ) chr_count = 31;
chr_count = strlen(str);
size_t const max_count = sizeof(_desc_str) / sizeof(_desc_str[0]) - 1; // -1 for string type
if ( chr_count > max_count ) chr_count = max_count;
// Convert ASCII string into UTF-16
for(uint8_t i=0; i<chr_count; i++)
{
for ( size_t i = 0; i < chr_count; i++ ) {
_desc_str[1 + i] = str[i];
}
break;
}
// first byte is length (including header), second byte is string type

View file

@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.17)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
project(${PROJECT} C CXX ASM)
# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
# Espressif has its own cmake build system
if(FAMILY STREQUAL "espressif")
return()
endif()
add_executable(${PROJECT})
# Example source
target_sources(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/cdc_app.c
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
${CMAKE_CURRENT_SOURCE_DIR}/src/uac2_app.c
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
)
# Example include
target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT} noos)
# Uncomment me to enable UART based debugging
# pico_enable_stdio_uart(${PROJECT} 1)

View file

@ -0,0 +1,16 @@
include ../../make.mk
INC += \
src \
$(TOP)/hw \
# Example source
EXAMPLE_SOURCE += \
src/cdc_app.c \
src/main.c \
src/uac2_app.c \
src/usb_descriptors.c \
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
include ../../rules.mk

View file

@ -0,0 +1,52 @@
#### Composite CDC + UAC2 on Pico
This example provides a composite CDC + UAC2 device on top of a Raspberry Pi
Pico board.
#### Use Cases
- The CDC + UAC2 composite device happens to be important, especially in the
amateur radio community.
Modern radios (`rigs`) like Icom IC-7300 + IC-705 expose a sound card and a
serial device (`composite device`) to the computer over a single USB cable.
This allows for Audio I/O and CAT control over a single USB cable which is
very convenient.
By including and maintaining this example in TinyUSB repository, we enable
the amateur radio community to build (`homebrew`) radios with similar
functionality as the (expensive) commercial rigs.
This PR is important in bridging this specific gap between the commercial
rigs and homebrew equipment.
- https://digirig.net/digirig-mobile-rev-1-9/ is a digital interface for
interfacing radios (that lack an inbuilt digital interface) with computers.
Digirig Mobile works brilliantly (is OSS!) and is a big improvement over
traditional digital interfaces (like the SignaLink USB Interface). By using a
Raspberry Pi Pico powered CDC + UAC2 composite device, we can simplify the
Digirig Mobile schematic, drastically reduce the manufacturing cost, and
(again) enable the homebrewers community to homebrew a modern digital interface
with ease themselves.
#### Build Steps
```
cd examples/device/cdc_uac2
export PICO_SDK_PATH=$HOME/pico-sdk
cmake -DFAMILY=rp2040 pico .
cmake -DFAMILY=rp2040 -DCMAKE_BUILD_TYPE=Debug # use this for debugging
make BOARD=raspberry_pi_pico all
```
#### Development Notes
Please try to keep this code synchronized with the `uac2_headset` example
included in this repository.

Some files were not shown because too many files have changed in this diff Show more