diff options
| author | Ha Thach <[email protected]> | 2023-12-11 21:10:55 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-11 21:10:55 +0700 |
| commit | 24c5e6ab451a002d2e9a86a39acc11476250d1a5 (patch) | |
| tree | 98d0bde15747a08c480ba09a413cfc0b52b4c0b9 | |
| parent | 37158eddcbba188dd77dbb17d77a0631a32713d0 (diff) | |
| parent | bd1009e135239cfd8be83fb220a241a4a1d87abd (diff) | |
Merge pull request #2369 from hathach/more-s3-hil
More s3 hil
| -rw-r--r-- | hw/bsp/rp2040/family.c | 7 | ||||
| -rw-r--r-- | test/hil/hil_test.py | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/hw/bsp/rp2040/family.c b/hw/bsp/rp2040/family.c index aa9d00c23..5ac104688 100644 --- a/hw/bsp/rp2040/family.c +++ b/hw/bsp/rp2040/family.c @@ -30,6 +30,7 @@ #include "pico/unique_id.h" #include "hardware/gpio.h" #include "hardware/sync.h" +#include "hardware/resets.h" #include "hardware/structs/ioqspi.h" #include "hardware/structs/sio.h" @@ -166,6 +167,12 @@ void board_init(void) #if CFG_TUH_ENABLED // set portfunc to host !!! #endif + +#if !CFG_TUD_ENABLED && !CFG_TUH_ENABLED + // board test exxample, reset usb controller + reset_block(RESETS_RESET_USBCTRL_BITS); + unreset_block_wait(RESETS_RESET_USBCTRL_BITS); +#endif } //--------------------------------------------------------------------+ diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index 9cb009264..8f8a3aa65 100644 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -115,7 +115,7 @@ def flash_jlink(board, firmware): def flash_openocd(board, firmware): ret = subprocess.run( - f'openocd -c "adapter serial {board["flasher_sn"]}" {board["flasher_args"]} -c "program {firmware} reset exit"', + f'openocd -c "adapter serial {board["flasher_sn"]}" {board["flasher_args"]} -c "program {firmware}" -c "reset init" -c "resume" -c "exit"', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) return ret |
