I want to use an FT4232H for 2 USB to SPI interfaces.
Program is written in C++ with Qt on Windows and Qt5.15.2 mingw32 toolchain using
cmake as build tool.
Problem: Getting channel number and information work as expected. But opening an interface causes a segfault.
Using a test console application with mvsc2019 works without the segfault.
SPI_OpenChannel from the spi example has the same issue.
Init_libMPSSE();
DWORD nr_channel = 0;
SPI_GetNumChannels(&nr_channel);
qDebug() << "Number of MPSSE Channels: " << nr_channel;
FT_DEVICE_LIST_INFO_NODE info;
for (int i = 0; i < nr_channel; i++) {
SPI_GetChannelInfo(i, &info);
qDebug() << "Channel " << i;
qDebug() << " -- Description: " << info.Description;
qDebug() << " -- Loc ID: " << info.LocId;
qDebug() << " -- ID: " << info.ID;
qDebug() << " -- Type: " << info.Type;
}
if (auto ret = FT_Open(0, m_flashHandle) != FT_OK) {
throw std::exception();
}