From e8f42df97a4421d90a4565f22308c5adb9560cf5 Mon Sep 17 00:00:00 2001 From: hathach Date: Sat, 10 Aug 2024 09:47:34 +0700 Subject: [PATCH 1/4] change pio to fix rp2040 build --- 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 7fbde0e02..c7cf6ca63 100644 --- a/tools/get_deps.py +++ b/tools/get_deps.py @@ -54,8 +54,8 @@ deps_optional = { '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/sekigon-gonnoc/Pico-PIO-USB.git', - '0f747aaa0c16f750bdfa2ba37ec25d6c8e1bc117', + 'hw/mcu/raspberry_pi/Pico-PIO-USB': ['https://github.com/adafruit/Pico-PIO-USB.git', + '770e3b2e4af14dd202f062f850f9f14820ecbb1e', 'rp2040'], 'hw/mcu/renesas/fsp': ['https://github.com/renesas/fsp.git', 'd52e5a6a59b7c638da860c2bb309b6e78e752ff8', From c07928e1b3bb680cb55de3a55eae9ba3cb459694 Mon Sep 17 00:00:00 2001 From: hathach Date: Sat, 10 Aug 2024 22:07:10 +0700 Subject: [PATCH 2/4] fix build with rp2040 PICO_DEFAULT_SPI rename --- hw/bsp/rp2040/board.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/bsp/rp2040/board.h b/hw/bsp/rp2040/board.h index 3849894ce..733e93797 100644 --- a/hw/bsp/rp2040/board.h +++ b/hw/bsp/rp2040/board.h @@ -78,7 +78,12 @@ // USB Host MAX3421E //-------------------------------------------------------------------- -#define MAX3421_SPI PICO_DEFAULT_SPI_INSTANCE +#ifdef PICO_DEFAULT_SPI +#define MAX3421_SPI PICO_DEFAULT_SPI // sdk v2 +#else +#define MAX3421_SPI PICO_DEFAULT_SPI_INSTANCE // sdk v1 +#endif + #define MAX3421_SCK_PIN PICO_DEFAULT_SPI_SCK_PIN #define MAX3421_MOSI_PIN PICO_DEFAULT_SPI_TX_PIN #define MAX3421_MISO_PIN PICO_DEFAULT_SPI_RX_PIN From 2871bb0da6c928f6593f7eaa7cd4e1c4c287db43 Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 11 Aug 2024 00:51:51 +0700 Subject: [PATCH 3/4] fix spi_set_format() -Wnull-dereference when compiling with -Os --- .github/workflows/build_util.yml | 13 ++++++------- hw/bsp/rp2040/family.c | 8 ++++++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_util.yml b/.github/workflows/build_util.yml index b0a87d4df..e983f06d1 100644 --- a/.github/workflows/build_util.yml +++ b/.github/workflows/build_util.yml @@ -58,11 +58,10 @@ jobs: shell: bash - name: Build - if: inputs.toolchain != 'esp-idf' run: | - python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }} - - - name: Build using ESP-IDF docker - if: inputs.toolchain == 'esp-idf' - run: | - docker run --rm -v $PWD:/project -w /project espressif/idf:${{ inputs.toolchain_version }} python3 tools/build.py ${{ matrix.arg }} + if [ "${{ inputs.toolchain }}" == "esp-idf" ]; then + docker run --rm -v $PWD:/project -w /project espressif/idf:${{ inputs.toolchain_version }} python3 tools/build.py ${{ matrix.arg }} + else + python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }} + fi + shell: bash diff --git a/hw/bsp/rp2040/family.c b/hw/bsp/rp2040/family.c index 9360f7f57..250989ce9 100644 --- a/hw/bsp/rp2040/family.c +++ b/hw/bsp/rp2040/family.c @@ -275,7 +275,15 @@ static void max3421_init(void) { gpio_set_function(MAX3421_SCK_PIN, GPIO_FUNC_SPI); gpio_set_function(MAX3421_MOSI_PIN, GPIO_FUNC_SPI); gpio_set_function(MAX3421_MISO_PIN, GPIO_FUNC_SPI); + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnull-dereference" +#endif spi_set_format(MAX3421_SPI, 8, SPI_CPOL_0, SPI_CPHA_0, SPI_MSB_FIRST); +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif } //// API to enable/disable MAX3421 INTR pin interrupt From 8b88749223e969148e9d1ce4c8fd3a6756d5e38c Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 11 Aug 2024 09:51:14 +0700 Subject: [PATCH 4/4] skip ch32v203 for hil test --- test/hil/rpi.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/hil/rpi.json b/test/hil/rpi.json index fd00913f3..396b21553 100644 --- a/test/hil/rpi.json +++ b/test/hil/rpi.json @@ -57,16 +57,16 @@ "flasher": "openocd", "flasher_sn": "066FFF495087534867063844", "flasher_args": "-f interface/stlink.cfg -f target/stm32g0x.cfg" - }, + } + ], + "boards-skip": [ { "name": "nanoch32v203", "uid": "CDAB277B0FBC03E339E339E3", "flasher": "openocd_wch", "flasher_sn": "EBCA8F0670AF", "flasher_args": "" - } - ], - "boards-skip": [ + }, { "name": "espressif_s3_devkitm", "uid": "84F703C084E4",