Skip to content

Commit 9ee7d1b

Browse files
authored
Merge pull request #2760 from hathach/update-pio-usb
change pio to fix rp2040 build
2 parents 18b5aff + 8b88749 commit 9ee7d1b

File tree

5 files changed

+26
-14
lines changed

5 files changed

+26
-14
lines changed

.github/workflows/build_util.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,10 @@ jobs:
5858
shell: bash
5959

6060
- name: Build
61-
if: inputs.toolchain != 'esp-idf'
6261
run: |
63-
python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }}
64-
65-
- name: Build using ESP-IDF docker
66-
if: inputs.toolchain == 'esp-idf'
67-
run: |
68-
docker run --rm -v $PWD:/project -w /project espressif/idf:${{ inputs.toolchain_version }} python3 tools/build.py ${{ matrix.arg }}
62+
if [ "${{ inputs.toolchain }}" == "esp-idf" ]; then
63+
docker run --rm -v $PWD:/project -w /project espressif/idf:${{ inputs.toolchain_version }} python3 tools/build.py ${{ matrix.arg }}
64+
else
65+
python tools/build.py -s ${{ inputs.build-system }} ${{ steps.setup-toolchain.outputs.build_option }} ${{ steps.set-one-per-family.outputs.build_option }} ${{ matrix.arg }}
66+
fi
67+
shell: bash

hw/bsp/rp2040/board.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@
7878
// USB Host MAX3421E
7979
//--------------------------------------------------------------------
8080

81-
#define MAX3421_SPI PICO_DEFAULT_SPI_INSTANCE
81+
#ifdef PICO_DEFAULT_SPI
82+
#define MAX3421_SPI PICO_DEFAULT_SPI // sdk v2
83+
#else
84+
#define MAX3421_SPI PICO_DEFAULT_SPI_INSTANCE // sdk v1
85+
#endif
86+
8287
#define MAX3421_SCK_PIN PICO_DEFAULT_SPI_SCK_PIN
8388
#define MAX3421_MOSI_PIN PICO_DEFAULT_SPI_TX_PIN
8489
#define MAX3421_MISO_PIN PICO_DEFAULT_SPI_RX_PIN

hw/bsp/rp2040/family.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,15 @@ static void max3421_init(void) {
275275
gpio_set_function(MAX3421_SCK_PIN, GPIO_FUNC_SPI);
276276
gpio_set_function(MAX3421_MOSI_PIN, GPIO_FUNC_SPI);
277277
gpio_set_function(MAX3421_MISO_PIN, GPIO_FUNC_SPI);
278+
279+
#ifdef __GNUC__
280+
#pragma GCC diagnostic push
281+
#pragma GCC diagnostic ignored "-Wnull-dereference"
282+
#endif
278283
spi_set_format(MAX3421_SPI, 8, SPI_CPOL_0, SPI_CPHA_0, SPI_MSB_FIRST);
284+
#ifdef __GNUC__
285+
#pragma GCC diagnostic pop
286+
#endif
279287
}
280288

281289
//// API to enable/disable MAX3421 INTR pin interrupt

test/hil/rpi.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@
5757
"flasher": "openocd",
5858
"flasher_sn": "066FFF495087534867063844",
5959
"flasher_args": "-f interface/stlink.cfg -f target/stm32g0x.cfg"
60-
},
60+
}
61+
],
62+
"boards-skip": [
6163
{
6264
"name": "nanoch32v203",
6365
"uid": "CDAB277B0FBC03E339E339E3",
6466
"flasher": "openocd_wch",
6567
"flasher_sn": "EBCA8F0670AF",
6668
"flasher_args": ""
67-
}
68-
],
69-
"boards-skip": [
69+
},
7070
{
7171
"name": "espressif_s3_devkitm",
7272
"uid": "84F703C084E4",

tools/get_deps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
'hw/mcu/nxp/mcux-sdk': ['https://github.com/hathach/mcux-sdk.git',
5555
'144f1eb7ea8c06512e12f12b27383601c0272410',
5656
'kinetis_k kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx imxrt'],
57-
'hw/mcu/raspberry_pi/Pico-PIO-USB': ['https://github.com/sekigon-gonnoc/Pico-PIO-USB.git',
58-
'0f747aaa0c16f750bdfa2ba37ec25d6c8e1bc117',
57+
'hw/mcu/raspberry_pi/Pico-PIO-USB': ['https://github.com/adafruit/Pico-PIO-USB.git',
58+
'770e3b2e4af14dd202f062f850f9f14820ecbb1e',
5959
'rp2040'],
6060
'hw/mcu/renesas/fsp': ['https://github.com/renesas/fsp.git',
6161
'd52e5a6a59b7c638da860c2bb309b6e78e752ff8',

0 commit comments

Comments
 (0)