Skip to content

Commit f986f1f

Browse files
committed
add reset usb bus
1 parent b5448a7 commit f986f1f

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,11 @@ jobs:
139139
- name: Test on actual hardware
140140
run: |
141141
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: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,15 @@ size_t board_get_unique_id(uint8_t id[], size_t max_len) {
207207
(void) max_len;
208208

209209
#ifdef NRF5340_XXAA
210-
uintptr_t device_id = (uintptr_t) NRF_FICR->INFO.DEVICEID;
210+
uintptr_t did_addr = (uintptr_t) NRF_FICR->INFO.DEVICEID;
211211
#else
212-
uintptr_t device_id = (uintptr_t) NRF_FICR->DEVICEID;
212+
uintptr_t did_addr = (uintptr_t) NRF_FICR->DEVICEID;
213213
#endif
214-
memcpy(id, (void*) device_id, 8);
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+
}
215219
return 8;
216220
}
217221

0 commit comments

Comments
 (0)