summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-08-11 10:19:52 +0700
committerGitHub <[email protected]>2024-08-11 10:19:52 +0700
commit9ee7d1b77e365079eab5bb641eea522a8deb551e (patch)
treed960b83d4fb6164430be3f6068f8f1829ebb8fcd
parent18b5affce9afb26141c58f59ed89ad34385a0f8f (diff)
parent8b88749223e969148e9d1ce4c8fd3a6756d5e38c (diff)
Merge pull request #2760 from hathach/update-pio-usb
change pio to fix rp2040 build
-rw-r--r--.github/workflows/build_util.yml13
-rw-r--r--hw/bsp/rp2040/board.h7
-rw-r--r--hw/bsp/rp2040/family.c8
-rw-r--r--test/hil/rpi.json8
-rw-r--r--tools/get_deps.py4
5 files changed, 26 insertions, 14 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/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
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
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",
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',