Skip to content

how to build flash and use examples on windows

Benjamin Vernoux edited this page Nov 1, 2023 · 28 revisions

How to build flash and use examples on Windows with MSY2/MINGW64 shell

Build the firmware source code for HydraUSB3(CH569W MCU) with MSY2/MINGW64 shell

How to build the firmware source code for HydraUSB3(CH569 MCU) with MSY2/MINGW64 shell

Prerequisites

Clone the hydrausb3_fw repository with git

  • Start mingw64
cd ~
git clone --recursive https://github.com/hydrausb3/hydrausb3_fw.git

Windows 10 x64 + open source GCC RISC-V v12.2.0 with MSYS2/MINGW64

  • Start mingw64
  • Add the path to "GCC RISC-V v12.2.0" (example with nomultilib version xpack-riscv-none-elf-gcc-12.2.0-1-win32-x64.zip extracted in c: and renamed xpack-riscv-none-elf-gcc-12.2.0-1-win32-x64_wch_nomultilib) bin directory
    • PATH="/c/xpack-riscv-none-elf-gcc-12.2.0-1-win32-x64_wch_nomultilib/bin/":$PATH
  • Change current directory to firmware example (here HydraUSB3_Blink_ULED)
    • cd ~/hydrausb3_fw/HydraUSB3_Blink_ULED
  • Clean and build the firmware example
    • make clean all
  • The flashable firmware with wch-ch56x-isp (*.bin) is available in ~/hydrausb3_fw/HydraUSB3_Blink_ULED/build/HydraUSB3_Blink_ULED.bin

Windows 10 x64 + MounRiver Studio Community Win V130 with MSYS2/MINGW64

  • Start mingw64
  • Add the path to "RISC-V Embedded GCC" bin directory
    • For MounRiver Studio Community Win V130(or more)
      • PATH="/c/MounRiver/MRS_Community/toolchain/RISC-V Embedded GCC/bin/":$PATH
  • Change current directory to firmware example (here HydraUSB3_Blink_ULED)
    • cd ~/hydrausb3_fw/HydraUSB3_Blink_ULED
  • Clean and build the firmware example
    • make clean all
  • The flashable firmware with wch-ch56x-isp (*.bin) is available in ~/hydrausb3_fw/HydraUSB3_Blink_ULED/build/HydraUSB3_Blink_ULED.bin

Flash and use hydrausb3_fw example(s) with wch-ch56x-isp

See https://github.com/hydrausb3/hydrausb3_fw/wiki/Flash-and-use-hydrausb3_fw-example-on-windows