<?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>Problem with Out of Tree Driver Build</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114541/problem-with-out-of-tree-driver-build</link><description>I have been banging my head against this wall for a long time now. I am trying to add support for the NAU7802 sensor based on this repository: https://github.com/TinNotTim/nau7802_loadcell_zephyr_driver/blob/main/Kconfig 
 I am using the latest 2.7.0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Sep 2024 15:17:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114541/problem-with-out-of-tree-driver-build" /><item><title>RE: Problem with Out of Tree Driver Build</title><link>https://devzone.nordicsemi.com/thread/502166?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2024 15:17:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24b928ed-38c3-41e6-ba9f-ae234185bbb0</guid><dc:creator>zciwor</dc:creator><description>&lt;p&gt;I was able to figure this out but only by digging deep into the Zephyr Discord. I was missing a `Zephyr` folder in my `drivers` subdirectory with the following `module.yaml`:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;name: NAU7802_LOADCELL
build:
  cmake: .
  kconfig: Kconfig
  settings:
    dts_root: .&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I then had to update my CMakeLists.txt to the following (note the list(APPEND...) line):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cmake_minimum_required(VERSION 3.20.0)

list(APPEND ZEPHYR_EXTRA_MODULES &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/drivers&amp;quot;)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(nau7802-test-delete-me)

target_sources(app PRIVATE src/main.c)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I created a stand alone &lt;a href="https://github.com/ubiqueIoT/zephyr-out-of-tree-driver-nau7802"&gt;Github repository&lt;/a&gt; with the example that now compiles.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Out of Tree Driver Build</title><link>https://devzone.nordicsemi.com/thread/501894?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2024 11:29:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54b0835d-4148-498b-bbab-b17c2d7e550c</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;From the logs you shared, the specific error is an undefined reference to &lt;code&gt;__device_dts_ord_110&lt;/code&gt;, which typically means that the linker can&amp;#39;t find a symbol that should be defined in the device tree or its associated source files. I recommend following the &lt;a href="https://docs.zephyrproject.org/latest/build/dts/troubleshooting.html"&gt;Zephyr guide on troubleshooting the device tree &lt;/a&gt;and checking if any of the steps mentioned will resolve the issue. Please let me know the update.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Out of Tree Driver Build</title><link>https://devzone.nordicsemi.com/thread/501742?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2024 12:45:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4142aa74-20b1-4f9d-bf3f-338271058572</guid><dc:creator>zciwor</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry, please see updated .zip file. This contains a sample build that fails with the following error:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[167/172] Linking C executable zephyr/zephyr_pre0.elf
FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /Users/ericpietrowicz/firmware/nau7802-test-delete-me/build/zephyr/zephyr_pre0.map 
: &amp;amp;&amp;amp; ccache /opt/nordic/ncs/toolchains/f8037e9b83/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc  -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -fuse-ld=bfd  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/Users/ericpietrowicz/firmware/nau7802-test-delete-me/build/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/picolibc/liblib__libc__picolibc.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/soc/soc/nrf52840/libsoc__nordic.a  zephyr/drivers/usb/device/libdrivers__usb__device.a  zephyr/drivers/usb/common/nrf_usbd_common/libdrivers__usb__common__nrf_usbd_common.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/hwinfo/libdrivers__hwinfo.a  zephyr/drivers/i2c/libdrivers__i2c.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/regulator/libdrivers__regulator.a  zephyr/drivers/sensor/nordic/temp/libdrivers__sensor__nordic__temp.a  zephyr/drivers/sensor/st/lsm6dsl/libdrivers__sensor__st__lsm6dsl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/spi/libdrivers__spi.a  zephyr/drivers/timer/libdrivers__timer.a  modules/nrf/drivers/hw_cc3xx/lib..__nrf__drivers__hw_cc3xx.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L&amp;quot;/opt/nordic/ncs/toolchains/f8037e9b83/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m/nofp&amp;quot;  -L/Users/ericpietrowicz/firmware/nau7802-test-delete-me/build/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -mtp=soft  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  -Wl,-no-pie  -DPICOLIBC_LONG_LONG_PRINTF_SCANF  /opt/nordic/ncs/v2.7.0/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m4/soft-float/no-interrupts/libnrf_cc310_platform_0.9.19.a  --specs=picolibc.specs  -lc  -lgcc &amp;amp;&amp;amp; cd /Users/ericpietrowicz/firmware/nau7802-test-delete-me/build/zephyr &amp;amp;&amp;amp; /opt/nordic/ncs/toolchains/f8037e9b83/Cellar/cmake/3.21.0/bin/cmake -E true
/opt/nordic/ncs/toolchains/f8037e9b83/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: app/libapp.a(main.c.obj): in function `main&amp;#39;:
/Users/ericpietrowicz/firmware/nau7802-test-delete-me/src/main.c:21: undefined reference to `__device_dts_ord_110&amp;#39;
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/f8037e9b83/bin/cmake --build /Users/ericpietrowicz/firmware/nau7802-test-delete-me/build&lt;/pre&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6406.nau7802_2D00_test_2D00_delete_2D00_me.zip"&gt;devzone.nordicsemi.com/.../6406.nau7802_2D00_test_2D00_delete_2D00_me.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with Out of Tree Driver Build</title><link>https://devzone.nordicsemi.com/thread/501728?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2024 12:26:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae57053c-0bad-4dc8-bc2f-36fa90ae0c5d</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Could you please share the exact error message you&amp;#39;re encountering while building? The snippet you provided doesn&amp;#39;t give much insight into the issue you&amp;#39;re facing. If possible, try attaching the entire build log here. You can use the &amp;quot;Insert&amp;quot; tab to do that.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>