Skip to content

Commit 24c5e6a

Browse files
authored
Merge pull request #2369 from hathach/more-s3-hil
More s3 hil
2 parents 37158ed + bd1009e commit 24c5e6a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

hw/bsp/rp2040/family.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "pico/unique_id.h"
3131
#include "hardware/gpio.h"
3232
#include "hardware/sync.h"
33+
#include "hardware/resets.h"
3334
#include "hardware/structs/ioqspi.h"
3435
#include "hardware/structs/sio.h"
3536

@@ -166,6 +167,12 @@ void board_init(void)
166167
#if CFG_TUH_ENABLED
167168
// set portfunc to host !!!
168169
#endif
170+
171+
#if !CFG_TUD_ENABLED && !CFG_TUH_ENABLED
172+
// board test exxample, reset usb controller
173+
reset_block(RESETS_RESET_USBCTRL_BITS);
174+
unreset_block_wait(RESETS_RESET_USBCTRL_BITS);
175+
#endif
169176
}
170177

171178
//--------------------------------------------------------------------+

test/hil/hil_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def flash_jlink(board, firmware):
115115

116116
def flash_openocd(board, firmware):
117117
ret = subprocess.run(
118-
f'openocd -c "adapter serial {board["flasher_sn"]}" {board["flasher_args"]} -c "program {firmware} reset exit"',
118+
f'openocd -c "adapter serial {board["flasher_sn"]}" {board["flasher_args"]} -c "program {firmware}" -c "reset init" -c "resume" -c "exit"',
119119
shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
120120
return ret
121121

0 commit comments

Comments
 (0)