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: Software hangs at FT_AbortPipe or FT_Close after FT_ReadPipeEx - FT60X  (Read 336 times)

Josiah

  • Newbie
  • *
  • Posts: 1
    • View Profile

Good day,
I am developing a high-speed USB 3 continuous data READ application using FTDI D3XXX Library.  The application is multi-threaded, with one thread ('FTDIDataStreamer' class) solely responsible for reading in the USB packets.  Briefly the logic of the class is as follows:

Initialization:
1. FT_Create
2. FT_InitializeOverlapped on 4096 buffers
3. FT_SetStreamPipe on 0x82
4. Queue up initial batch of requests: FT_ReadPipeEx 4096 buffers each with a size of 8192 bytes

Execution (continuous loop over 4096 buffers):
1. FT_GetOverlappedResult
2. If (1) was successful and 8192 bytes were read, then resubmit on specific buffer to keep requests full: FT_ReadPipeEx.

Clean-up:
1. If FT_Status is FT_IO_PENDING, then FT_GetOverlappedResult otherwise FT_AbortPipe
2. FT_ClearStreamPipe on 0x82
3. FT_ReleaseOverlapped on all 4096 buffers
4. FT_Close


Now the problem I have is that the thread fails to quit because it gets stuck/hangs indefinitely at either line 1 (FT_GetOverlappedResult or FT_AbortPipe) or line 4 (FT_Close) in the Clean-up stage.  This happens regardless of whether it enters the Execution stage or not.  After debugging I realized that this happens when FT_ReadPipeEx is called in either the Initialization stage or the Execution stage.  Once this happens, the only way I get the thread to quit is if I unplug the USB3 FTDI device, which is bad and not ideal for my application.

Any idea what the issue might be?  Any help would be appreciated.

Kind regards,
Josiah

« Last Edit: April 22, 2021, 10:27:51 AM by Josiah »
Logged

j.pflaum

  • Newbie
  • *
  • Posts: 2
    • View Profile

Hello Josiah,

I might have the same problem and cannot resolve it.
Did you find a solution and may you share it, please?

Thank you and best regards,
Johannes
Logged