This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Burst transmission triggered many times

I am doing burst transfers using exactly the code suggested here devzone.nordicsemi.com/.../

The problem is, the data is received three times by the receiver (three times the same packet)

Additional info:

  • I have a registered a callback function on ANT events on the transmitter, and during transmission it triggers only once event 0x0a (EVENT_TRANSFER_TX_START) and 0x05 (EVENT_TRANSFER_TX_COMPLETED)
  • On the receiver (AntWare II) the packet indexes are consecutive, as if it was only a single burst transmission (i.e. if the burst transmission is 2 * 8 bytes, indexes are 0x00, 0x20, 0x30, 0x60, 0x20, 0xc0);
  • The only difference I reckon, my m_burst_data[] is bigger than the real data, and I use the second argument of sd_ant_burst_handler_request(..) for telling how many bytes to send (always multiple of 8). That way, I can send almost arbitrary length data - is that a legit usage? I'd like to avoid using heap and malloc. - EDIT: even with an array of the right size, the problem persists.

EDIT #2:

reference code:

do
{
err_code = sd_ant_burst_handler_request(CHANNEL_0, sizeof(m_burst_data), m_burst_data, BURST_SEGMENT_START);                
} while (err_code == NRF_ANT_ERROR_TRANSFER_IN_PROGRESS);

APP_ERROR_CHECK(err_code);
while(burst_wait)
;


err_code = sd_ant_burst_handler_request(CHANNEL_0, sizeof(m_burst_data), m_burst_data, BURST_SEGMENT_CONTINUE);
APP_ERROR_CHECK(err_code);
while(burst_wait)
;


err_code = sd_ant_burst_handler_request(CHANNEL_0, sizeof(m_burst_data), m_burst_data, BURST_SEGMENT_END); 
APP_ERROR_CHECK(err_code);
while(burst_wait)
;

If I comment the middle "sd_ant_burst_handler_request(... BURST_SEGMENT_CONTINUE)" section, the burst transmission happens 'only' 2 times.

I I comment both the middle section and the last "sd_ant_burst_handler_request(... BURST_SEGMENT_END)", the burst is received once, but the receiver triggers a EVENT_TRANSFER_RX_FAILED_0x04

Has anyone an idea about how sd_ant_burst_handler_request() is supposed to work and what it specifically does? Why have I found also a version without BURST_SEGMENT_CONTINUE somewhere in the thisisant website? www.thisisant.com/

  • This works for me to send 64 bytes of 72:

    uint8_t m_burst_data[72];
    err_code = sd_ant_burst_handler_request(CHANNEL_1, ((sizeof(m_burst_data))-8), m_burst_data, (BURST_SEGMENT_START | BURST_SEGMENT_END));
    

    Consider:

    Burst: the last packet of the burst will be retransmitted on the next channel period if ANT has not received any new data from the master’s host MCU. Advanced Burst: the first packet of the burst will be retransmitted on the next channel period if ANT has not received any new data from the master’s host MCU. Unlike normal burst transfers, the retransmitted data will be the first packet of the burst (the initial 8-byte normal burst packet).

    That's for nRF51 master (sends Advanced Burst) -> ANT AP2 81M5IB slave (Burst only capable device):

    image description

    It's funny, but after I figured this line of code out, today I found exactly the same solution here.

    This can help too.

  • Hi, thanks a lot. I have googled for uses of sd_ant_burst_handler_request() but the two links you posted are in a restricted area, so they weren't showing up. For completeness, this is what made my burst transmission work:

    do
    {
        err_code = sd_ant_burst_handler_request(CHANNEL_0, TX_PACKET_LEN, ant_msg, (BURST_SEGMENT_START|BURST_SEGMENT_END) );                
    } 
    while (err_code == NRF_ANT_ERROR_TRANSFER_IN_PROGRESS);
    APP_ERROR_CHECK(err_code);
    

    I notice that the registering of the wait flag became useless and I can remove it, am I right?

    err_code = sd_ant_burst_handler_wait_flag_enable(&burst_wait);
    

    However, the use of sd_ant_burst_handler_request() is a bit hard to guess, maybe an example in the SDK or in the documentation would be nice to have.

  • It is worth registering at thisisant.com.

    thisisant SDK shows, when flag is needed (antfs.c x message_types_main.c).

  • Year late, but this approach works okay until the burst sequence does not get very long (in my case got 30 times 8byte packets)....

Related