File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 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//--------------------------------------------------------------------+
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ def flash_jlink(board, firmware):
115115
116116def 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
You can’t perform that action at this time.
0 commit comments