<?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>compile lsm6dso example for a nrf5340</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107169/compile-lsm6dso-example-for-a-nrf5340</link><description>I&amp;#39;m trying to compile the lsm6dso example for a nrf5340. I also tried the nrf52832, but I get the same error. 
 v2.4.2\zephyr\samples\sensor\lsm6dso 
 prj.conf: 
 
 CONFIG_STDOUT_CONSOLE =y 
 CONFIG_I2C =y 
 CONFIG_SENSOR =y 
 CONFIG_LSM6DSO_TRIGGER_GLOBAL_THREAD</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Feb 2025 20:37:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107169/compile-lsm6dso-example-for-a-nrf5340" /><item><title>RE: compile lsm6dso example for a nrf5340</title><link>https://devzone.nordicsemi.com/thread/524163?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 20:37:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:432ffab6-0b99-402e-a03d-7d273be6b3be</guid><dc:creator>ReginaA101</dc:creator><description>&lt;p&gt;I am getting the same problem, have you ever figured it out?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: compile lsm6dso example for a nrf5340</title><link>https://devzone.nordicsemi.com/thread/502812?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2024 16:53:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5912486c-6962-454c-9da6-6d33eb8d2255</guid><dc:creator>devangs33</dc:creator><description>&lt;p&gt;I tried the same example with nRF52840DK with a custom overlay, and I wrote this line. Code builds and flashed, but I get an error &amp;quot;Cannot set sampling frequency for accelerometer.&amp;quot; when I use&amp;nbsp;STEVAL-MKI196V1.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define imu_node DT_NODELABEL(imu)
static const struct i2c_dt_spec dev_imu = I2C_DT_SPEC_GET(imu_node);

