系统ubuntu22.04,ch341demo在调用库函数读取flash时经常返回false,甚至卡死。
该芯片在windows时没有问题。demo的代码没有修改过。
gli@venus:~/project/github/ligenxxxx/hdzero-programmer/CH341PAR_LINUX/demo/ch341$ ./app /dev/ch34x_pis0 Open device /dev/ch34x_pis0 succeed, fd: 3 Driver version: V1.3 On 2023.02 Chip version: 0x32 Vendor ID: 0x1a86, Product ID: 0x5512 Device operating has function [SPI+I2C+PARALLEL+GPIO]. press f to operate spi flash, e to operate eeprom, p to operate epp parport, m to operate mem parport, g to operate gpio interface, q to quit. f FLASH Test begin. CH341 SPI interface init succeed. Failed to read flash ID. press f to operate spi flash, e to operate eeprom, p to operate epp parport, m to operate mem parport, g to operate gpio interface, q to quit. f FLASH Test begin. CH341 SPI interface init succeed. Failed to read flash ID.
press f to operate spi flash, e to operate eeprom, p to operate epp parport, m to operate mem parport, g to operate gpio interface, q to quit. f FLASH Test begin. CH341 SPI interface init succeed. Failed to read flash ID. press f to operate spi flash, e to operate eeprom, p to operate epp parport, m to operate mem parport, g to operate gpio interface, q to quit. f FLASH Test begin. CH341 SPI interface init succeed. Read flash ID: 0x1440ef00. Flash Read: Addr[0x0] read 50 bytes in 0.001 seconds. Read:
press f to operate spi flash, e to operate eeprom, p to operate epp parport, m to operate mem parport, g to operate gpio interface, q to quit. f FLASH Test begin. CH341 SPI interface init succeed. Failed to read flash ID. press f to operate spi flash, e to operate eeprom, p to operate epp parport, m to operate mem parport, g to operate gpio interface, q to quit. f FLASH Test begin. CH341 SPI interface init succeed. Read flash ID: 0x1440ef00. Flash Read: Addr[0x0] read 50 bytes in 0.001 seconds. Read: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff Segmentation fault 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff Failed to erase flash.
热门产品 :
CH634: 4端口USB3.0 HUB控制器芯片