CH32V000x Mac Mini 4 dylib missing

Hi everybody.

Platform: Arduino IDE 2.3.4 in a Mac Mini M4 256GB with 24GBRam Sequoia 15.3.1

Installed via settings the CH32V chip (https://github.com/openwch/board_manager_files/raw/main/package_ch32v_index.json)

It seems to do things (like beforeinstall.sh and others related to openocd).

Application: Simple Blink example so no need to describe it.

Compiles without errors.

Connected to WCH-Link and mcu as per instructions.(have teh WCH-Link and MCU board).

Upload is the problem, not that it doesn't find the port, it doesn't get there, it has a dylib not found error, related/called by openocd.

Sketch uses 5376 bytes (32%) of program storage space. Maximum is 16384 bytes.
Global variables use 404 bytes (19%) of dynamic memory, leaving 1644 bytes for local variables. Maximum is 2048 bytes.
dyld[5994]: Library not loaded: /usr/local/opt/libusb/lib/libusb-1.0.0.dylib
  Referenced from: <C79B1DDB-9DAE-30AE-9474-2E146265EC5A> /Users/rsn/Library/Arduino15/packages/WCH/tools/openocd/1.0.0/bin/openocd
  Reason: tried: '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/lib/libusb-1.0.0.dylib' (no such file), '/usr/lib/libusb-1.0.0.dylib' (no such file, not in dyld cache)
Failed uploading: uploading error: signal: abort trap

There is no such directory in osx ->/usr/local/opt and the others.

libusb has been installed via Brew.

Reviewing the package installing scripts we find a beforeinstall.sh that is displayed as being exectued when first installing the CH32Vxxx and simply goes on.

The code inside has linux cmds that are not osx like udevcmd, and ldconfig.

Did cheat by copying the installed libusb required library to the required dir and got

dyld[7201]: Library not loaded: /usr/local/opt/libusb/lib/libusb-1.0.0.dylib
  Referenced from: <C79B1DDB-9DAE-30AE-9474-2E146265EC5A> /Users/rsn/Library/Arduino15/packages/WCH/tools/openocd/1.0.0/bin/openocd
  Reason: tried: '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libusb-1.0.0.dylib' (no such file), '/usr/lib/libusb-1.0.0.dylib' (no such file, not in dyld cache)
Failed uploading: uploading error: signal: abort trap

So yes, CH32V0003 is not compatible with the MAc Mini 4 ARM.

Perhaps there is a url for mac osx ARM version of the CH32V000?

Kind regards.

Have you read this issue? Seems the same. (Sorry but I don't have a Mac)

Thanks ill give it a try

Hi.

Thanks it did try to upload without having any .dll dylib problems. Then another problem was that the WCH-LinkE needed firmware update which is a mess in Mac so I updated it according to this link https://github.com/openwch/arduino_core_ch32/issues/58 but in Windows by downloading the Utility here https://www.wch.cn/downloads/WCH-LinkUtility_ZIP.html

Thanks for your help, now everything works!!

Regards.

Good to read you got something working. Thanks for posting that.

Although the CH32 Arduino core is not 100% complete and the community support could be better, I do like the the CH32V003 as their affordability allows for more risk-full experiments and I really enjoy being able to do real-time debugging using the IDE.

The biggest challenge for me is their limited flash space. To mitigate that during development, I fancy the CH32X033, which has 64kB flash, decent pin-compatibility in the TSSOP20 package and is still quite affordable.

I wish you good luck using your Mac for the CH32 chips. Have fun!