Skip to content

Commit 586d284

Browse files
authored
Merge branch 'master' into patch-1
2 parents 19b6baa + feb41ee commit 586d284

File tree

220 files changed

+416
-22592
lines changed

Some content is hidden

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

220 files changed

+416
-22592
lines changed

.circleci/config2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ commands:
114114
name: Build
115115
command: |
116116
if [ << parameters.toolchain >> == esp-idf ]; then
117-
docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.1 python tools/build.py << parameters.family >>
117+
docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.2 python tools/build.py << parameters.family >>
118118
else
119119
# Toolchain option default is gcc
120120
if [ << parameters.toolchain >> == arm-clang ]; then

.github/actions/setup_toolchain/action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ inputs:
44
toolchain:
55
description: 'Toolchain name'
66
required: true
7-
toolchain_version:
8-
description: 'Toolchain version'
9-
required: false
107

118
outputs:
129
build_option:
@@ -27,7 +24,6 @@ runs:
2724
uses: ./.github/actions/setup_toolchain/espressif
2825
with:
2926
toolchain: ${{ inputs.toolchain }}
30-
toolchain_version: ${{ inputs.toolchain_version }}
3127

3228
- name: Get Toolchain URL
3329
if: >-

.github/actions/setup_toolchain/espressif/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ inputs:
66
required: true
77
toolchain_version:
88
description: 'Toolchain version'
9-
required: true
9+
required: false
10+
default: 'v5.3.2'
1011

1112
runs:
1213
using: "composite"
@@ -39,3 +40,9 @@ runs:
3940
du -sh $DOCKER_ESP_IDF
4041
docker load --input $DOCKER_ESP_IDF
4142
shell: bash
43+
44+
- name: Tag Local Image
45+
run: |
46+
docker tag espressif/idf:${{ inputs.toolchain_version }} espressif/idf:tinyusb
47+
docker images
48+
shell: bash

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
runs-on: [self-hosted, Linux, X64, hifiphile]
119119
env:
120120
BUILD_ARGS: ${{ join(fromJSON(needs.set-matrix.outputs.json)['arm-iar'], ' ') }}
121-
# IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
121+
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
122122
steps:
123123
- name: Clean workspace
124124
run: |

.github/workflows/build_util.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
uses: ./.github/actions/setup_toolchain
4242
with:
4343
toolchain: ${{ inputs.toolchain }}
44-
toolchain_version: 'v5.3.1'
4544

4645
- name: Get Dependencies
4746
uses: ./.github/actions/get_deps
@@ -61,7 +60,7 @@ jobs:
6160
- name: Build
6261
run: |
6362
if [ "${{ inputs.toolchain }}" == "esp-idf" ]; then
64-
docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.1 python tools/build.py ${{ matrix.arg }}
63+
docker run --rm -v $PWD:/project -w /project espressif/idf:tinyusb python tools/build.py ${{ matrix.arg }}
6564
else
6665
python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }}
6766
fi

.github/workflows/hil_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ jobs:
9494
hil-hfp:
9595
if: github.repository_owner == 'hathach'
9696
runs-on: [self-hosted, Linux, X64, hifiphile]
97-
#env:
98-
# IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
97+
env:
98+
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}
9999
steps:
100100
- name: Clean workspace
101101
run: |

hw/bsp/espressif/boards/family.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,20 +175,14 @@ bool usb_init(void) {
175175
// maybe we can use USB_OTG_MODE_DEFAULT and switch using dwc2 driver
176176
#if CFG_TUD_ENABLED
177177
.otg_mode = USB_OTG_MODE_DEVICE,
178-
.otg_speed = BOARD_TUD_RHPORT ? USB_PHY_SPEED_HIGH : USB_PHY_SPEED_FULL,
179178
#elif CFG_TUH_ENABLED
180179
.otg_mode = USB_OTG_MODE_HOST,
181-
.otg_speed= BOARD_TUH_RHPORT ? USB_PHY_SPEED_HIGH : USB_PHY_SPEED_FULL,
182180
#endif
181+
// https://github.com/hathach/tinyusb/issues/2943#issuecomment-2601888322
182+
// Set speed to undefined (auto-detect) to avoid timinng/racing issue with S3 with host such as macOS
183+
.otg_speed = USB_PHY_SPEED_UNDEFINED,
183184
};
184185

185-
// OTG IOs config
186-
// const usb_phy_otg_io_conf_t otg_io_conf = USB_PHY_SELF_POWERED_DEVICE(config->vbus_monitor_io);
187-
// if (config->self_powered) {
188-
// phy_conf.otg_io_conf = &otg_io_conf;
189-
// }
190-
// ESP_RETURN_ON_ERROR(usb_new_phy(&phy_conf, &phy_hdl), TAG, "Install USB PHY failed");
191-
192186
usb_new_phy(&phy_conf, &phy_hdl);
193187

194188
return true;

