1
Discussion - Software / Re: LibMPSSE-I2C : FT2232H is not sending ACK
« on: June 20, 2019, 08:39:53 am »
Hello !
I finally found a workaround ! For posteriority, I'll explain what I did to obtain the correct behavior.
It was indeed a software problem, in particular the problem seems to come from the LibMPSSE-I2C library. Basically, you need to recompile the lib after activating a workaround in the source code. It seems some guy named Grahal had the same issue and submitted a fix. The issue has to do with an SCL glitch, but I'll admit I'm not sure of the detail.
So, once you have download the source files of the library, open the ftdi_i2c.c file in the TopLayer folder. On line 1400, disable the proposition 2 by replacing the
Alternatively, you can activate the proposition 1 on line 1378 instead, it actually seems to work better for me.
Note that this fixes the FastRead function, so I'm not sure it'll fix the issue if you don't use
Recompile the project, and it should now work. If you use GCC, there's a build folder with a makefile and a script. If you use MSVC, there's some changes to do before it will compile :
Finally, place yourself in the LibMPSSE folder and compile using
Maybe it'll help other people !
Cheers
I finally found a workaround ! For posteriority, I'll explain what I did to obtain the correct behavior.
It was indeed a software problem, in particular the problem seems to come from the LibMPSSE-I2C library. Basically, you need to recompile the lib after activating a workaround in the source code. It seems some guy named Grahal had the same issue and submitted a fix. The issue has to do with an SCL glitch, but I'll admit I'm not sure of the detail.
So, once you have download the source files of the library, open the ftdi_i2c.c file in the TopLayer folder. On line 1400, disable the proposition 2 by replacing the
Code: [Select]
if 1
with Code: [Select]
if 0
Just below that, on line 1412, enable the proposition 3 by replacing the Code: [Select]
if 0
with Code: [Select]
if 1
Alternatively, you can activate the proposition 1 on line 1378 instead, it actually seems to work better for me.
Note that this fixes the FastRead function, so I'm not sure it'll fix the issue if you don't use
Code: [Select]
I2C_TRANSFER_OPTIONS_FAST_TRANSFER_BYTES
Recompile the project, and it should now work. If you use GCC, there's a build folder with a makefile and a script. If you use MSVC, there's some changes to do before it will compile :
- In ftdi_infra.c, comment out every declaration and definition of my_init and my_exit
- In ftdi_infra.h, replace the likely(x) and unlikely(x) macro so that they don't do anything because __builtin_expect doesn't exist in MSVC
Finally, place yourself in the LibMPSSE folder and compile using
Code: [Select]
cl /LD /I../External/Windows/CDM /ICommon/inc /IInfra/inc /IMiddleLayer/inc /ITopLayer/I2C/inc Common/src/ftdi_common.c Infra/src/ftdi_infra.c MiddleLayer/src/ftdi_mid.c TopLayer/I2C/src/ftdi_i2c.c /FeLibMPSSE-I2C.dll
or similar to create the shared library.Maybe it'll help other people !
Cheers