Skip to content

Commit 37df71c

Browse files
committed
Merge remote-tracking branch 'tinyusb/master' into hcd_fsdev
2 parents a965e1f + 3884249 commit 37df71c

File tree

58 files changed

+153
-52
lines changed

Some content is hidden

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

58 files changed

+153
-52
lines changed

examples/build_system/cmake/cpu/cortex-m55.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ elseif (TOOLCHAIN STREQUAL "clang")
1313
--target=arm-none-eabi
1414
-mcpu=cortex-m55
1515
-mfpu=fpv5-d16
16+
-mcmse
1617
)
1718
set(FREERTOS_PORT GCC_ARM_CM55_NTZ_NONSECURE CACHE INTERNAL "")
1819

1920
elseif (TOOLCHAIN STREQUAL "iar")
2021
set(TOOLCHAIN_COMMON_FLAGS
2122
--cpu cortex-m55
2223
--fpu VFPv5_D16
24+
--cmse
2325
)
2426
set(FREERTOS_PORT IAR_ARM_CM55_NTZ_NONSECURE CACHE INTERNAL "")
2527

examples/device/audio_test_multi_rate/src/usb_descriptors.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ TU_VERIFY_STATIC(sizeof(desc2_uac2_configuration) == CONFIG_UAC2_TOTAL_LEN, "Inc
119119

120120
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
121121
tusb_desc_device_qualifier_t const desc_device_qualifier = {
122-
.bLength = sizeof(tusb_desc_device_t),
123-
.bDescriptorType = TUSB_DESC_DEVICE,
122+
.bLength = sizeof(tusb_desc_device_qualifier_t),
123+
.bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
124124
.bcdUSB = 0x0200,
125125

126126
.bDeviceClass = TUSB_CLASS_MISC,

examples/device/cdc_dual_ports/src/usb_descriptors.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ static uint8_t const desc_hs_configuration[] = {
153153

154154
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
155155
static tusb_desc_device_qualifier_t const desc_device_qualifier = {
156-
.bLength = sizeof(tusb_desc_device_t),
157-
.bDescriptorType = TUSB_DESC_DEVICE,
156+
.bLength = sizeof(tusb_desc_device_qualifier_t),
157+
.bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
158158
.bcdUSB = USB_BCD,
159159

160160
.bDeviceClass = TUSB_CLASS_MISC,

examples/device/uac2_speaker_fb/src/audio_debug.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
# Install python3 HID package https://pypi.org/project/hid/
33
# Install python3 matplotlib package https://pypi.org/project/matplotlib/
44

5-
from ctypes import *
5+
from ctypes import Structure, c_uint32, c_uint8, c_int8, c_int16, c_uint16
6+
import signal
67
try:
78
import hid
89
import matplotlib.pyplot as plt
910
import matplotlib.animation as animation
1011
except:
1112
print("Missing import, please try 'pip install hid matplotlib' or consult your OS's python package manager.")
13+
exit(1)
1214

1315
# Example must be compiled with CFG_AUDIO_DEBUG=1
1416
VID = 0xcafe
@@ -29,6 +31,7 @@ class audio_debug_info_t (Structure):
2931
dev = hid.Device(VID, PID)
3032

3133
if dev:
34+
signal.signal(signal.SIGINT, signal.SIG_DFL)
3235
# Create figure for plotting
3336
fig = plt.figure()
3437
ax = fig.add_subplot(1, 1, 1)
@@ -61,10 +64,10 @@ def animate(i):
6164
ax.set_ylim(bottom=0, top=info.fifo_size)
6265

6366
# Format plot
64-
plt.title('FIFO information')
65-
plt.grid()
67+
ax.set_title('FIFO information')
68+
ax.grid(True)
6669

6770
print(f'Sample rate:{info.sample_rate} | Alt settings:{info.alt_settings} | Volume:{info.volume[:]}')
6871

69-
ani = animation.FuncAnimation(fig, animate, interval=10)
70-
plt.show()
72+
ani = animation.FuncAnimation(fig, animate, interval=10, cache_frame_data=False) # type: ignore
73+
plt.show(block=True)

examples/device/uac2_speaker_fb/src/usb_descriptors.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ TU_VERIFY_STATIC(sizeof(desc_uac2_configuration) == CONFIG_UAC2_TOTAL_LEN, "Inco
174174

175175
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
176176
tusb_desc_device_qualifier_t const desc_device_qualifier = {
177-
.bLength = sizeof(tusb_desc_device_t),
178-
.bDescriptorType = TUSB_DESC_DEVICE,
177+
.bLength = sizeof(tusb_desc_device_qualifier_t),
178+
.bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
179179
.bcdUSB = 0x0200,
180180

181181
.bDeviceClass = TUSB_CLASS_MISC,

examples/device/video_capture/src/usb_descriptors.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@ static uint8_t * get_hs_configuration_desc(void) {
385385

386386
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
387387
static tusb_desc_device_qualifier_t const desc_device_qualifier = {
388-
.bLength = sizeof(tusb_desc_device_t),
389-
.bDescriptorType = TUSB_DESC_DEVICE,
388+
.bLength = sizeof(tusb_desc_device_qualifier_t),
389+
.bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
390390
.bcdUSB = USB_BCD,
391391

392392
.bDeviceClass = TUSB_CLASS_MISC,

examples/device/video_capture_2ch/src/usb_descriptors.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ static uint8_t * get_hs_configuration_desc(void) {
552552

553553
// device qualifier is mostly similar to device descriptor since we don't change configuration based on speed
554554
static tusb_desc_device_qualifier_t const desc_device_qualifier = {
555-
.bLength = sizeof(tusb_desc_device_t),
556-
.bDescriptorType = TUSB_DESC_DEVICE,
555+
.bLength = sizeof(tusb_desc_device_qualifier_t),
556+
.bDescriptorType = TUSB_DESC_DEVICE_QUALIFIER,
557557
.bcdUSB = USB_BCD,
558558

559559
.bDeviceClass = TUSB_CLASS_MISC,

hw/bsp/at32f402_405/family.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,17 @@ void board_init(void)
7575
/* vbus ignore */
7676
board_vbus_sense_init();
7777

78-
/* configure systick */
79-
SysTick_Config(system_core_clock / 1000);
80-
81-
#if CFG_TUSB_OS == OPT_OS_FREERTOS
78+
#if CFG_TUSB_OS == OPT_OS_NONE
79+
/* configure systick */
80+
SysTick_Config(system_core_clock / 1000);
81+
NVIC_SetPriority(OTGHS_IRQn, 0);
82+
NVIC_SetPriority(OTGFS1_IRQn, 0);
83+
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
84+
// Explicitly disable systick to prevent its ISR from running before scheduler start
85+
SysTick->CTRL &= ~1U;
8286
// If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
8387
NVIC_SetPriority(OTGHS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
8488
NVIC_SetPriority(OTGFS1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
85-
#else
86-
NVIC_SetPriority(OTGHS_IRQn, 0);
87-
NVIC_SetPriority(OTGFS1_IRQn, 0);
8889
#endif
8990

9091
/* config led and key */

hw/bsp/at32f435_437/family.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ void board_init(void) {
7474
/* vbus ignore */
7575
board_vbus_sense_init();
7676

77-
SysTick_Config(SystemCoreClock / 1000);
7877
#if CFG_TUSB_OS == OPT_OS_FREERTOS
78+
// Explicitly disable systick to prevent its ISR from running before scheduler start
79+
SysTick->CTRL &= ~1U;
7980
// If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
8081
NVIC_SetPriority(OTGFS1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
8182
NVIC_SetPriority(OTGFS2_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
8283
#else
84+
SysTick_Config(SystemCoreClock / 1000);
8385
NVIC_SetPriority(OTGFS1_IRQn, 0);
8486
NVIC_SetPriority(OTGFS2_IRQn, 0);
8587
#endif

hw/bsp/imxrt/family.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ void board_init(void) {
120120
#if CFG_TUSB_OS == OPT_OS_NONE
121121
// 1ms tick timer
122122
SysTick_Config(SystemCoreClock / 1000);
123-
124123
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
124+
// Explicitly disable systick to prevent its ISR from running before scheduler start
125+
SysTick->CTRL &= ~1U;
125126
// If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
126127
NVIC_SetPriority(USB_OTG1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
127128
#ifdef USBPHY2

0 commit comments

Comments
 (0)