src/class/hid/hid_host.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ bool tuh_hid_send_report(uint8_t daddr, uint8_t idx, uint8_t report_id, const vo
410410
++len; // 1 more byte for report_id
411411
}
412412

413-
TU_LOG3_MEM(p_hid->epout_buf, len, 2);
413+
TU_LOG3_MEM(epbuf->epout, len, 2);
414414

415415
if (!usbh_edpt_xfer(daddr, p_hid->ep_out, epbuf->epout, len)) {
416416
usbh_edpt_release(daddr, p_hid->ep_out);
@@ -445,7 +445,7 @@ bool hidh_xfer_cb(uint8_t daddr, uint8_t ep_addr, xfer_result_t result, uint32_t
445445

446446
if (dir == TUSB_DIR_IN) {
447447
TU_LOG_DRV(" Get Report callback (%u, %u)\r\n", daddr, idx);
448-
TU_LOG3_MEM(p_hid->epin_buf, xferred_bytes, 2);
448+
TU_LOG3_MEM(epbuf->epin, xferred_bytes, 2);
449449
tuh_hid_report_received_cb(daddr, idx, epbuf->epin, (uint16_t) xferred_bytes);
450450
} else {
451451
if (tuh_hid_report_sent_cb) {

src/class/net/ncm_device.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static bool xmit_requested_datagram_fits_into_current_ntb(uint16_t datagram_size
390390
if (ncm_interface.xmit_glue_ntb_datagram_ndx >= CFG_TUD_NCM_IN_MAX_DATAGRAMS_PER_NTB) {
391391
return false;
392392
}
393-
if (ncm_interface.xmit_glue_ntb->nth.wBlockLength + datagram_size + XMIT_ALIGN_OFFSET(datagram_size) > CFG_TUD_NCM_OUT_NTB_MAX_SIZE) {
393+
if (ncm_interface.xmit_glue_ntb->nth.wBlockLength + datagram_size + XMIT_ALIGN_OFFSET(datagram_size) > CFG_TUD_NCM_IN_NTB_MAX_SIZE) {
394394
return false;
395395
}
396396
return true;
@@ -674,7 +674,7 @@ static void recv_transfer_datagram_to_glue_logic(void) {
674674
bool tud_network_can_xmit(uint16_t size) {
675675
TU_LOG_DRV("tud_network_can_xmit(%d)\n", size);
676676

677-
TU_ASSERT(size <= CFG_TUD_NCM_OUT_NTB_MAX_SIZE - (sizeof(nth16_t) + sizeof(ndp16_t) + 2 * sizeof(ndp16_datagram_t)), false);
677+
TU_ASSERT(size <= CFG_TUD_NCM_IN_NTB_MAX_SIZE - (sizeof(nth16_t) + sizeof(ndp16_t) + 2 * sizeof(ndp16_datagram_t)), false);
678678

679679
if (xmit_requested_datagram_fits_into_current_ntb(size) || xmit_setup_next_glue_ntb()) {
680680
// -> everything is fine
@@ -709,7 +709,7 @@ void tud_network_xmit(void *ref, uint16_t arg) {
709709

710710
ntb->nth.wBlockLength += (uint16_t) (size + XMIT_ALIGN_OFFSET(size));
711711

712-
if (ntb->nth.wBlockLength > CFG_TUD_NCM_OUT_NTB_MAX_SIZE) {
712+
if (ntb->nth.wBlockLength > CFG_TUD_NCM_IN_NTB_MAX_SIZE) {
713713
TU_LOG_DRV("(EE) tud_network_xmit: buffer overflow\n"); // must not happen (really)
714714
return;
715715
}
@@ -857,7 +857,8 @@ bool netd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_
857857
// - if there is a free receive buffer, initiate reception
858858
if (!recv_validate_datagram(ncm_interface.recv_tinyusb_ntb, xferred_bytes)) {
859859
// verification failed: ignore NTB and return it to free
860-
TU_LOG_DRV("(EE) VALIDATION FAILED. WHAT CAN WE DO IN THIS CASE?\n");
860+
TU_LOG_DRV("Invalid datatagram. Ignoring NTB\n");
861+
recv_put_ntb_into_free_list(ncm_interface.recv_tinyusb_ntb);
861862
} else {
862863
// packet ok -> put it into ready list
863864
recv_put_ntb_into_ready_list(ncm_interface.recv_tinyusb_ntb);

src/portable/nxp/khci/dcd_khci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ void dcd_int_handler(uint8_t rhport)
565565

566566
if (is & USB_ISTAT_SOFTOK_MASK) {
567567
KHCI->ISTAT = USB_ISTAT_SOFTOK_MASK;
568-
dcd_event_bus_signal(rhport, DCD_EVENT_SOF, true);
568+
dcd_event_sof(rhport, tu_u16(KHCI->FRMNUMH, KHCI->FRMNUML), true);
569569
}
570570

571571
if (is & USB_ISTAT_STALL_MASK) {

0 commit comments

Comments
 (0)