Skip to content

treideme/ch32v003-semihosting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CH32V003 Semihosting Example

This example demonstrates how to use the semihosting feature of the RISCV using a customized openocd port from WCH's openocd sources.

  • See my blog for more information.

Building OpenOCD

git clone --recursive [email protected]:treideme/openocd-hacks.git
cd openocd-hacks
./bootstrap
./configure --enable-wlinke \
	--disable-ch347 \
	--prefix=/opt/wch-riscv-openocd/ \
	--program-prefix=wch-riscv- \
	--disable-werror

make
sudo make install

# test installation
/opt/wch-riscv-openocd/bin/wch-riscv-openocd --version

Building the example

  • Install WCH's toolchain
  • Make sure it is in path
  • Install meson and ninja
# Configure the build
meson setup --cross-file cross.ini -Dbuildtype=debug build
# Build
ninja -C build

# Try semihosting IO with target
/opt/wch-riscv-openocd/bin/wch-riscv-openocd -f flash.cfg
# Watch the user interaction
...
# Terminate [CTRL]+[C] when happy

About

Sample code for semhosting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages