你好,我使用CH343G来给ESP32烧录程序。但是烧录会回报Failed to write to target RAM错误。搜索结果表示使用官方驱动可以解决。
我使用http://www.wch.cn/downloads/CH34XSER_MAC_ZIP.html 确实可以正常烧录,但是会引入一个比较恶性的bug。CH343G第一次插入USB口,或者开机前插入,不会有任何问题。但是拔出以后,该USB口再插就不会识别硬件了。换其他USB设备也不行。
硬件我用自己的板子和官方淘宝店买的CH343适配器(仅连接VIO和3.3V)问题一样,应该可排除硬件问题。
我的操作系统是Mojave 10.14.6。使用console在系统日志里搜索CH34x,会返回以下的结果:
debug08:59:36.106969 -0500kextdentering /Library/Extensions/CH34xVCPDriver.kext
debug08:59:36.107067 -0500kextdentering /Library/Extensions/CH34xVCPDriver.kext/Contents
debug08:59:36.107114 -0500kextdleaving /Library/Extensions/CH34xVCPDriver.kext/Contents
debug08:59:36.107164 -0500kextdleaving /Library/Extensions/CH34xVCPDriver.kext
debug08:59:36.107320 -0500kextdopen(/Library/Extensions/CH34xVCPDriver.kext/Contents/MacOS/CH34xVCPDriver,0x0,0x1b6) = 4
debug08:59:36.107366 -0500kextdopen(/Library/Extensions/CH34xVCPDriver.kext/Contents/MacOS/CH34xVCPDriver,0x0,0x1b6) = 5
debug08:59:36.107538 -0500kextd10339 signing bytes in 4 blob(s) from /Library/Extensions/CH34xVCPDriver.kext/Contents/MacOS/CH34xVCPDriver(x86_64)
debug08:59:36.107600 -0500kextdfailed to fetch /Library/Extensions/CH34xVCPDriver.kext/Contents/_CodeSignature/CodeRequirements-2 error=-10
debug08:59:36.107638 -0500kextdExtracting ticket from bundle: /Library/Extensions/CH34xVCPDriver.kext
debug08:59:36.107690 -0500kextdsuccessfully found stapled ticket for: /Library/Extensions/CH34xVCPDriver.kext
debug08:59:36.139650 -0500kextdopen(/Library/Extensions/CH34xVCPDriver.kext/Contents/Info.plist,0x0,0x1b6) = 4
debug08:59:36.140086 -0500kextdfailed to fetch /Library/Extensions/CH34xVCPDriver.kext/Contents/_CodeSignature/CodeTopDirectory error=-10
debug08:59:36.140708 -0500kextdfailed to fetch /Library/Extensions/CH34xVCPDriver.kext/Contents/_CodeSignature/CodeEntitlements error=-10
debug08:59:36.141739 -0500kextdentering /Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext
debug08:59:36.141831 -0500kextdentering /Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext/Contents
debug08:59:36.141869 -0500kextdleaving /Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext/Contents
debug08:59:36.141901 -0500kextdleaving /Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext
debug08:59:36.142111 -0500kextdopen(/Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext/Contents/MacOS/CH34xVCPDriver,0x0,0x1b6) = 4
debug08:59:36.142182 -0500kextdopen(/Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext/Contents/MacOS/CH34xVCPDriver,0x0,0x1b6) = 5
debug08:59:36.142381 -0500kextd10339 signing bytes in 4 blob(s) from /Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext/Contents/MacOS/CH34xVCPDriver(x86_64)
debug08:59:36.142449 -0500kextdfailed to fetch /Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext/Contents/_CodeSignature/CodeRequirements-2 error=-10
debug08:59:36.142547 -0500kextdExtracting ticket from bundle: /Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext
debug08:59:36.142735 -0500kextdsuccessfully found stapled ticket for: /Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext
debug08:59:36.177356 -0500kextdopen(/Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext/Contents/Info.plist,0x0,0x1b6) = 4
debug08:59:36.177583 -0500kextdfailed to fetch /Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext/Contents/_CodeSignature/CodeTopDirectory error=-10
debug08:59:36.178001 -0500kextdfailed to fetch /Library/StagedExtensions/Library/Extensions/CH34xVCPDriver.kext/Contents/_CodeSignature/CodeEntitlements error=-10
而不能使用的时候,还会多以下两条
debug09:00:30.356210 -0500DockOSErr AEEventImpl::putAttributeDesc(OSType, const AEDesc *)(shas = ["d36608cc1e39f272d10b89eb1287231c9d8cccef;00;00000000;00000000;00000000;0000000000000020;com.apple.app-sandbox.read-write;01;01000004;00000002041f0fa3;01;/users/sundeqing/downloads/ch34xser_mac 3"] result=0
debug09:00:30.356256 -0500DockOSErr AEPutAttributeDesc(AppleEvent *, AEKeyword, const AEDesc *)(shas desc=["d36608cc1e39f272d10b89eb1287231c9d8cccef;00;00000000;00000000;00000000;0000000000000020;com.apple.app-sandbox.read-write;01;01000004;00000002041f0fa3;01;/users/sundeqing/downloads/ch34xser_mac 3"] err=0/noErr