Confused about BTPipe Usage

I am trying to shift my application over to the new BTPipes. As I read the user’s manual I can’t reconcile an ambiguity in the language:

When EP_READY is asserted, the host is free to read a full block of data. When EP_READY is deasserted, the host will not read from the module.

Is this to say that when EP_READY is asserted for as little as a single cycle the host will recognize it and then begin to transfer a full block?

OR

Is this to say that when EP_READY is asserted it must be held until the entire block has been read by the host?

Also, any further insights on the meaning of the “failed” error code for the BTPipes would be extremely helpful.

Thanks.

Bill

Hi Bill-

The EP_READY signal is polled by the firmware. Basically, you should assert EP_READY when you have data available for the host/firmware to read. The host/firmware will then read out a full block when it polls next.

You can consider the EP_BLOCKSTROBE as an “acknowledge” to the EP_READY. EP_READY will not be polled again until after the full block has been transferred.

Most of the failure codes are not encountered in practice. They come from deeper within the USB stack and generally reveal an unrecoverable error. Timeout, is one certain exception that may be encountered in practice and during normal operation.

Thanks for clarifying that. Now I get it.

Unfortunately for me, I developed my non-working system following exactly the model you describe.

That leaves me still wondering what a “Failed” error return (-1) means?

That is the error I’m getting and I don’t know if it indicates a bug in my C++, or some error in my VHDL.

To clarify, my c++ code compiles, runs. My VHDL compiles and seems to run. All is well up until the point where I request a BTPipeOut…

Bill

Can you tell me what platform and FrontPanel version you are using?

If you are on Linux and using 3.0.0, please upgrade to 3.0.1. We quickly released an update and some folks may have missed it. The Linux version had a timeout value set too low causing even smallish (30kB) BTPipe transfers to fail.

I am on an Intel Mac (macbook) running version 3.0.1 of the API and version 3.0 of the firmware. I first updated my old c++ app to use the new API, firmware, and FPGA code. All that worked. The big kink seems to be in transitioning to the new BTPipes…

Thanks.
Bill

[QUOTE=Opal Kelly Support;1365]
Most of the failure codes are not encountered in practice. They come from deeper within the USB stack and generally reveal an unrecoverable error. Timeout, is one certain exception that may be encountered in practice and during normal operation.[/QUOTE]

We are developing a Fiber optics to USB bridge for our acquisition system and we need to use BTPipes. There remain however a few shadow zones in the documentation related to these BTPipes.

  1. What is the meaning/cause of the timeout error encountered using a BTPipe? If we need to be able to recover from it, since it may be encountered, we need to know what exact event is flagged by this error.

  2. Perhaps related to the previous question : is there a maximum amount of time allowed before a block gets ready to be sent/received on the FPGA side ?

  3. What is the usage of SetBTPipePollingInterval() ? I.E. could you detail : “At the completion of a BTPipeOut transfer, the host polls the hardware to confirm that all of the data has been consumed by the FPGA before returning from the function. The polling interval is set by this method.”

Also, I would find it interesting to implement in the BTPipe IP some method to abort the transfer from the FPGA side. This would be useful in long acquisition tasks where the data is essentially flowing constantly and the transfer length has no real meaning. Transfers could then be programmed for much longer length and efficiency than the available data/space in the FPGA buffer and stopped (at a block boundary) when the FPGA detects a rupture in the flux. A new BT transfer could then be called to flush the last bytes with a smaller block length until no data remains.

Best regards.

Dr. Ch. Servais

  1. A timeout means that a particular amount of time has passed and that the call has not completed. For example, say your timeout was 5 seconds and the call did not complete in 5 seconds. The call would then be forced to return and return the error “timeout”.

  2. Yes, the “timeout”.

  3. This gets into the detail of the USB implementation but basically… Just because the PC has sent the data doesn’t mean that the FPGA has fully received the data. There are buffers in between. It is possible that the FPGA throttled-off reception after the data was sent to the USB device. Since a successful return from WriteToBTPipeIn implies that the data has been fully-consumed by the FPGA, a polling process is invoked to monitor for this event. (NOTE that this applied to BTPipeIn, NOT BTPipeOut as in the documentation at this point. This was a mistake in the documentation and has been fixed for the next release.)