From 5666aa196f99e323e025179559ef8ac1db390749 Mon Sep 17 00:00:00 2001 From: HiFiPhile Date: Mon, 12 Aug 2024 15:38:22 +0200 Subject: [PATCH 01/12] Fix tusb_dir_t warning. --- src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c index 1e0e9c4477..ed9036d190 100644 --- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c +++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c @@ -155,7 +155,7 @@ static uint8_t remoteWakeCountdown; // When wake is requested // into the stack. static void handle_bus_reset(uint8_t rhport); static void dcd_transmit_packet(xfer_ctl_t *xfer, uint16_t ep_ix); -static bool edpt_xfer(uint8_t rhport, uint8_t ep_num, uint8_t dir); +static bool edpt_xfer(uint8_t rhport, uint8_t ep_num, tusb_dir_t dir); // PMA allocation/access static uint16_t ep_buf_ptr; ///< Points to first free memory location @@ -578,7 +578,7 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const *desc_ep) { (void)rhport; uint8_t const ep_addr = desc_ep->bEndpointAddress; uint8_t const ep_num = tu_edpt_number(ep_addr); - uint8_t const dir = tu_edpt_dir(ep_addr); + tusb_dir_t const dir = tu_edpt_dir(ep_addr); const uint16_t packet_size = tu_edpt_packet_size(desc_ep); uint8_t const ep_idx = dcd_ep_alloc(ep_addr, desc_ep->bmAttributes.xfer); TU_ASSERT(ep_idx < FSDEV_EP_COUNT); @@ -671,7 +671,7 @@ bool dcd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const *desc_ep) (void)rhport; uint8_t const ep_addr = desc_ep->bEndpointAddress; uint8_t const ep_num = tu_edpt_number(ep_addr); - uint8_t const dir = tu_edpt_dir(ep_addr); + tusb_dir_t const dir = tu_edpt_dir(ep_addr); xfer_ctl_t* xfer = xfer_ctl_ptr(ep_num, dir); uint8_t const ep_idx = xfer->ep_idx; @@ -683,7 +683,7 @@ bool dcd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const *desc_ep) ep_change_status(&ep_reg, TUSB_DIR_IN, EP_STAT_DISABLED); ep_change_status(&ep_reg, TUSB_DIR_OUT, EP_STAT_DISABLED); ep_change_dtog(&ep_reg, dir, 0); - ep_change_dtog(&ep_reg, 1 - dir, 1); + ep_change_dtog(&ep_reg, (tusb_dir_t)(1 - dir), 1); ep_write(ep_idx, ep_reg, true); @@ -722,7 +722,7 @@ static void dcd_transmit_packet(xfer_ctl_t *xfer, uint16_t ep_ix) { ep_write(ep_ix, ep_reg, true); } -static bool edpt_xfer(uint8_t rhport, uint8_t ep_num, uint8_t dir) { +static bool edpt_xfer(uint8_t rhport, uint8_t ep_num, tusb_dir_t dir) { (void) rhport; xfer_ctl_t *xfer = xfer_ctl_ptr(ep_num, dir); @@ -752,7 +752,7 @@ static bool edpt_xfer(uint8_t rhport, uint8_t ep_num, uint8_t dir) { bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t total_bytes) { uint8_t const ep_num = tu_edpt_number(ep_addr); - uint8_t const dir = tu_edpt_dir(ep_addr); + tusb_dir_t const dir = tu_edpt_dir(ep_addr); xfer_ctl_t *xfer = xfer_ctl_ptr(ep_num, dir); xfer->buffer = buffer; @@ -765,7 +765,7 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t to bool dcd_edpt_xfer_fifo(uint8_t rhport, uint8_t ep_addr, tu_fifo_t *ff, uint16_t total_bytes) { uint8_t const ep_num = tu_edpt_number(ep_addr); - uint8_t const dir = tu_edpt_dir(ep_addr); + tusb_dir_t const dir = tu_edpt_dir(ep_addr); xfer_ctl_t *xfer = xfer_ctl_ptr(ep_num, dir); xfer->buffer = NULL; @@ -779,7 +779,7 @@ bool dcd_edpt_xfer_fifo(uint8_t rhport, uint8_t ep_addr, tu_fifo_t *ff, uint16_t void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr) { (void)rhport; uint8_t const ep_num = tu_edpt_number(ep_addr); - uint8_t const dir = tu_edpt_dir(ep_addr); + tusb_dir_t const dir = tu_edpt_dir(ep_addr); xfer_ctl_t *xfer = xfer_ctl_ptr(ep_num, dir); uint8_t const ep_idx = xfer->ep_idx; @@ -794,7 +794,7 @@ void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr) { (void)rhport; uint8_t const ep_num = tu_edpt_number(ep_addr); - uint8_t const dir = tu_edpt_dir(ep_addr); + tusb_dir_t const dir = tu_edpt_dir(ep_addr); xfer_ctl_t *xfer = xfer_ctl_ptr(ep_num, dir); uint8_t const ep_idx = xfer->ep_idx; From 549f20d1793d1896a376a1ea978a4f02217de4ed Mon Sep 17 00:00:00 2001 From: HiFiPhile Date: Mon, 12 Aug 2024 15:39:02 +0200 Subject: [PATCH 02/12] Fix buf_id read for ISO transfer. --- src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c index ed9036d190..0cdc3eef92 100644 --- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c +++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c @@ -275,7 +275,6 @@ static void handle_bus_reset(uint8_t rhport) { // Handle CTR interrupt for the TX/IN direction static void handle_ctr_tx(uint32_t ep_id) { uint32_t ep_reg = ep_read(ep_id) | USB_EP_CTR_TX | USB_EP_CTR_RX; - ep_reg &= USB_EPREG_MASK; uint8_t const ep_num = ep_reg & USB_EPADDR_FIELD; xfer_ctl_t *xfer = xfer_ctl_ptr(ep_num, TUSB_DIR_IN); @@ -694,7 +693,6 @@ bool dcd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const *desc_ep) static void dcd_transmit_packet(xfer_ctl_t *xfer, uint16_t ep_ix) { uint16_t len = tu_min16(xfer->total_len - xfer->queued_len, xfer->max_packet_size); uint32_t ep_reg = ep_read(ep_ix) | USB_EP_CTR_TX | USB_EP_CTR_RX; // reserve CTR - ep_reg &= USB_EPREG_MASK | EP_STAT_MASK(TUSB_DIR_IN); // only change TX Status, reserve other toggle bits bool const is_iso = ep_is_iso(ep_reg); @@ -719,6 +717,7 @@ static void dcd_transmit_packet(xfer_ctl_t *xfer, uint16_t ep_ix) { if (is_iso) { xfer->iso_in_sending = true; } + ep_reg &= USB_EPREG_MASK | EP_STAT_MASK(TUSB_DIR_IN); // only change TX Status, reserve other toggle bits ep_write(ep_ix, ep_reg, true); } From f565267dafe63a8f92e53ba5e511f07ea34eaaa4 Mon Sep 17 00:00:00 2001 From: HiFiPhile Date: Mon, 12 Aug 2024 18:32:51 +0200 Subject: [PATCH 03/12] Fix stm32l0 clock init. --- hw/bsp/stm32l0/boards/stm32l052dap52/board.h | 9 +++++---- hw/bsp/stm32l0/boards/stm32l0538disco/board.h | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/bsp/stm32l0/boards/stm32l052dap52/board.h b/hw/bsp/stm32l0/boards/stm32l052dap52/board.h index c8963199b5..ee83bbcbcd 100644 --- a/hw/bsp/stm32l0/boards/stm32l052dap52/board.h +++ b/hw/bsp/stm32l0/boards/stm32l052dap52/board.h @@ -54,16 +54,17 @@ //--------------------------------------------------------------------+ static inline void board_stm32l0_clock_init(void) { - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; - static RCC_CRSInitTypeDef RCC_CRSInitStruct; + RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; + RCC_CRSInitTypeDef RCC_CRSInitStruct = {0}; /* Enable HSI Oscillator to be used as System clock source Enable HSI48 Oscillator to be used as USB clock source */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI48; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; + RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; HAL_RCC_OscConfig(&RCC_OscInitStruct); /* Select HSI48 as USB clock source */ diff --git a/hw/bsp/stm32l0/boards/stm32l0538disco/board.h b/hw/bsp/stm32l0/boards/stm32l0538disco/board.h index 0722e31024..5cda1c15a6 100644 --- a/hw/bsp/stm32l0/boards/stm32l0538disco/board.h +++ b/hw/bsp/stm32l0/boards/stm32l0538disco/board.h @@ -54,16 +54,17 @@ //--------------------------------------------------------------------+ static inline void board_stm32l0_clock_init(void) { - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; - static RCC_CRSInitTypeDef RCC_CRSInitStruct; + RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; + RCC_CRSInitTypeDef RCC_CRSInitStruct = {0}; /* Enable HSI Oscillator to be used as System clock source Enable HSI48 Oscillator to be used as USB clock source */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSI48; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; + RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; HAL_RCC_OscConfig(&RCC_OscInitStruct); /* Select HSI48 as USB clock source */ From 96c5c72e971674ba3a4023aed02bf31cc8c994dc Mon Sep 17 00:00:00 2001 From: HiFiPhile Date: Mon, 12 Aug 2024 18:38:23 +0200 Subject: [PATCH 04/12] Fix double buffer not disabled for smaller devices. --- src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c index 0cdc3eef92..6eea1ab32b 100644 --- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c +++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c @@ -650,10 +650,11 @@ bool dcd_edpt_iso_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t largest_packet /* Create a packet memory buffer area. Enable double buffering for devices with 2048 bytes PMA, for smaller devices double buffering occupy too much space. */ - uint32_t pma_addr = dcd_pma_alloc(largest_packet_size, true); #if FSDEV_PMA_SIZE > 1024u + uint32_t pma_addr = dcd_pma_alloc(largest_packet_size, true); uint16_t pma_addr2 = pma_addr >> 16; #else + uint32_t pma_addr = dcd_pma_alloc(largest_packet_size, false); uint16_t pma_addr2 = pma_addr; #endif From ad411b6c252265676d9a61f77fd8a5c26465b392 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 13 Aug 2024 10:55:17 +0700 Subject: [PATCH 05/12] minor update to cmake profile --- .idea/cmake.xml | 114 +++++++++--------- .../boards/stm32f103ze_iar/board.cmake | 1 + .../boards/stm32l0538disco/board.cmake | 1 + 3 files changed, 59 insertions(+), 57 deletions(-) diff --git a/.idea/cmake.xml b/.idea/cmake.xml index bf5696725a..729309ebb1 100644 --- a/.idea/cmake.xml +++ b/.idea/cmake.xml @@ -4,140 +4,140 @@ - - - - + + + + - + - + - + - + - + - + - + - - - + + + - + - - - - - - - - - - - + + + + + + + + + + + - - - - - + + + + + - + - + - - + + - + - - + + - - + + - - - - - + + + + + - + - - - + + + - - - - - + + + + + - + - + - + diff --git a/hw/bsp/stm32f1/boards/stm32f103ze_iar/board.cmake b/hw/bsp/stm32f1/boards/stm32f103ze_iar/board.cmake index c797d7090a..7672ff3381 100644 --- a/hw/bsp/stm32f1/boards/stm32f103ze_iar/board.cmake +++ b/hw/bsp/stm32f1/boards/stm32f103ze_iar/board.cmake @@ -1,5 +1,6 @@ set(MCU_VARIANT stm32f103xe) set(JLINK_DEVICE stm32f103ze) +#set(JLINK_OPTION "-USB 320000338") string(TOUPPER ${MCU_VARIANT} MCU_VARIANT_UPPER) diff --git a/hw/bsp/stm32l0/boards/stm32l0538disco/board.cmake b/hw/bsp/stm32l0/boards/stm32l0538disco/board.cmake index 8d7b537d54..895bbb3abc 100644 --- a/hw/bsp/stm32l0/boards/stm32l0538disco/board.cmake +++ b/hw/bsp/stm32l0/boards/stm32l0538disco/board.cmake @@ -1,5 +1,6 @@ set(MCU_VARIANT stm32l053xx) set(JLINK_DEVICE stm32l053r8) +#set(JLINK_OPTION "-USB 778921770") set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32L053C8Tx_FLASH.ld) From 45f50ebaa8dd4d2542d2db8fe51783803c8698be Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 13 Aug 2024 11:04:53 +0700 Subject: [PATCH 06/12] increase enum timeout --- test/hil/hil_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index 01ca93c7a1..597d6c5cae 100644 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -36,7 +36,7 @@ import platform from multiprocessing import Pool -ENUM_TIMEOUT = 20 +ENUM_TIMEOUT = 30 # get usb serial by id From 61725a5263b6820051d515fcb716e4a91c13cdac Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 13 Aug 2024 13:16:46 +0700 Subject: [PATCH 07/12] fix concurrent mass storage test conflict, use pyfatfs to access disk dev by usb id instead of mounted in /media/ --- test/hil/hil_test.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index 597d6c5cae..9a7fe83216 100644 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -33,8 +33,8 @@ import subprocess import json import glob -import platform from multiprocessing import Pool +import fs ENUM_TIMEOUT = 30 @@ -53,9 +53,8 @@ def get_serial_dev(id, vendor_str, product_str, ifnum): return port_list[0] -# Currently not used, left as reference +# get usb disk by id def get_disk_dev(id, vendor_str, lun): - # get usb disk by id return f'/dev/disk/by-id/usb-{vendor_str}_Mass_Storage_{id}-0:{lun}' @@ -72,34 +71,34 @@ def open_serial_dev(port): # slight delay since kernel may occupy the port briefly time.sleep(0.5) timeout = timeout - 0.5 - ser = serial.Serial(port, timeout=1) + ser = serial.Serial(port, timeout=2) break except serial.SerialException: pass time.sleep(0.5) timeout = timeout - 0.5 - assert timeout, 'Device not available or Cannot open port' + + assert timeout, f'Cannot open port f{port}' if os.path.exists(port) else f'Port {port} not existed' return ser -def read_disk_file(id, fname): - # on different self-hosted, the mount point is different - file_list = [ - f'/media/blkUSB_{id[-8:]}.02/{fname}', - f'/media/{os.getenv("USER")}/TinyUSB MSC/{fname}' - ] +def read_disk_file(uid, lun, fname): + # open_fs("fat://{dev}) require 'pip install pyfatfs' + dev = get_disk_dev(uid, 'TinyUSB', lun) timeout = ENUM_TIMEOUT while timeout: - for file in file_list: - if os.path.isfile(file): - with open(file, 'rb') as f: - data = f.read() - return data - + if os.path.exists(dev): + fat = fs.open_fs(f'fat://{dev}') + try: + assert fat.exists(fname), f'File {fname} not found in {dev}' + with fat.open(fname, 'rb') as f: + return f.read() + finally: + fat.close() time.sleep(1) timeout = timeout - 1 - assert timeout, 'Device not available' + assert timeout, f'Storage {dev} not existed' return None @@ -238,7 +237,7 @@ def test_cdc_msc(board): assert ser.read(100) == str, 'CDC wrong data' # Block test - data = read_disk_file(uid, 'README.TXT') + data = read_disk_file(uid,0,'README.TXT') readme = \ b"This is tinyusb's MassStorage Class demo.\r\n\r\n\ If you find any bugs or get any questions, feel free to file an\r\n\ @@ -397,6 +396,7 @@ def test_board(board): return err_count + def main(): """ Hardware test on specified boards From f23170786abe8bde0a00065987674f6ff66104c5 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 13 Aug 2024 13:50:19 +0700 Subject: [PATCH 08/12] increase pyserial timeout --- test/hil/hil_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index 9a7fe83216..ff8034b95e 100644 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -71,7 +71,7 @@ def open_serial_dev(port): # slight delay since kernel may occupy the port briefly time.sleep(0.5) timeout = timeout - 0.5 - ser = serial.Serial(port, timeout=2) + ser = serial.Serial(port, timeout=5) break except serial.SerialException: pass From 525406597627fb9307425539b86dddf10278eca8 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 13 Aug 2024 13:51:28 +0700 Subject: [PATCH 09/12] change pio-usb back to upstreaam --- tools/get_deps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/get_deps.py b/tools/get_deps.py index c7cf6ca63b..b639ed6d68 100644 --- a/tools/get_deps.py +++ b/tools/get_deps.py @@ -54,8 +54,8 @@ 'hw/mcu/nxp/mcux-sdk': ['https://github.com/hathach/mcux-sdk.git', '144f1eb7ea8c06512e12f12b27383601c0272410', 'kinetis_k kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx imxrt'], - 'hw/mcu/raspberry_pi/Pico-PIO-USB': ['https://github.com/adafruit/Pico-PIO-USB.git', - '770e3b2e4af14dd202f062f850f9f14820ecbb1e', + 'hw/mcu/raspberry_pi/Pico-PIO-USB': ['https://github.com/sekigon-gonnoc/Pico-PIO-USB.git', + '7902e9fa8ed4a271d8d1d5e7e50516c2292b7bc2', 'rp2040'], 'hw/mcu/renesas/fsp': ['https://github.com/renesas/fsp.git', 'd52e5a6a59b7c638da860c2bb309b6e78e752ff8', From 5f8599f6d44c1b1741f3e0edf0d342720c0c17d8 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 13 Aug 2024 14:35:42 +0700 Subject: [PATCH 10/12] metro m7 has issue with cdc_msc example randomly on hil test. Exclude it for now --- test/hil/hil_test.py | 11 ++++++----- test/hil/rpi.json | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index ff8034b95e..c6feb7de25 100644 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -88,15 +88,16 @@ def read_disk_file(uid, lun, fname): timeout = ENUM_TIMEOUT while timeout: if os.path.exists(dev): - fat = fs.open_fs(f'fat://{dev}') + fat = fs.open_fs(f'fat://{dev}?read_only=true') try: - assert fat.exists(fname), f'File {fname} not found in {dev}' with fat.open(fname, 'rb') as f: - return f.read() + data = f.read() finally: fat.close() + assert data, f'Cannot read file {fname} from {dev}' + return data time.sleep(1) - timeout = timeout - 1 + timeout -= 1 assert timeout, f'Storage {dev} not existed' return None @@ -322,7 +323,7 @@ def test_hid_boot_interface(board): time.sleep(1) timeout = timeout - 1 - assert timeout, 'Device not available' + assert timeout, 'HID device not available' def test_hid_composite_freertos(id): diff --git a/test/hil/rpi.json b/test/hil/rpi.json index fd00913f37..a4f6073eb0 100644 --- a/test/hil/rpi.json +++ b/test/hil/rpi.json @@ -17,6 +17,8 @@ { "name": "metro_m7_1011", "uid": "9CE8715DD71137363E00005002004200", + "tests_skip": ["cdc_msc", "cdc_msc_freertos"], + "comment": "Somehow has issue with cdc_msc example randomly", "flasher": "jlink", "flasher_sn": "000611000000", "flasher_args": "-device MIMXRT1011xxx5A" From 0f732a2f8b83ba5a6eebacf4ded73a682214591e Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 13 Aug 2024 14:50:54 +0700 Subject: [PATCH 11/12] remove metro m7 for now --- test/hil/hil_test.py | 2 +- test/hil/rpi.json | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index c6feb7de25..c2ed4d94e2 100644 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -387,7 +387,7 @@ def test_board(board): try: ret = globals()[f'test_{test}'](board) print('OK') - except AssertionError as e: + except Exception as e: err_count += 1 print('Failed') print(f' {e}') diff --git a/test/hil/rpi.json b/test/hil/rpi.json index a4f6073eb0..5f218d0732 100644 --- a/test/hil/rpi.json +++ b/test/hil/rpi.json @@ -14,15 +14,6 @@ "flasher_sn": "E6614C311B597D32", "flasher_args": "-f interface/cmsis-dap.cfg -f target/atsame5x.cfg -c \"adapter speed 5000\"" }, - { - "name": "metro_m7_1011", - "uid": "9CE8715DD71137363E00005002004200", - "tests_skip": ["cdc_msc", "cdc_msc_freertos"], - "comment": "Somehow has issue with cdc_msc example randomly", - "flasher": "jlink", - "flasher_sn": "000611000000", - "flasher_args": "-device MIMXRT1011xxx5A" - }, { "name": "lpcxpresso11u37", "uid": "17121919", @@ -69,6 +60,14 @@ } ], "boards-skip": [ + { + "name": "metro_m7_1011", + "uid": "9CE8715DD71137363E00005002004200", + "flasher": "jlink", + "flasher_sn": "000611000000", + "flasher_args": "-device MIMXRT1011xxx5A", + "comment": "sometime it is not enumerated/not reset, maybe need an bsp explicit disconnect/reconnect" + }, { "name": "espressif_s3_devkitm", "uid": "84F703C084E4", From 86419df42c3220a867a3ffbc22140e11b7ad57ee Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 13 Aug 2024 16:01:51 +0700 Subject: [PATCH 12/12] use zero wait flash for nano v203 --- hw/bsp/ch32v20x/boards/nanoch32v203/board.cmake | 4 ++-- test/hil/hil_test.py | 2 +- test/hil/rpi.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/bsp/ch32v20x/boards/nanoch32v203/board.cmake b/hw/bsp/ch32v20x/boards/nanoch32v203/board.cmake index a0bf12b5ca..6c7712cdd5 100644 --- a/hw/bsp/ch32v20x/boards/nanoch32v203/board.cmake +++ b/hw/bsp/ch32v20x/boards/nanoch32v203/board.cmake @@ -1,8 +1,8 @@ set(MCU_VARIANT D6) # 64KB zero-wait, 224KB total flash -#set(LD_FLASH_SIZE 64K) -set(LD_FLASH_SIZE 224K) +set(LD_FLASH_SIZE 64K) +#set(LD_FLASH_SIZE 224K) set(LD_RAM_SIZE 20K) function(update_board TARGET) diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index c2ed4d94e2..486f0d2ebf 100644 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -338,8 +338,8 @@ def test_hid_composite_freertos(id): all_tests = [ 'cdc_dual_ports', 'cdc_msc', - 'cdc_msc_freertos', 'dfu', + 'cdc_msc_freertos', # dont test 2 cdc_msc next to each other, since they have same vid/pid. Can be confused by host 'dfu_runtime', 'hid_boot_interface', 'board_test' diff --git a/test/hil/rpi.json b/test/hil/rpi.json index 5f218d0732..688ea38220 100644 --- a/test/hil/rpi.json +++ b/test/hil/rpi.json @@ -66,7 +66,7 @@ "flasher": "jlink", "flasher_sn": "000611000000", "flasher_args": "-device MIMXRT1011xxx5A", - "comment": "sometime it is not enumerated/not reset, maybe need an bsp explicit disconnect/reconnect" + "comment": "not running reliably in bulk with other boards, probably power, flashing etc .." }, { "name": "espressif_s3_devkitm",