Skip to content

Commit

Permalink
add upload via wchisp tool (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach authored Jul 4, 2024
1 parent 92beac3 commit 1b28a7d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
28 changes: 28 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ CH32V00x_EVT.menu.upload_method.swdMethod=WCH-SWD
CH32V00x_EVT.menu.upload_method.swdMethod.upload.protocol=
CH32V00x_EVT.menu.upload_method.swdMethod.upload.options=
CH32V00x_EVT.menu.upload_method.swdMethod.upload.tool=WCH_linkE
CH32V00x_EVT.menu.upload_method.ispMethod=WCH-ISP
CH32V00x_EVT.menu.upload_method.ispMethod.upload.protocol=
CH32V00x_EVT.menu.upload_method.ispMethod.upload.options=
CH32V00x_EVT.menu.upload_method.ispMethod.upload.tool=wchisp


# Clock Select
Expand Down Expand Up @@ -148,6 +152,10 @@ CH32VM00X_EVT.menu.upload_method.swdMethod=WCH-SWD
CH32VM00X_EVT.menu.upload_method.swdMethod.upload.protocol=
CH32VM00X_EVT.menu.upload_method.swdMethod.upload.options=
CH32VM00X_EVT.menu.upload_method.swdMethod.upload.tool=WCH_linkE
CH32VM00X_EVT.menu.upload_method.ispMethod=WCH-ISP
CH32VM00X_EVT.menu.upload_method.ispMethod.upload.protocol=
CH32VM00X_EVT.menu.upload_method.ispMethod.upload.options=
CH32VM00X_EVT.menu.upload_method.ispMethod.upload.tool=wchisp


# Clock Select
Expand Down Expand Up @@ -248,6 +256,10 @@ CH32X035_EVT.menu.upload_method.swdMethod=WCH-SWD
CH32X035_EVT.menu.upload_method.swdMethod.upload.protocol=
CH32X035_EVT.menu.upload_method.swdMethod.upload.options=
CH32X035_EVT.menu.upload_method.swdMethod.upload.tool=WCH_linkE
CH32X035_EVT.menu.upload_method.ispMethod=WCH-ISP
CH32X035_EVT.menu.upload_method.ispMethod.upload.protocol=
CH32X035_EVT.menu.upload_method.ispMethod.upload.options=
CH32X035_EVT.menu.upload_method.ispMethod.upload.tool=wchisp


# Clock Select
Expand Down Expand Up @@ -346,6 +358,10 @@ CH32V10x_EVT.menu.upload_method.swdMethod=WCH-SWD
CH32V10x_EVT.menu.upload_method.swdMethod.upload.protocol=
CH32V10x_EVT.menu.upload_method.swdMethod.upload.options=
CH32V10x_EVT.menu.upload_method.swdMethod.upload.tool=WCH_linkE
CH32V10x_EVT.menu.upload_method.ispMethod=WCH-ISP
CH32V10x_EVT.menu.upload_method.ispMethod.upload.protocol=
CH32V10x_EVT.menu.upload_method.ispMethod.upload.options=
CH32V10x_EVT.menu.upload_method.ispMethod.upload.tool=wchisp


# Clock Select
Expand Down Expand Up @@ -522,6 +538,10 @@ CH32V20x_EVT.menu.upload_method.swdMethod=WCH-SWD
CH32V20x_EVT.menu.upload_method.swdMethod.upload.protocol=
CH32V20x_EVT.menu.upload_method.swdMethod.upload.options=
CH32V20x_EVT.menu.upload_method.swdMethod.upload.tool=WCH_linkE
CH32V20x_EVT.menu.upload_method.ispMethod=WCH-ISP
CH32V20x_EVT.menu.upload_method.ispMethod.upload.protocol=
CH32V20x_EVT.menu.upload_method.ispMethod.upload.options=
CH32V20x_EVT.menu.upload_method.ispMethod.upload.tool=wchisp


# Clock Select
Expand Down Expand Up @@ -646,6 +666,10 @@ CH32V30x_EVT.menu.upload_method.swdMethod=WCH-SWD
CH32V30x_EVT.menu.upload_method.swdMethod.upload.protocol=
CH32V30x_EVT.menu.upload_method.swdMethod.upload.options=
CH32V30x_EVT.menu.upload_method.swdMethod.upload.tool=WCH_linkE
CH32V30x_EVT.menu.upload_method.ispMethod=WCH-ISP
CH32V30x_EVT.menu.upload_method.ispMethod.upload.protocol=
CH32V30x_EVT.menu.upload_method.ispMethod.upload.options=
CH32V30x_EVT.menu.upload_method.ispMethod.upload.tool=wchisp


# Clock Select
Expand Down Expand Up @@ -762,6 +786,10 @@ CH32L10x_EVT.menu.upload_method.swdMethod=WCH-SWD
CH32L10x_EVT.menu.upload_method.swdMethod.upload.protocol=
CH32L10x_EVT.menu.upload_method.swdMethod.upload.options=
CH32L10x_EVT.menu.upload_method.swdMethod.upload.tool=WCH_linkE
CH32L10x_EVT.menu.upload_method.ispMethod=WCH-ISP
CH32L10x_EVT.menu.upload_method.ispMethod.upload.protocol=
CH32L10x_EVT.menu.upload_method.ispMethod.upload.options=
CH32L10x_EVT.menu.upload_method.ispMethod.upload.tool=wchisp


# Clock Select
Expand Down
9 changes: 8 additions & 1 deletion platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,17 @@ tools.WCH_linkE.upload.params.quiet=
tools.WCH_linkE.upload.config={runtime.tools.openocd.path}/bin/wch-riscv.cfg
tools.WCH_linkE.upload.pattern="{path}{cmd}" -f "{upload.config}" -c init -c halt -c "program {{build.path}/{build.project_name}.elf} verify; wlink_reset_resume; exit;"


#tools.WCH_linkE.upload.pattern="{path}{cmd}" -f {upload.config} -c init -c halt -c "program {{build.path}/{build.project_name}.elf}; verify_image {{build.path}/{build.project_name}.elf}; wlink_reset_resume; exit;"


## WCH-ISP
tools.wchisp.path={runtime.tools.wchisp.path}/
tools.wchisp.cmd=wchisp
tools.wchisp.upload.params.verbose=
tools.wchisp.upload.params.quiet=
tools.wchisp.upload.pattern="{path}{cmd}" {upload.verbose} flash "{build.path}/{build.project_name}.elf"


# Debugger configuration (general options)
# ----------------------------------------
# EXPERIMENTAL feature:
Expand Down
17 changes: 13 additions & 4 deletions tools/makeboards.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,19 @@ def build_upload(series, values):
print("# Upload menu")
name = values["name"]
menu = f'{name}.menu.upload_method'
print(f'{menu}.swdMethod=WCH-SWD')
print(f'{menu}.swdMethod.upload.protocol=')
print(f'{menu}.swdMethod.upload.options=')
print(f'{menu}.swdMethod.upload.tool=WCH_linkE')

menu_swd = f'{menu}.swdMethod'
print(f'{menu_swd}=WCH-SWD')
print(f'{menu_swd}.upload.protocol=')
print(f'{menu_swd}.upload.options=')
print(f'{menu_swd}.upload.tool=WCH_linkE')

menu_isp = f'{menu}.ispMethod'
print(f'{menu_isp}=WCH-ISP')
print(f'{menu_isp}.upload.protocol=')
print(f'{menu_isp}.upload.options=')
print(f'{menu_isp}.upload.tool=wchisp')

print()


Expand Down

0 comments on commit 1b28a7d

Please sign in to comment.