Skip to content

Commit

Permalink
add flash stlink
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Jul 25, 2024
1 parent 02caf00 commit ef4285c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/hil/hil_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ def flash_jlink(board, firmware):
return ret


def flash_stlink(board, firmware):
#ret = run_cmd(f'st-flash --serial {board["flasher_sn"]} write {firmware}.bin 0x08000000')
ret = run_cmd(f'STM32_Programmer_CLI --connect port=swd sn={board["flasher_sn"]} --write {firmware}.elf --go')
return ret

def flash_openocd(board, firmware):
ret = run_cmd(f'openocd -c "adapter serial {board["flasher_sn"]}" {board["flasher_args"]} -c "program {firmware}.elf reset exit"')
return ret
Expand Down Expand Up @@ -338,8 +343,10 @@ def main():
# all possible tests: board_test is added last to disable board's usb
all_tests = [
'cdc_dual_ports',
'cdc_msc', 'cdc_msc_freertos',
'dfu', 'dfu_runtime',
'cdc_msc',
'cdc_msc_freertos',
'dfu',
'dfu_runtime',
'hid_boot_interface',
'board_test'
]
Expand Down

0 comments on commit ef4285c

Please sign in to comment.