Skip to content

Commit 88ef942

Browse files
committed
add stm32 to readme as wip and update tusb_config_stm32.h
1 parent 6e38500 commit 88ef942

2 files changed

Lines changed: 22 additions & 12 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Note: For ESP32 port, version before v3.0 requires all descriptors must be speci
5050
Following is cores without built-in support
5151

5252
- **mbed_rp2040**
53+
- **[stm32duino/Arduino_Core_STM32](https://github.com/stm32duino/Arduino_Core_STM32)**
54+
- Still WIP, only support/tested with F4, only support OTG_FS
5355

5456
It is still possible to use TinyUSB but with some limits such as:
5557

src/arduino/ports/stm32/tusb_config_stm32.h

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@
2525
#ifndef TUSB_CONFIG_STM32_H_
2626
#define TUSB_CONFIG_STM32_H_
2727

28-
// USB Port
29-
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
30-
#define CFG_TUSB_RHPORT0_SPEED OPT_FULL_SPEED
31-
#define CFG_TUSB_RHPORT1_MODE OPT_MODE_NONE
32-
28+
//--------------------------------------------------------------------
29+
// COMMON CONFIGURATION
30+
//--------------------------------------------------------------------
3331
// MCU / OS
3432
#define CFG_TUSB_MCU OPT_MCU_STM32F4
3533
#define CFG_TUSB_OS OPT_OS_NONE
@@ -42,8 +40,11 @@
4240
#define CFG_TUSB_MEM_SECTION
4341
#define CFG_TUSB_MEM_ALIGN __attribute__((aligned(4)))
4442

45-
// Device stack
43+
//--------------------------------------------------------------------
44+
// DEVICE CONFIGURATION
45+
//--------------------------------------------------------------------
4646
#define CFG_TUD_ENABLED 1
47+
#define CFG_TUD_MAX_SPEED OPT_MODE_FULL_SPEED // TODO some are highspeed
4748
#define CFG_TUD_ENDPOINT0_SIZE 64
4849

4950
// Classes
@@ -54,15 +55,22 @@
5455
#define CFG_TUD_VENDOR 1
5556

5657
// Buffer sizes
57-
#define CFG_TUD_CDC_RX_BUFSIZE 64
58-
#define CFG_TUD_CDC_TX_BUFSIZE 64
58+
#define CFG_TUD_CDC_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
59+
#define CFG_TUD_CDC_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
60+
#define CFG_TUD_CDC_EP_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
61+
#define CFG_TUD_MSC_EP_BUFSIZE 512
5962
#define CFG_TUD_HID_EP_BUFSIZE 64
60-
#define CFG_TUD_MIDI_RX_BUFSIZE 128
61-
#define CFG_TUD_MIDI_TX_BUFSIZE 128
62-
#define CFG_TUD_VENDOR_RX_BUFSIZE 64
63-
#define CFG_TUD_VENDOR_TX_BUFSIZE 64
63+
#define CFG_TUD_MIDI_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 128)
64+
#define CFG_TUD_MIDI_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 128)
65+
#define CFG_TUD_VENDOR_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
66+
#define CFG_TUD_VENDOR_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
6467

6568
// Serial Redirect
6669
#define Serial SerialTinyUSB
6770

71+
//--------------------------------------------------------------------
72+
// Host Configuration
73+
//--------------------------------------------------------------------
74+
#define CFG_TUH_ENABLED 0 // disable for now
75+
6876
#endif

0 commit comments

Comments
 (0)