Part Number:DLPC3478
首先,我们的项目配置:我们完全使用DLPC-API-1.5的源码,只是属性配置不一样。另外,我们使用64位的CyUSBSerial.dll和.lib都是从别的项目中找的,因为没有在DLPC-API-1.5中找到。
我们遇到的问题:在GetCyI2CHandle返回时报错,报错信息为:Run-Time Check Failure #2 – Stack around the variable 'DeviceInfo' was corrupted.
经检查发现:在GetCyI2Handle的第79行Status = CyGetDeviceInfo(DeviceIdx, &DeviceInfo)返回的DeviceInfo缺失了一个成员:CY_DEVICE_SERIAL_BLOCK deviceBlock;
我们采取的措施是:在CyUSBSerial.h文件的第291行、295行注释掉WIN32,此后该程序可以正常运行
请问有没有别的解决方案,我们采取的这种手段有没有别的弊端或者潜在的隐患。
Jeremy_Wu:
DLPC-API-1.10\third_party\cyusbserial
有的。
Cypress USB-Serial Library for Windows (CyUSBSerial.h and cyusbserial.dll)
2.0.3
TI Commercial
Binary
N/A
Location
[Install Dir]/C/third_party/cyusbserial/*.*Obtained from
Cypress (www.cypress.com/…/usb-serial-software-development-kit)