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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Supported CPUs
+--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+
| Dialog | DA1469x | ✔ | ✖ | ✖ | da146xx | |
+--------------+-----------------------------+--------+------+-----------+------------------------+-------------------+
| Espressif | S2, S3 | ✔ | ✔ | ✖ | dwc2 or esp32sx | |
| Espressif | S2, S3 | ✔ | ✔ | ✖ | dwc2 | |
| ESP32 +-----------------------------+--------+------+-----------+------------------------+-------------------+
| | P4 | ✔ | ✔ | ✔ | dwc2 | |
| +-----------------------------+--------+------+-----------+------------------------+-------------------+
Expand Down
128 changes: 69 additions & 59 deletions hw/bsp/BoardPresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,17 @@
}
},
{
"name": "adafruit_clue",
"inherits": "default"
},
{
"name": "adafruit_feather_esp32_v2",
"inherits": "default"
},
{
"name": "adafruit_feather_esp32c6",
"inherits": "default"
},
{
"name": "adafruit_feather_esp32s2",
"inherits": "default"
"name": "default single config",
"hidden": true,
"description": "Configure preset for the ${presetName} board",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"BOARD": "${presetName}"
}
},
{
"name": "adafruit_feather_esp32s3",
"name": "adafruit_clue",
"inherits": "default"
},
{
Expand All @@ -40,14 +34,6 @@
"name": "adafruit_fruit_jam",
"inherits": "default"
},
{
"name": "adafruit_magtag_29gray",
"inherits": "default"
},
{
"name": "adafruit_metro_esp32s2",
"inherits": "default"
},
{
"name": "adafruit_metro_rp2350",
"inherits": "default"
Expand Down Expand Up @@ -188,42 +174,6 @@
"name": "ek_tm4c123gxl",
"inherits": "default"
},
{
"name": "espressif_addax_1",
"inherits": "default"
},
{
"name": "espressif_c3_devkitc",
"inherits": "default"
},
{
"name": "espressif_c6_devkitc",
"inherits": "default"
},
{
"name": "espressif_kaluga_1",
"inherits": "default"
},
{
"name": "espressif_p4_function_ev",
"inherits": "default"
},
{
"name": "espressif_s2_devkitc",
"inherits": "default"
},
{
"name": "espressif_s3_devkitc",
"inherits": "default"
},
{
"name": "espressif_s3_devkitm",
"inherits": "default"
},
{
"name": "espressif_saola_1",
"inherits": "default"
},
{
"name": "f1c100s",
"inherits": "default"
Expand Down Expand Up @@ -823,6 +773,66 @@
{
"name": "xmc4700_relax",
"inherits": "default"
},
{
"name": "adafruit_feather_esp32_v2",
"inherits": "default single config"
},
{
"name": "adafruit_feather_esp32c6",
"inherits": "default single config"
},
{
"name": "adafruit_feather_esp32s2",
"inherits": "default single config"
},
{
"name": "adafruit_feather_esp32s3",
"inherits": "default single config"
},
{
"name": "adafruit_magtag_29gray",
"inherits": "default single config"
},
{
"name": "adafruit_metro_esp32s2",
"inherits": "default single config"
},
{
"name": "espressif_addax_1",
"inherits": "default single config"
},
{
"name": "espressif_c3_devkitc",
"inherits": "default single config"
},
{
"name": "espressif_c6_devkitc",
"inherits": "default single config"
},
{
"name": "espressif_kaluga_1",
"inherits": "default single config"
},
{
"name": "espressif_p4_function_ev",
"inherits": "default single config"
},
{
"name": "espressif_s2_devkitc",
"inherits": "default single config"
},
{
"name": "espressif_s3_devkitc",
"inherits": "default single config"
},
{
"name": "espressif_s3_devkitm",
"inherits": "default single config"
},
{
"name": "espressif_saola_1",
"inherits": "default single config"
}
],
"buildPresets": [
Expand Down
5 changes: 2 additions & 3 deletions src/class/audio/audio_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@
// Linear buffer in case target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer
// is available or driver is would need to be changed dramatically

// Only STM32 and dcd_transdimension use non-linear buffer for now
// dwc2 except esp32sx (since it may use dcd_esp32sx)
// Only STM32 and ChipIdea HS use non-linear buffer for now
// Ring buffer is incompatible with dcache, since neither address nor size is aligned to cache line
#if (defined(TUP_USBIP_DWC2) && !TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)) || \
#if defined(TUP_USBIP_DWC2) || \
defined(TUP_USBIP_FSDEV) || \
CFG_TUSB_MCU == OPT_MCU_RX63X || \
CFG_TUSB_MCU == OPT_MCU_RX65X || \
Expand Down
2 changes: 1 addition & 1 deletion src/class/mtp/mtp_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static bool mtpd_data_xfer(mtp_container_info_t* p_container, uint8_t ep_addr) {
TU_ASSERT(p_mtp->phase == MTP_PHASE_DATA);
}

const uint16_t xact_len = tu_min16((uint16_t) (p_mtp->total_len - p_mtp->xferred_len), CFG_TUD_MTP_EP_BUFSIZE);
const uint16_t xact_len = (uint16_t) tu_min32(p_mtp->total_len - p_mtp->xferred_len, CFG_TUD_MTP_EP_BUFSIZE);
if (xact_len) {
// already transferred all bytes in header's length. Application make an unnecessary extra call
TU_VERIFY(usbd_edpt_claim(p_mtp->rhport, ep_addr));
Expand Down
23 changes: 19 additions & 4 deletions src/common/tusb_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,35 @@ extern void* tusb_app_phys_to_virt(void *phys_addr);

// This is a backport of memset_s from c11
TU_ATTR_ALWAYS_INLINE static inline int tu_memset_s(void *dest, size_t destsz, int ch, size_t count) {
// TODO may check if desst and src is not NULL
if ( count > destsz ) {
// Validate parameters
if (dest == NULL) {
return -1;
}

if (count > destsz) {
return -1;
}

memset(dest, ch, count);
return 0;
}

// This is a backport of memcpy_s from c11
TU_ATTR_ALWAYS_INLINE static inline int tu_memcpy_s(void *dest, size_t destsz, const void *src, size_t count) {
// TODO may check if desst and src is not NULL
if ( count > destsz ) {
// Validate parameters
if (dest == NULL) {
return -1;
}

// For memcpy, src may be NULL only if count == 0. Reject otherwise.
if (src == NULL && count != 0) {
return -1;
}

if (count > destsz) {
return -1;
}

memcpy(dest, src, count);
return 0;
}
Expand Down
Loading