<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>sd_ant_enable returns NRF_ERROR_INVALID_PARAM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99980/sd_ant_enable-returns-nrf_error_invalid_param</link><description>Hello, 
 I have a nrf52840 project with S340, FreeRTOS, BLE and ANT+ enabled. It works fine so far. 
 Now I would like to make a new project where I copied most parts of the already working project. But now 
 sd_ant_enabled returns NRF_ERROR_INVALID_PARAM</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 May 2023 11:32:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99980/sd_ant_enable-returns-nrf_error_invalid_param" /><item><title>RE: sd_ant_enable returns NRF_ERROR_INVALID_PARAM</title><link>https://devzone.nordicsemi.com/thread/428146?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 11:32:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3d45b3b-335b-444b-9cd9-36e7fd50ec68</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;If there is anything else that you might find strange or have any further issue/questions feel free to ask here or create a new ticket and we will do our best to help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ant_enable returns NRF_ERROR_INVALID_PARAM</title><link>https://devzone.nordicsemi.com/thread/427715?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 09:16:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9689577d-8e67-477c-8074-2819da03c151</guid><dc:creator>Andreas48752</dc:creator><description>&lt;p&gt;Well, I will have to look further on this.&lt;/p&gt;
&lt;p&gt;Thank you anyway for trying to help. It is much appreciated.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ant_enable returns NRF_ERROR_INVALID_PARAM</title><link>https://devzone.nordicsemi.com/thread/427547?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 13:37:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fb49155-095f-453a-a666-d8b51df8f0c0</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;I don&amp;#39;t see anything obvious here, so currently I don&amp;#39;t have any good alternatives for debugging. Would just get back to debugging both step by step side by side to se what is going on.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ant_enable returns NRF_ERROR_INVALID_PARAM</title><link>https://devzone.nordicsemi.com/thread/426866?ContentTypeID=1</link><pubDate>Tue, 23 May 2023 11:12:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40f5194d-2023-45ca-a785-0b8c3cb05bce</guid><dc:creator>Andreas48752</dc:creator><description>&lt;p&gt;Hi Jonathan,&lt;/p&gt;
&lt;p&gt;thank you for your reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am using sdk 17.0.2.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The issue occures here:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
// Memory buffer provided in order to support channel configuration.
__ALIGN(4) static uint8_t m_ant_stack_buffer[NRF_SDH_ANT_BUF_SIZE];

static bool m_stack_is_enabled;

ret_code_t nrf_sdh_ant_enable(void)
{
    ANT_ENABLE ant_enable_cfg =
    {
        .ucTotalNumberOfChannels     = NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED,
        .ucNumberOfEncryptedChannels = NRF_SDH_ANT_ENCRYPTED_CHANNELS,
        .usNumberOfEvents            = NRF_SDH_ANT_EVENT_QUEUE_SIZE,
        .pucMemoryBlockStartLocation = m_ant_stack_buffer,
        .usMemoryBlockByteSize       = sizeof(m_ant_stack_buffer),
    };


// memset(m_ant_stack_buffer,0x00,sizeof(m_ant_stack_buffer)); // test only

    ret_code_t ret_code = sd_ant_enable(&amp;amp;ant_enable_cfg); // returns 1
    if (ret_code == NRF_SUCCESS)
    {
        m_stack_is_enabled = true;
    }
    else
    {
        NRF_LOG_ERROR(&amp;quot;sd_ant_enable() returned %s.&amp;quot;, nrf_strerror_get(ret_code));
    }

    return ret_code;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;With one project the call to &amp;quot;nrf_sdh_ant_enable&amp;quot; (nrf_sdh_ant.c) work fine the other returns an error.&lt;/p&gt;
&lt;p&gt;In both cases I called&amp;nbsp;nrf_sdh_enable_request() first.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see any difference if using the memset or not.&lt;/p&gt;
&lt;p&gt;sdk_config.h looks like that:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
//==========================================================
// &amp;lt;e&amp;gt; NRF_SDH_ANT_ENABLED - nrf_sdh_ant - SoftDevice ANT event handler
//==========================================================
#ifndef NRF_SDH_ANT_ENABLED
#define NRF_SDH_ANT_ENABLED 1
#endif
// &amp;lt;h&amp;gt; ANT Channels 

//==========================================================
// &amp;lt;o&amp;gt; NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED - Allocated ANT channels. 
#ifndef NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED
#define NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED 1
#endif

// &amp;lt;o&amp;gt; NRF_SDH_ANT_ENCRYPTED_CHANNELS - Encrypted ANT channels. 
#ifndef NRF_SDH_ANT_ENCRYPTED_CHANNELS
#define NRF_SDH_ANT_ENCRYPTED_CHANNELS 0
#endif


// &amp;lt;h&amp;gt; ANT Queues 

//==========================================================
// &amp;lt;o&amp;gt; NRF_SDH_ANT_EVENT_QUEUE_SIZE - Event queue size. 
#ifndef NRF_SDH_ANT_EVENT_QUEUE_SIZE
#define NRF_SDH_ANT_EVENT_QUEUE_SIZE 32
#endif

// &amp;lt;o&amp;gt; NRF_SDH_ANT_BURST_QUEUE_SIZE - ANT burst queue size. 
#ifndef NRF_SDH_ANT_BURST_QUEUE_SIZE
#define NRF_SDH_ANT_BURST_QUEUE_SIZE 128
#endif
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ant_enable returns NRF_ERROR_INVALID_PARAM</title><link>https://devzone.nordicsemi.com/thread/426763?ContentTypeID=1</link><pubDate>Tue, 23 May 2023 07:42:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0101fcb2-2281-47e9-8129-1da4fd438733</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Update:&lt;br /&gt;&lt;br /&gt;For debugging try setting breakpoints when&amp;nbsp;&lt;span&gt;&lt;span dir="ltr"&gt;sd_ant_enable() is called and compare the working to not working application.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;In addition using memset() first to check if it is in fact 0.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_ant_enable returns NRF_ERROR_INVALID_PARAM</title><link>https://devzone.nordicsemi.com/thread/426626?ContentTypeID=1</link><pubDate>Mon, 22 May 2023 14:24:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd1e8192-09f8-48c6-a822-844331be5a49</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;This might be of help:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/30859/how-to-expand-the-ant_config_total_channels_allocated-number"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/30859/how-to-expand-the-ant_config_total_channels_allocated-number&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I am no expert on this but can you share some more info on the version of the SDK you are using?&lt;br /&gt;&lt;br /&gt;And are you using the same HW ?&lt;br /&gt;&lt;br /&gt;Looking in to this&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>