General Category > Discussion - Software

Unexpected invalid handle - conflict between two devices

(1/2) > >>

dania:
Hello,

i have connected two devices to PC:
1. SIGMA 2 by ASIX (www.asix.cz), is "black box" for me
2. FT4232H with virtual COMs disabled, DE signal is enabled at Channel C and device name is changed to "Mila 5000". VID and PID are default. Channel A is used as I2C, Channel B is used as SPI and Channel C is used as RS485.

Operating System is Windows 10, Visual Studio 2022, FTD2XX_NET and LibMPSSE are used. Software is developed in C#.

Issue: Channel B have invalid handle (handle value is 0) after SPI_OpenChannel call. Return value of SPI_OpenChannel is FT_OK.
Note: If FT4232H is connected only (OMEGA 2 is disconnected), handle have correct value. When I connect OMEGA 2 only after openning FT4232H, bozh devices work properly.
 

dania:
I still tried to open Channel B in the same way as Channel C via FTD2XX API, without LinMPSSE use. Channel B not opened. 

FTDI Community:
hello,

Could you clarify if you are using the SIGMA 2 or the OMEGA 2, as you say both in the post. The SIGMA 2 is a full speed device, whilst the OMEGA 2 is a Hi speed device. the FT4232H is also a Hi speed device.

Is the only time the issue occurs when the SIGMA/OMEGA is connected before FT4232H is opened? And when it is just the FT4232H connected or it is opened before the other device is connected, everything works fine?

Here is some helpful documentation:

http://www.ftdichip.com/Support/Documents/AppNotes/AN_111_Programmers_Guide_for_High_Speed_FTCSPI_DLL.pdf

http://www.ftdichip.com/Support/Documents/AppNotes/AN_135_MPSSE_Basics.pdf

Best regards

FTDI Community

dania:

--- Code: ---[DllImport("libMPSSE.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern FTDI.FT_STATUS SPI_GetChannelInfo(uint index, ref FTDI.FT_DEVICE_INFO_NODE chanInfo);

--- End code ---
dont work.


--- Code: ---[StructLayout(LayoutKind.Sequential, Pack = 4)]
    public struct FT_DEVICE_LIST_INFO_NODE
    {
        public uint Flags;
        public uint Type;
        public uint ID;
        public uint LocID;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
        public byte[] SerialNumber;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
        public byte[] Description;
    }

[DllImport("libMPSSE.dll", CallingConvention = CallingConvention.Cdecl)]
        public static extern FTDI.FT_STATUS SPI_GetChannelInfo(uint index, ref FT_DEVICE_LIST_INFO_NODE chanInfo);

--- End code ---
work correctly.

Have FTD2XX_NET package error?

Edit: Second Device is Sigma 2

FTDI Community:
Hi,

Channel B can only be opened using LibMPSSE when being used as SPI.

if both devices work fine if you open FT4232H first, then the device seems to be operating fine. Are FT4232H and SIGMA 2 connected in any way or are they just both connected to the PC?

one other thing that could be causing the issue is that FT4232H is a hi speed device and SIGMA 2 is a full speed device. But this should'nt really matter if the two devices are not connected to each other.

Best regards,

FTDI Community

Navigation

[0] Message Index

[#] Next page

Go to full version