add flash_openocd_adi() for use with max32

add feather max32666 to the hil pool
This commit is contained in:
hathach
2024-08-18 17:15:07 +07:00
parent 76eb2f5066
commit e345380723
5 changed files with 41 additions and 15 deletions

View File

@@ -173,10 +173,20 @@ echo "Ready for Remote Connections"
with open(f_wch, 'w') as file:
file.write(cfg_content)
ret = run_cmd(f'openocd_wch -c "adapter serial {board["flasher_sn"]}" -f {f_wch} -c "program {firmware}.elf reset exit"')
ret = run_cmd(f'openocd_wch -c "adapter serial {board["flasher_sn"]}" -f {f_wch} '
f'-c "program {firmware}.elf reset exit"')
return ret
def flash_openocd_adi(board, firmware):
openocd_adi_script_path = f'{os.getenv("HOME")}/app/openocd_adi/tcl'
if not os.path.exists(openocd_adi_script_path):
openocd_adi_script_path = '/home/pi/openocd_adi/tcl'
ret = run_cmd(f'openocd_adi -c "adapter serial {board["flasher_sn"]}" -s {openocd_adi_script_path} '
f'{board["flasher_args"]} -c "program {firmware}.elf reset exit"')
return ret
def flash_wlink_rs(board, firmware):
# wlink use index for probe selection and lacking usb serial support
ret = run_cmd(f'wlink flash {firmware}.elf')