const struct device *const dev = dev_imu.bus;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: compile lsm6dso example for a nrf5340</title><link>https://devzone.nordicsemi.com/thread/464242?ContentTypeID=1</link><pubDate>Mon, 15 Jan 2024 15:40:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47063443-3291-4bef-98e6-6d8ee2f808ce</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I think you get this error because it can&amp;#39;t find any driver for the device.&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t find any driver implementation for&amp;nbsp;&lt;span&gt;LSM6DSO32, although it has a devicetree definition, and there seems to be no reference to this in the Kconfig reference.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Adding &amp;quot;&lt;/span&gt;&lt;span&gt;CONFIG_LSM6DSO&lt;/span&gt;&lt;span&gt;=y&amp;quot; in the prj.conf, chanding DT overlay to &amp;quot;&lt;/span&gt;&lt;span&gt;compatible&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;quot;st,lsm6dso&amp;quot;&lt;/span&gt;&lt;span&gt;;&amp;quot; and changing main() to &amp;quot;&lt;/span&gt;&lt;span&gt;DEVICE_DT_GET_ONE&lt;/span&gt;&lt;span&gt;(st_lsm6dso);&amp;quot; resolves the build errors on my end, but I do not have the device to test if the application works with these changes.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: compile lsm6dso example for a nrf5340</title><link>https://devzone.nordicsemi.com/thread/464027?ContentTypeID=1</link><pubDate>Sat, 13 Jan 2024 00:50:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fe9253d-263d-480b-927f-aa8603020c37</guid><dc:creator>mej7000</dc:creator><description>&lt;p&gt;Thanks! I made progress programming directly with I2C. I tried switching devices to the LSM6DSO32 and using the Zephry sample. I almost got it work, but if fails here:&lt;/p&gt;
&lt;p&gt;const struct device *const dev = DEVICE_DT_GET_ONE(st_lsm6dso32); //compile error&lt;/p&gt;
&lt;p&gt;I am new to Zephyr. I thought I set everything up correctly, but I am missing something. Can you take a look at my attached to see if it&amp;#39;s something obvious?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/mej558/lsm6dso_7.git"&gt;https://github.com/mej558/lsm6dso_7.git&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int main(void)
{
	const struct device *const dev = DEVICE_DT_GET_ONE(st_lsm6dso32);
	// const struct device *const dev = NULL; // this compiles...

	if (!device_is_ready(dev)) {
		printk(&amp;quot;%s: device not ready.\n&amp;quot;, dev-&amp;gt;name);
		return 0;
	}

#ifdef CONFIG_LSM6DSO_TRIGGER
	printf(&amp;quot;Testing LSM6DSO sensor in trigger mode.\n\n&amp;quot;);
	test_trigger_mode(dev);
#else
	printf(&amp;quot;Testing LSM6DSO sensor in polling mode.\n\n&amp;quot;);
	test_polling_mode(dev);
#endif
	return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;[156/156] Generating ../bin/tfm_s.bin&lt;br /&gt;[15/220] Performing install step for &amp;#39;tfm&amp;#39;&lt;br /&gt;-- Install configuration: &amp;quot;MinSizeRel&amp;quot;&lt;br /&gt;[213/220] Linking C executable zephyr\zephyr_pre0.elf&lt;br /&gt;FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map&lt;br /&gt;cmd.exe /C &amp;quot;cd . &amp;amp;&amp;amp; C:\ncs\toolchains\c57af46cb7\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr\zephyr_pre0.elf -fuse-ld=bfd -T zephyr/linker_zephyr_pre0.cmd -Wl,-Map=C:/nrf/lsm6dso_7/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/aarch32/libarch__arm__core__aarch32.a zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a zephyr/arch/arch/arm/core/aarch32/cortex_m/cmse/libarch__arm__core__aarch32__cortex_m__cmse.a zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a zephyr/lib/libc/picolibc/liblib__libc__picolibc.a zephyr/lib/libc/common/liblib__libc__common.a zephyr/soc/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a zephyr/subsys/random/libsubsys__random.a zephyr/drivers/clock_control/libdrivers__clock_control.a zephyr/drivers/console/libdrivers__console.a zephyr/drivers/entropy/libdrivers__entropy.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/i2c/libdrivers__i2c.a zephyr/drivers/pinctrl/libdrivers__pinctrl.a zephyr/drivers/serial/libdrivers__serial.a zephyr/drivers/timer/libdrivers__timer.a modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a modules/nrf/subsys/nrf_security/src/zephyr/libmbedtls_zephyr.a modules/nrf/modules/tfm/zephyr/libtfm_api_nrf.a modules/trusted-firmware-m/libtfm_api.a modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj -L&amp;quot;c:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v8-m.main/nofp&amp;quot; -LC:/nrf/lsm6dso_7/build/zephyr -lgcc zephyr/arch/common/libisr_tables.a tfm/secure_fw/s_veneers.o -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_DOUBLE_PRINTF_SCANF modules/nrf/subsys/nrf_security/src/libmbedcrypto.a C:/ncs/v2.5.1/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/soft-float/liboberon_mbedtls_3.0.13.a modules/nrf/subsys/nrf_security/src/libmbedcrypto_base.a -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee C:/ncs/v2.5.1/nrfxlib/crypto/nrf_oberon/lib/cortex-m33/soft-float/liboberon_3.0.13.a --specs=picolibc.specs -lc -lgcc &amp;amp;&amp;amp; cmd.exe /C &amp;quot;cd /D C:\nrf\lsm6dso_7\build\zephyr &amp;amp;&amp;amp; C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.exe -E true&amp;quot;&amp;quot;&lt;br /&gt;c:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(main.c.obj): in function `z_impl_sensor_channel_get&amp;#39;:&lt;br /&gt;C:/ncs/v2.5.1/zephyr/include/zephyr/drivers/sensor.h:767: undefined reference to `__device_dts_ord_128&amp;#39;&lt;br /&gt;c:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(main.c.obj): in function `test_polling_mode&amp;#39;:&lt;br /&gt;C:\nrf\lsm6dso_7\build/../src/main.c:101: undefined reference to `__device_dts_ord_128&amp;#39;&lt;br /&gt;collect2.exe: error: ld returned 1 exit status&lt;br /&gt;ninja: build stopped: subcommand failed.&lt;br /&gt;FATAL ERROR: command exited with status 1: &amp;#39;C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE&amp;#39; --build &amp;#39;C:\nrf\lsm6dso_7\build&amp;#39;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: compile lsm6dso example for a nrf5340</title><link>https://devzone.nordicsemi.com/thread/463124?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2024 12:07:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f6b4870-77f3-4078-b628-b92d126956df</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It seems you get this error because the sensor device is not defined in the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.1/zephyr/build/dts/index.html"&gt;devicetree&lt;/a&gt; for the target that you are building for. Not all samples in Zephyr are created for Nordic boards, so you need to define the sensor yourself and assign it to one of the i2c/spi nodes. I would recommend you to go through the nRF Connect SDK Fundamentals tutorial to learn how this is done, specifically &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-6-serial-com-i2c/"&gt;lesson 6&lt;/a&gt; is directly relevant to your problem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The shield used in the lesson 6, exercise 1&amp;nbsp;contains&amp;nbsp;the sensor you are trying to use, so you should be able to use a &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.4.99-ncs1-1/boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay#L46-L51"&gt;similar devicetree definition&lt;/a&gt; for the nRF5340/nRF52832 boards as well.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>