<?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>SDK 15.2 SAADC functions undefined?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41827/sdk-15-2-saadc-functions-undefined</link><description>Hi all, 
 
 I currently need to implement 3 channels of analog inputs on my nrf52, but when I attempt to compile the project, I get the following errors: 
 
 undefined reference to `nrfx_saadc_buffer_convert&amp;#39; 
 undefined reference to `nrfx_saadc_init</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 05 Oct 2020 20:18:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41827/sdk-15-2-saadc-functions-undefined" /><item><title>RE: SDK 15.2 SAADC functions undefined?</title><link>https://devzone.nordicsemi.com/thread/273059?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2020 20:18:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a34b9aa-c394-4ae6-ae94-c29a4a152733</guid><dc:creator>sschumac</dc:creator><description>&lt;p&gt;THANK YOU&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 15.2 SAADC functions undefined?</title><link>https://devzone.nordicsemi.com/thread/176556?ContentTypeID=1</link><pubDate>Sat, 16 Mar 2019 18:32:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efccf77a-b708-4c77-b210-42d49e75b61f</guid><dc:creator>mbards</dc:creator><description>&lt;p&gt;Never mind. I was missing an include in my MakeFile&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Source files common to all targets
SRC_FILES += \
  $(PROJ_DIR)/Src/battery.c \
  $(PROJ_DIR)/Src/tension.c \
  $(PROJ_DIR)/Src/temperature.c \
  $(SDK_ROOT)/components/ble/ble_services/ble_nus/ble_nus.c \
  $(SDK_ROOT)/components/ble/ble_link_ctx_manager/ble_link_ctx_manager.c \
  $(SDK_ROOT)/modules/nrfx/drivers/src/nrfx_saadc.c \ --------Was missing this&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 15.2 SAADC functions undefined?</title><link>https://devzone.nordicsemi.com/thread/176552?ContentTypeID=1</link><pubDate>Sat, 16 Mar 2019 14:01:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57d1b01e-8de9-4b10-974d-9ad481910571</guid><dc:creator>mbards</dc:creator><description>&lt;p&gt;I am having the same problem, but setting both NRFX_SAADC_ENABLED and SAADC_ENABLED has not helped me.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Error: &lt;pre class="ui-code" data-mode="text"&gt;_build/nrf52832_xxaa/battery.c.o: In function `nrf_drv_saadc_init&amp;#39;:
c:\Users\Michael\Documents\rStrap\nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_hts\pca10040\s132\armgcc/../../../../../../integration/nrfx/legacy/nrf_drv_saadc.h:134: undefined reference to `nrfx_saadc_init&amp;#39;
collect2.exe: error: ld returned 1 exit status
make: *** [_build/nrf52832_xxaa.out] Error 1
make: Leaving directory `c:/Users/Michael/Documents/rStrap/nRF5_SDK_15.2.0_9412b96/examples/ble_peripheral/ble_app_hts/pca10040/s132/armgcc&amp;#39;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;battery.c function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;battery.h&amp;quot;
#include &amp;quot;nrf_drv_saadc.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;nrf_log.h&amp;quot;

uint8_t ReadBatteryLevel()
{
    return 0;
}

#define ADC_REF_VOLTAGE_IN_MILLIVOLTS  600  //!&amp;lt; Reference voltage (in milli volts) used by ADC while doing conversion.
#define DIODE_FWD_VOLT_DROP_MILLIVOLTS 270  //!&amp;lt; Typical forward voltage drop of the diode (Part no: SD103ATW-7-F) that is connected in series with the voltage supply. This is the voltage drop when the forward current is 1mA. Source: Data sheet of &amp;#39;SURFACE MOUNT SCHOTTKY BARRIER DIODE ARRAY&amp;#39; available at www.diodes.com.
#define ADC_RES_10BIT                  1024 //!&amp;lt; Maximum digital value for 10-bit ADC conversion.
#define ADC_PRE_SCALING_COMPENSATION   6    //!&amp;lt; The ADC is configured to use VDD with 1/3 prescaling as input. And hence the result of conversion is to be multiplied by 3 to get the actual value of the battery voltage.
#define ADC_RESULT_IN_MILLI_VOLTS(ADC_VALUE) \
   ((((ADC_VALUE) *ADC_REF_VOLTAGE_IN_MILLIVOLTS) / ADC_RES_10BIT) * ADC_PRE_SCALING_COMPENSATION)

static void saadc_event_handler(nrf_drv_saadc_evt_t const * p_evt) {}

void BatteryADCInit(void)
{
    ret_code_t err_code;
    err_code = nrf_drv_saadc_init(NULL, saadc_event_handler);
    APP_ERROR_CHECK(err_code);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;SDK Config:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;e&amp;gt; NRFX_SAADC_ENABLED - nrfx_saadc - SAADC peripheral driver
//==========================================================
#ifndef NRFX_SAADC_ENABLED
#define NRFX_SAADC_ENABLED 1
#endif
// &amp;lt;o&amp;gt; NRFX_SAADC_CONFIG_RESOLUTION  - Resolution

// &amp;lt;e&amp;gt; SAADC_ENABLED - nrf_drv_saadc - SAADC peripheral driver - legacy layer
//==========================================================
#ifndef SAADC_ENABLED
#define SAADC_ENABLED 1
#endif
// &amp;lt;o&amp;gt; SAADC_CONFIG_RESOLUTION  - Resolution&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 15.2 SAADC functions undefined?</title><link>https://devzone.nordicsemi.com/thread/162753?ContentTypeID=1</link><pubDate>Thu, 20 Dec 2018 23:12:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6a0ce82-bbd0-4525-9a7d-3ecd1d55c129</guid><dc:creator>Matthew</dc:creator><description>&lt;p&gt;Found the problem. in sdk_config.h, setting NRFX_SAADC_ENABLED to 1 does nothing unless you also set SAADC_ENABLED to 1 as they are linked in apply_old_config.h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK 15.2 SAADC functions undefined?</title><link>https://devzone.nordicsemi.com/thread/162751?ContentTypeID=1</link><pubDate>Thu, 20 Dec 2018 22:52:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30c72083-38a1-4044-ac85-b71cd051f800</guid><dc:creator>Matthew</dc:creator><description>&lt;p&gt;It looks like the main problem is the functions in the nrf_drv_saadc.h file can&amp;#39;t locate the definitions from nrfx_saadc.h. This makes no sense to me as they are clearly defined and I have t nrfx_saadc.h, nrfx_saadc.c, and nrf_drv_saadc.h in the same folder as main.c and have added them into the Application folder.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>