Skip to content

Commit b6ad70b

Browse files
authored
Merge pull request #2371 from hathach/hil-add-nrf52840
add nrf52840 to hard in the loop pool
2 parents 24c5e6a + f986f1f commit b6ad70b

File tree

4 files changed

+52
-3
lines changed

4 files changed

+52
-3
lines changed

.github/workflows/build_esp.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,11 @@ jobs:
9595
- name: Test on actual hardware
9696
run: |
9797
python3 test/hil/hil_test.py --board ${{ matrix.board }} hil_pi4.json
98+
99+
- name: Reset USB bus
100+
run: |
101+
for port in $(lspci | grep USB | cut -d' ' -f1); do
102+
echo -n "0000:${port}"| sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind;
103+
sleep 1;
104+
echo -n "0000:${port}" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind;
105+
done

.github/workflows/cmake_arm.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,23 @@ jobs:
8686
# for rp2040, there is no harm if defined for other families
8787
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
8888

89-
- name: Upload Artifacts for Hardware Testing
90-
if: contains(matrix.family,'rp2040') && github.repository_owner == 'hathach'
89+
- name: Upload Artifacts for Hardware Testing (rp2040)
90+
if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
9191
uses: actions/upload-artifact@v3
9292
with:
9393
name: raspberry_pi_pico
9494
path: |
9595
cmake-build/cmake-build-raspberry_pi_pico/*/*/*.elf
9696
97+
- name: Upload Artifacts for Hardware Testing (nRF)
98+
if: matrix.family == 'nrf' && github.repository_owner == 'hathach'
99+
uses: actions/upload-artifact@v3
100+
with:
101+
name: feather_nrf52840_express
102+
path: |
103+
cmake-build/cmake-build-feather_nrf52840_express/*/*/*.elf
104+
105+
97106
# ---------------------------------------
98107
# Hardware in the loop (HIL)
99108
# Current self-hosted instance is running on an RPI4. For attached hardware checkout hil_pi4.json
@@ -102,12 +111,13 @@ jobs:
102111
# run only with hathach's commit due to limited resource on RPI4
103112
if: github.repository_owner == 'hathach'
104113
needs: build-arm
105-
runs-on: [self-hosted, rp2040, hardware-in-the-loop]
114+
runs-on: [self-hosted, rp2040, nrf52840, hardware-in-the-loop]
106115
strategy:
107116
fail-fast: false
108117
matrix:
109118
board:
110119
- 'raspberry_pi_pico'
120+
- 'feather_nrf52840_express'
111121
steps:
112122
- name: Clean workspace
113123
run: |
@@ -129,3 +139,11 @@ jobs:
129139
- name: Test on actual hardware
130140
run: |
131141
python3 test/hil/hil_test.py --board ${{ matrix.board }} hil_pi4.json
142+
143+
- name: Reset USB bus
144+
run: |
145+
for port in $(lspci | grep USB | cut -d' ' -f1); do
146+
echo -n "0000:${port}"| sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind;
147+
sleep 1;
148+
echo -n "0000:${port}" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind;
149+
done

hw/bsp/nrf/family.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,22 @@ uint32_t board_button_read(void) {
203203
return BUTTON_STATE_ACTIVE == nrf_gpio_pin_read(BUTTON_PIN);
204204
}
205205

206+
size_t board_get_unique_id(uint8_t id[], size_t max_len) {
207+
(void) max_len;
208+
209+
#ifdef NRF5340_XXAA
210+
uintptr_t did_addr = (uintptr_t) NRF_FICR->INFO.DEVICEID;
211+
#else
212+
uintptr_t did_addr = (uintptr_t) NRF_FICR->DEVICEID;
213+
#endif
214+
215+
const uint8_t* device_id = (const uint8_t*) did_addr;
216+
for(uint8_t i=0; i<8; i++) {
217+
id[i] = device_id[i];
218+
}
219+
return 8;
220+
}
221+
206222
int board_uart_read(uint8_t* buf, int len) {
207223
(void) buf;
208224
(void) len;

test/hil/hil_pi4.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
"flasher": "esptool",
1717
"flasher_sn": "461cb8d7decdeb119be9b506e93fd3f1",
1818
"flasher_args": "-b 1500000"
19+
},
20+
{
21+
"name": "feather_nrf52840_express",
22+
"uid": "1F0479CD0F764471",
23+
"flasher": "jlink",
24+
"flasher_sn": "000682804350",
25+
"flasher_args": "-device nrf52840_xxaa"
1926
}
2027
]
2128
}

0 commit comments

Comments
 (0)