FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: Question  (Read 4809 times)

Arsen

  • Newbie
  • *
  • Posts: 7
    • View Profile
Question
« on: March 13, 2024, 04:42:29 AM »



      while(1)
        for (int i = 0; i < configurationDescriptor.bNumInterfaces; i++) {
            FT_GetInterfaceDescriptor(HandleFtdi, i, pInterfaceDescriptor + i);
            for (int j = 0; j < pInterfaceDescriptor.bNumEndpoints; j++) {
                res = FT_GetPipeInformation(HandleFtdi,i,j, &pipeInformation);
                if (res != FT_OK) {
                    cout << "FT_GetPipeInformation Error!";
                } else {
                    if (!(pipeInformation.PipeId & 0x80)) {
                        res = FT_WritePipe(HandleFtdi, pipeInformation.PipeId, bufWr, pipeInformation.MaximumPacketSize, &ulBytesTransferred, NULL);
                        if (res != FT_OK) {
                            cout << "FT_WritePipe Error " ;
                        }
                    }
                    else {
                        res = FT_ReadPipe(HandleFtdi, pipeInformation.PipeId, bufRd, pipeInformation.MaximumPacketSize, &ulBytesTransferred, NULL); //second time this function does not return. Why? The first time it returns by timeout.
                        if (res != FT_OK) {
                            cout << "FT_ReadPipe Error " ;   
                        }
                   }
                }
            }
        }

Hi all. Please, say Me.
This part of the program works well, but on the second pass, when FT_ReadPipe is executed, the program freezes and does not return after timeout. The first time it returns by timeout (default 5 seconds).
In addition, I want to say that we made a USB device with FT600 and STM. But the STM is not running yet and is not writing to the FT600 buffer, so it's good that FT_ReadPipe is returning after a timeout. But why doesn’t it return the second time but freezes?
Thank everybody.
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 897
    • View Profile
Re: Question
« Reply #1 on: March 14, 2024, 09:41:41 AM »

Hi,

Have a look at section 3.2 of AN_412 FT600/FT601 Bridge Chips Integration, this goes over the abort recovery process.

Any error or timeout requires this abort process before resuming the read/write.

Best Regards
FTDI Community
Logged

Arsen

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Question
« Reply #2 on: March 14, 2024, 10:14:56 AM »

Thank you very much for Your reply.
Logged