From 8206002dba7d903de9f269741fbd086cb9399bec Mon Sep 17 00:00:00 2001 From: Mengsk Date: Tue, 30 Sep 2025 16:23:58 +0200 Subject: update docs Signed-off-by: Mengsk --- docs/reference/boards.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/reference/boards.rst b/docs/reference/boards.rst index 25542264c..3f8277247 100644 --- a/docs/reference/boards.rst +++ b/docs/reference/boards.rst @@ -299,6 +299,7 @@ stm32l4r5nucleo STM32 L4R5 Nucleo stm32l4 https://www.s stm32n6570dk STM32 N6570-DK stm32n6 https://www.st.com/en/evaluation-tools/stm32n6570-dk.html stm32n657nucleo STM32 N657X0-Q Nucleo stm32n6 https://www.st.com/en/evaluation-tools/nucleo-n657x0-q.html b_u585i_iot2a STM32 B-U585i IOT2A Discovery kit stm32u5 https://www.st.com/en/evaluation-tools/b-u585i-iot02a.html +stm32u083cdk STM32 U083C Discovery Kit stm32u0 https://www.st.com/en/evaluation-tools/stm32u083c-dk.html stm32u545nucleo STM32 U545 Nucleo stm32u5 https://www.st.com/en/evaluation-tools/nucleo-u545re-q.html stm32u575eval STM32 U575 Eval stm32u5 https://www.st.com/en/evaluation-tools/stm32u575i-ev.html stm32u575nucleo STM32 U575 Nucleo stm32u5 https://www.st.com/en/evaluation-tools/nucleo-u575zi-q.html -- cgit v1.3.1 From 6d32256188d578079b0d050509f2c7d7178897a0 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 1 Oct 2025 20:56:20 +0700 Subject: HIL add timeout for opening mtp device --- .github/workflows/build.yml | 3 +++ docs/reference/getting_started.rst | 2 +- examples/device/mtp/src/usb_descriptors.c | 2 +- test/hil/hil_test.py | 24 +++++++++++++++--------- 4 files changed, 20 insertions(+), 11 deletions(-) (limited to 'docs') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0daefab9..676e2d428 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -199,15 +199,18 @@ jobs: runs-on: [self-hosted, X64, hathach, hardware-in-the-loop] steps: - name: Clean workspace + if: github.run_attempt == '1' run: | echo "Cleaning up for the first run" rm -rf "${{ github.workspace }}" mkdir -p "${{ github.workspace }}" - name: Checkout TinyUSB + if: github.run_attempt == '1' uses: actions/checkout@v4 - name: Download Artifacts + if: github.run_attempt == '1' uses: actions/download-artifact@v4 with: path: cmake-build diff --git a/docs/reference/getting_started.rst b/docs/reference/getting_started.rst index bb9ff1cb4..f1a755804 100644 --- a/docs/reference/getting_started.rst +++ b/docs/reference/getting_started.rst @@ -178,7 +178,7 @@ By default log message is printed via on-board UART which is slow and take lots * Pros: work with most if not all MCUs * Software viewer is JLink RTT Viewer/Client/Logger which is bundled with JLink driver package. -* ``LOGGER=swo``\ : Use dedicated SWO pin of ARM Cortex SWD debug header. +* ``LOGGER=swo`` : Use dedicated SWO pin of ARM Cortex SWD debug header. * Cons: only work with ARM Cortex MCUs minus M0 * Pros: should be compatible with more debugger that support SWO. diff --git a/examples/device/mtp/src/usb_descriptors.c b/examples/device/mtp/src/usb_descriptors.c index 810137c46..ddda4d686 100644 --- a/examples/device/mtp/src/usb_descriptors.c +++ b/examples/device/mtp/src/usb_descriptors.c @@ -143,7 +143,7 @@ char const *string_desc_arr[] = "TinyUsb", // 1: Manufacturer "TinyUsb Device", // 2: Product NULL, // 3: Serials will use unique ID if possible - "TinyUSBB MTP", // 4: MTP Interface + "TinyUSB MTP", // 4: MTP Interface }; static uint16_t _desc_str[32 + 1]; diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index 1a846dd4a..c747ad763 100755 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -42,8 +42,6 @@ import hashlib import ctypes from pymtp import MTP -mtp = MTP() - ENUM_TIMEOUT = 30 STATUS_OK = "\033[32mOK\033[0m" @@ -140,6 +138,19 @@ def read_disk_file(uid, lun, fname): return None +def open_mtp_dev(uid): + mtp = MTP() + timeout = ENUM_TIMEOUT + while timeout > 0: + for raw in mtp.detect_devices(): + mtp.device = mtp.mtp.LIBMTP_Open_Raw_Device(ctypes.byref(raw)) + if mtp.device and mtp.get_serialnumber().decode('utf-8') == uid: + return mtp + time.sleep(1) + timeout -= 1 + return None + + # ------------------------------------------------------------- # Flashing firmware # ------------------------------------------------------------- @@ -505,19 +516,14 @@ def test_device_mtp(board): _null = os.open(os.devnull, os.O_WRONLY) os.dup2(_null, fd) - for raw in mtp.detect_devices(): - mtp.device = mtp.mtp.LIBMTP_Open_Raw_Device(ctypes.byref(raw)) - if mtp.device and mtp.get_serialnumber().decode('utf-8') == uid: - break - else: - mtp.device = None + mtp = open_mtp_dev(uid) # --- AFTER: restore stderr --- os.dup2(_saved, fd) os.close(_null) os.close(_saved) - if mtp.device is None: + if mtp is None or mtp.device is None: assert False, 'MTP device not found' assert b"TinyUSB" == mtp.get_manufacturer(), 'MTP wrong manufacturer' -- cgit v1.3.1