Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register


ANT_SendBurstTransfer() never returns


Total Posts: 523

Joined 2012-11-15


I'm using the newest version of the ANT dll to send a series of burst transfers. If, during the course of these transfers, I completely cover the ANT dongle and prevent all transmissions, execution will hang inside of the ANT_SendBurstTransfer() function. If any data manages to sneak through, then the function will return (sometimes successfully, sometimes unsuccessfully) normally. However, it hangs indefinitely when transmission is completely blocked. I then have to unplug the ANT dongle and plug it back in before I can use it again.

When transmission is blocked, I see a continuous stream of EVENT_RX_FAIL messages, followed by a single EVENT_RX_SEARCH_TIMEOUT message much later.

I've recompiled the dll with debug messages and managed to trace the issue down to the USB_Write() call within the DSISerialSI::WriteBytes() function. For some reason, the USB_Write never returns and this causes an unrecoverable failure.

Have you seen this problem before? Any thoughts on how to fix it?

Thanks in advance.      

Total Posts: 116

Joined 2008-11-21


Yes, this known behaviour with the AP1 - basically what is happening is that the pending burst request (on the slave device) will fill ANT's buffers and the serial interface will 'lock up' until the burst transfer commences. If the master goes away and the slave burst remains pending, then the serial interface remains locked. After multiple EVENT_RX_FAILs the slave device will go back into search mode... if the search then times out, then the channel is closed by ANT and the serial interface remains locked. The only option at this point is to reset the device. Using the ANT library there is a USBReset() function you can call to do this. USBReset() is available in dsi_serial_si.

in general:
The nRF24AP1 can be reset using the SUSPEND and SLEEP lines in Async mode and using the SMSGRDY and SRDY lines in Sync mode. The PC function USBReset() does this for you. Please see the Interfacing with ANT General Purpose Chipsets and Modules document and datasheets for details on the timing of these signals for proper resets.

NOTE: By doing a reset, the nRF24AP1 will lose configuration information for all channels.

Also, this 'locking up' is only an issue if the slave channel actually times out.... if you increase your search timeout, and the master is found again, then the burst will commence and the serial interface unlock.

If you are voluntarily closing your master you may want to implement the following:
The Tx device sends a message to the Rx device that informs the Rx device that the Tx device will be shutting down. The Tx device will then have to send another message to let the Rx device clear its burst buffer. The risk associated with this workaround is that it will not work if the Tx device is shut down due to factors out of the control of the Tx device software (loss of power etc.).

This is not an issue for AT3 or AP2. On these devices, ANT will clear its buffers of any pending messages and unlock the serial interface on a search timeout.