Skip to content

Commit

Permalink
add reset usb bus
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Dec 12, 2023
1 parent b5448a7 commit f986f1f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build_esp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,11 @@ jobs:
- name: Test on actual hardware
run: |
python3 test/hil/hil_test.py --board ${{ matrix.board }} hil_pi4.json
- name: Reset USB bus
run: |
for port in $(lspci | grep USB | cut -d' ' -f1); do
echo -n "0000:${port}"| sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind;
sleep 1;
echo -n "0000:${port}" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind;
done
8 changes: 8 additions & 0 deletions .github/workflows/cmake_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,11 @@ jobs:
- name: Test on actual hardware
run: |
python3 test/hil/hil_test.py --board ${{ matrix.board }} hil_pi4.json
- name: Reset USB bus
run: |
for port in $(lspci | grep USB | cut -d' ' -f1); do
echo -n "0000:${port}"| sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind;
sleep 1;
echo -n "0000:${port}" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind;
done
10 changes: 7 additions & 3 deletions hw/bsp/nrf/family.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,15 @@ size_t board_get_unique_id(uint8_t id[], size_t max_len) {
(void) max_len;

#ifdef NRF5340_XXAA
uintptr_t device_id = (uintptr_t) NRF_FICR->INFO.DEVICEID;
uintptr_t did_addr = (uintptr_t) NRF_FICR->INFO.DEVICEID;
#else
uintptr_t device_id = (uintptr_t) NRF_FICR->DEVICEID;
uintptr_t did_addr = (uintptr_t) NRF_FICR->DEVICEID;
#endif
memcpy(id, (void*) device_id, 8);

const uint8_t* device_id = (const uint8_t*) did_addr;
for(uint8_t i=0; i<8; i++) {
id[i] = device_id[i];
}
return 8;
}

Expand Down

0 comments on commit f986f1f

Please sign in to comment.