platform-ch32v: Unable to flash firmware on MacOS

Hello all, Thanks for the amazing work. I am using platformIO with VSCode on a M2 Pro MacBook Pro. I have got the LED blinking using the Arduino IDE using this port of the Arduino core. The official core does not seem to support MacOS yet.

Hence, there is no issue on the physical level. I followed all the steps in the README and in addition I followed this excellent resource to adapt the guide to MacOS.

On VSCode, when I compile, it works perfectly. But when I hit flash/upload, I get this error :

verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ch32v/ch32v003f4p6_evt_r0.html
PLATFORM: WCH CH32V (1.0.0+sha.131d250) > CH32V003F4P6-EVT-R0
HARDWARE: CH32V003F4P6 48MHz, 2KB RAM, 16KB Flash
DEBUG: Current (wch-link) On-board (wch-link) External (minichlink)
PACKAGES: 
 - tool-minichlink @ 0.1.0+sha.af02ba5 
 - tool-openocd-riscv-wch @ 2.1100.230329 (11.0) 
 - tool-wchisp @ 0.22.230228 
 - toolchain-riscv @ 1.80200.190731+sha.99cb62f
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/ch32v003f4p6_evt_r0/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  12.5% (used 256 bytes from 2048 bytes)
Flash: [          ]   3.1% (used 516 bytes from 16384 bytes)
Configuring upload protocol...
AVAILABLE: isp, minichlink, wch-link
CURRENT: upload_protocol = wch-link
Uploading .pio/build/ch32v003f4p6_evt_r0/firmware.elf
Open On-Chip Debugger 0.11.0+dev-02415-gfad123a16-dirty (2023-03-02-14:04)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

Warn : Transport "sdi" was already selected
Ready for Remote Connections

*** [upload] Error 1

If I press the button the CH32V003 board, I get the following error :

Processing ch32v003f4p6_evt_r0 (board: ch32v003f4p6_evt_r0; platform: ch32v)
-----------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ch32v/ch32v003f4p6_evt_r0.html
PLATFORM: WCH CH32V (1.0.0+sha.131d250) > CH32V003F4P6-EVT-R0
HARDWARE: CH32V003F4P6 48MHz, 2KB RAM, 16KB Flash
DEBUG: Current (wch-link) On-board (wch-link) External (minichlink)
PACKAGES: 
 - tool-minichlink @ 0.1.0+sha.af02ba5 
 - tool-openocd-riscv-wch @ 2.1100.230329 (11.0) 
 - tool-wchisp @ 0.22.230228 
 - toolchain-riscv @ 1.80200.190731+sha.99cb62f
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/ch32v003f4p6_evt_r0/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  12.5% (used 256 bytes from 2048 bytes)
Flash: [          ]   3.1% (used 516 bytes from 16384 bytes)
Configuring upload protocol...
AVAILABLE: isp, minichlink, wch-link
CURRENT: upload_protocol = wch-link
Uploading .pio/build/ch32v003f4p6_evt_r0/firmware.elf
Open On-Chip Debugger 0.11.0+dev-02415-gfad123a16-dirty (2023-03-02-14:04)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

Warn : Transport "sdi" was already selected
Ready for Remote Connections
Error:  WCH-Link failed to connect with riscvchip
Error:  1.Make sure the two-line debug interface has been opened. If not, set board to boot mode then use ISP tool to open it
Error:  2.Please check your physical link connection

*** [upload] Error 1

What could be the possible error? Thanks a lot again! Cheers.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 19 (11 by maintainers)

Most upvoted comments

All right here. Thank you so much for your help.