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

some promble with s332 ant backgroud scan

Hey, guys, let me ask you a question.I have a device that does bluetooth broadcasting and ant background scanning.After working for 12 hours, the bluetooth broadcast frequency changed to 2.5s once.When I turned off the ant background scan, the bluetooth radio worked again.Using sdk14.2, s332 protocol stack.Have you ever encountered such problem

Parents Reply
  • hi,Kebbeth。last Friday i use ant_search_init(ant_search_config_t const * p_config)to config to config ant.the bluetooth broadcasting is working normal.but i dont no what  cased this? you give document  only say 
    may affect co-existence with other protocolson multimode communication chipsets.dont give me reason.Even if it is not initialized, it should not affect bluetooth broadcasting.can you give answer  ?thinks!!

Children
  • If you are not calling ant_search_init(), then the stack will use default search priority:

    "When an ANT channel is opened on a slave device, the search is automatically and immediately initiated. ANT will first search in low priority mode, and then will only switch to high priority mode after a defined time out. If the high priority search also times out, then ANT will issue an EVENT_RX_SEARCH_TIMEOUT and close the channel ()."

    So if you want to avoid high priority search mode you should call ant_search_init() first.

  • High priority search may affect bluetooth broadcasting?Why didn't it show up when it first started?It was only when I worked for a long time that it became a problem.Ps: it took a long time for the ant background scan to cause bluetooth broadcasting is working abnormality.

  • Hi,

    I believe the reason is: "ANT will first search in low priority mode, and then will only switch to high priority mode after a defined time out."

    I suggest you call ant_search_init() to avoid high priority mode to occur, from my understanding you can confirm this works?

    When you open scanning channel, what timeout do you define? 

    When you start advertising, what timeout do you define?

    Best regards,
    Kenneth

  • hi,Kebbeth ,this problem continues.this is my  ant config.

    err_code = sd_ant_stack_reset();
    APP_ERROR_CHECK(err_code);
    err_code = ant_stack_static_config();
    APP_ERROR_CHECK(err_code);



    // Set Network Address.
    pa_lna_assist(TXEN_RFPA,RXEN_RFPA);

    ant_channel_config_t channel_config =
    {
    .channel_number = 0,
    .channel_type = CHANNEL_TYPE_SLAVE,
    .ext_assign = 0x00,
    .rf_freq = ANTPLUS_RF_FREQ,
    .transmission_type = 0,
    .device_type = 0,
    .device_number = 0x00, // Wildcard
    .channel_period = 0x00, // Not used, since this is going to be scanning
    .network_number = ANTPLUS_NETWORK_NUMBER,
    };

    err_code = ant_channel_init(&channel_config);
    APP_ERROR_CHECK(err_code);

    err_code = sd_ant_channel_assign(0,
    CHANNEL_TYPE_SLAVE,
    ANTPLUS_NETWORK_NUMBER,
    0x00);

    err_code = sd_ant_network_address_set(ANTPLUS_NETWORK_NUMBER, m_network_key);
    APP_ERROR_CHECK(err_code);


    err_code = sd_ant_lib_config_set(ANT_LIB_CONFIG_MESG_OUT_INC_RSSI
    | ANT_LIB_CONFIG_MESG_OUT_INC_DEVICE_ID);
    APP_ERROR_CHECK(err_code);

    const ant_search_config_t bs_search_config =
    {
    .channel_number = 0,
    .low_priority_timeout = ANT_LOW_PRIORITY_TIMEOUT_DISABLE,
    .high_priority_timeout = ANT_HIGH_PRIORITY_SEARCH_DISABLE,
    .search_sharing_cycles = ANT_SEARCH_SHARING_CYCLES_DISABLE,
    .search_priority = ANT_SEARCH_PRIORITY_DEFAULT,
    .waveform = ANT_WAVEFORM_DEFAULT,
    };
    err_code = ant_search_init(&bs_search_config);
    APP_ERROR_CHECK(err_code);.

    I use ant_search_init().There's something wrong with the bluetooth radio.Work at least 14 or above

    ,the ant background must impacted bluetooth radio.Can you give it a try?thank you very much.

  • Hello again,

    Can you try the following:

    1. First read in current coex configuration using sd_ant_coex_config_get(). This way you only need to alter configurations for the ones that you are interested in and leave default for everything else. Can ignore adv coex config for now by setting input parameter to NULL.

    ANT_BUFFER_PTR readCfg;
    uint8_t buffer[10];
    readCfg.ucBufferSize = 10;
    readCfg.pucBuffer = &buffer[0];
    error = sd_ant_coex_config_get(channel, &readCfg, NULL);
    Note: default configuration should read 0x0D,0x00,0x04,0x03,0x00,0x3A,0x00,0x3A,0x14,0x3C

    2. Disable the fixed search priority interval (bit 3 in Byte0 field).

    readCfg.pucBuffer[0] &= ~0x08; // disable fixed search hp interval priority config

    3. Write back configuration. Again, ignore advanced coex cfg by setting input parameter to NULL

    error = sd_ant_coex_config_set(channel, &readCfg, NULL);

    4. Byte 0 should be 0x05 (instead of previous value 0x0D) if the configuration is now read back using sd_ant_coex_config_get(..).

    Best regards,
    Kenneth

Related