diff --git a/ch32v-insert-coin/build-run.sh b/ch32v-insert-coin/build-run.sh index ad28a11..8461b3a 100755 --- a/ch32v-insert-coin/build-run.sh +++ b/ch32v-insert-coin/build-run.sh @@ -1,2 +1,2 @@ #!/bin/bash -docker run --privileged -it --rm -v "$PWD":/usr/src/app -w /usr/src/app ch32-env:latest cargo +nightly run --release +cargo +nightly run --release \ No newline at end of file diff --git a/ch32v-insert-coin/init.sh b/ch32v-insert-coin/init.sh index 193536f..a9c6514 100755 --- a/ch32v-insert-coin/init.sh +++ b/ch32v-insert-coin/init.sh @@ -4,6 +4,7 @@ mkdir ${PWD}/tmp cd tmp git clone ssh://git@git.glyphs.tech:222/sigil-03/docker-devtools.git cd docker-devtools/ch32 -docker build --tag ch32-env . +ls +./build.sh cd $DIR rm -rf tmp diff --git a/ch32v-insert-coin/launch.sh b/ch32v-insert-coin/launch.sh new file mode 100755 index 0000000..4230979 --- /dev/null +++ b/ch32v-insert-coin/launch.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker run --privileged -it --rm -v "$PWD":/usr/src/app -w /usr/src/app ch32-rust:latest /bin/bash diff --git a/notes.md b/notes.md index 733a006..fd0c276 100644 --- a/notes.md +++ b/notes.md @@ -3,12 +3,24 @@ there is a docker image that contains the entire toolchain + flashing utility. f ```shell $ ./init.sh ``` -once built, you won't need to build this again. for the remainder of your development, you can use the following script: +once built, you won't need to build this again. for the remainder of your development, you can use the following script to launch the environment shell: +```shell +$ ./launch.sh +``` + +this will launch the docker image and give you a shell which has all of the toolchains and flashing utilities installed. to build the firmware image and flash it to the ch32 (assuming you have a wch-linke attached) run the following from inside the env shell: + ```shell $ ./build-run.sh ``` this will build the firmware image, and attempt to upload it to the board using `wlink`. once uploaded, it will attach a serial debugger. +to exit the serial debugger simply use `ctrl-c`. to exit the environment shell use: + +```shell +$ exit +``` + # FLASHING flashing is done using the [`wlink`](https://github.com/ch32-rs/wlink?tab=readme-ov-file#install) utility. `probe-rs` also works, but can be flaky, and does not support SDI prints very well.