<?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>Not able to initialize my ADXL355 custom driver</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110031/not-able-to-initialize-my-adxl355-custom-driver</link><description>Hi, I have been trying to initialize my driver for the adxl355. I copied almost everything from the lesson 7 exercise 1 of the nrfConnect intermediate course. For some reason, when I compile I get: undefined reference to `__device_dts_ord_132&amp;#39; Which when</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Apr 2024 14:48:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110031/not-able-to-initialize-my-adxl355-custom-driver" /><item><title>RE: Not able to initialize my ADXL355 custom driver</title><link>https://devzone.nordicsemi.com/thread/478370?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2024 14:48:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62cc3e9c-24f5-43c9-9780-bca032aa51f7</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Adrian1504"]I am not able to connect to the COM ports:&amp;nbsp;Opening COM5: Access denied.[/quote]
&lt;p&gt;This is highly likely because another process has the COM port open, and is completely separate from the firmware running on the nRF.&lt;/p&gt;
&lt;p&gt;Opening/closing a COM port is on your computer side.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Adrian1504"]&lt;br /&gt;Now I am getting this warnings, which I hope are nothing to be worried about.[/quote]
&lt;p&gt;The warnings emitted should not be ignored. They are crucial to handle in order to get the sensor up and running, as you&amp;#39;re packing the data into too small buffers/data types.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to initialize my ADXL355 custom driver</title><link>https://devzone.nordicsemi.com/thread/478224?ContentTypeID=1</link><pubDate>Thu, 11 Apr 2024 08:27:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dbac8cb-9a96-4bc8-b1e8-6484dedeedf4</guid><dc:creator>Adrian1504</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;br /&gt;&lt;br /&gt;Thank you so much for your answer, it was really helpful. Now it is building. Just to add, I also had to add in my prj.conf file CONFIG_SENSOR = y.&lt;br /&gt;&lt;br /&gt;Now I am getting this warnings, which I hope are nothing to be worried about.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;/custom_adxl355_driver/zephyr/custom_adxl355_driver_spi.c: In function &amp;#39;adxl_read_values&amp;#39;:
../custom_adxl355_driver/zephyr/custom_adxl355_driver_spi.c:30:30: warning: unsigned conversion from &amp;#39;int&amp;#39; to &amp;#39;unsigned char&amp;#39; changes value from &amp;#39;776&amp;#39; to &amp;#39;8&amp;#39; [-Woverflow]
   30 | #define ADXL355_XDATA        (ADXL355_ADDR(0x08) | SET_ADXL355_TRANSF_LEN(3))
      |                              ^
../custom_adxl355_driver/zephyr/custom_adxl355_driver_spi.c:221:27: note: in expansion of macro &amp;#39;ADXL355_XDATA&amp;#39;
  221 |         uint8_t regs[] = {ADXL355_XDATA, ADXL355_YDATA, ADXL355_ZDATA,};        //0xFF is dummy reg
      |                           ^~~~~~~~~~~~~
../custom_adxl355_driver/zephyr/custom_adxl355_driver_spi.c:31:30: warning: unsigned conversion from &amp;#39;int&amp;#39; to &amp;#39;unsigned char&amp;#39; changes value from &amp;#39;779&amp;#39; to &amp;#39;11&amp;#39; [-Woverflow]
   31 | #define ADXL355_YDATA        (ADXL355_ADDR(0x0B) | SET_ADXL355_TRANSF_LEN(3))
      |                              ^
../custom_adxl355_driver/zephyr/custom_adxl355_driver_spi.c:221:42: note: in expansion of macro &amp;#39;ADXL355_YDATA&amp;#39;
  221 |         uint8_t regs[] = {ADXL355_XDATA, ADXL355_YDATA, ADXL355_ZDATA,};        //0xFF is dummy reg
      |                                          ^~~~~~~~~~~~~
../custom_adxl355_driver/zephyr/custom_adxl355_driver_spi.c:32:30: warning: unsigned conversion from &amp;#39;int&amp;#39; to &amp;#39;unsigned char&amp;#39; changes value from &amp;#39;782&amp;#39; to &amp;#39;14&amp;#39; [-Woverflow]
   32 | #define ADXL355_ZDATA        (ADXL355_ADDR(0x0E) | SET_ADXL355_TRANSF_LEN(3))
      |                              ^
../custom_adxl355_driver/zephyr/custom_adxl355_driver_spi.c:221:57: note: in expansion of macro &amp;#39;ADXL355_ZDATA&amp;#39;
  221 |         uint8_t regs[] = {ADXL355_XDATA, ADXL355_YDATA, ADXL355_ZDATA,};        //0xFF is dummy reg
      |                                                         ^~~~~~~~~~~~~
../custom_adxl355_driver/zephyr/custom_adxl355_driver_spi.c:218:41: warning: unused variable &amp;#39;zAxis&amp;#39; [-Wunused-variable]
  218 |         float xAxis = 0.0, yAxis = 0.0, zAxis = 0.0;
      |                                         ^~~~~
../custom_adxl355_driver/zephyr/custom_adxl355_driver_spi.c:218:28: warning: unused variable &amp;#39;yAxis&amp;#39; [-Wunused-variable]
  218 |         float xAxis = 0.0, yAxis = 0.0, zAxis = 0.0;
      |                            ^~~~~
../custom_adxl355_driver/zephyr/custom_adxl355_driver_spi.c:218:15: warning: unused variable &amp;#39;xAxis&amp;#39; [-Wunused-variable]
  218 |         float xAxis = 0.0, yAxis = 0.0, zAxis = 0.0;
      |               ^~~~~
../custom_adxl355_driver/zephyr/custom_adxl355_driver_spi.c:240:25: warning: array subscript 3 is above array bounds of &amp;#39;uint8_t[3]&amp;#39; {aka &amp;#39;unsigned char[3]&amp;#39;} [-Warray-bounds]
  240 |         dataz = (readbuf[3] &amp;lt;&amp;lt; 8);
      |                  ~~~~~~~^~~
../custom_adxl355_driver/zephyr/custom_adxl355_driver_spi.c:222:17: note: while referencing &amp;#39;readbuf&amp;#39;
  222 |         uint8_t readbuf[sizeof(regs)];&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;And also, when flashing it to the board, I am not able to connect to the COM ports:&amp;nbsp;Opening COM5: Access denied.&lt;br /&gt;Is this because of the warnings I am getting?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;Thank you!&lt;br /&gt;Kind regards,&lt;br /&gt;Adri&amp;aacute;n Lopez.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to initialize my ADXL355 custom driver</title><link>https://devzone.nordicsemi.com/thread/477739?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2024 09:12:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f246bce6-1558-4f19-b634-2d3e88c00cc6</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Another thing:&lt;/p&gt;
&lt;p&gt;you might want to select both SPI and SENSOR subsys when enabling your custom driver:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;menuconfig CUSTOM_ADXL355_DRIVER
	bool &amp;quot;Support for the demonstration out of tree custom ADXL355 driver using SPI&amp;quot;
	depends on SPI
    # depends on SENSOR
    # or you can just select it
    # select SENSOR&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to initialize my ADXL355 custom driver</title><link>https://devzone.nordicsemi.com/thread/477735?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2024 09:05:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d515ace-b1ab-4aeb-83f9-2f877ec0945f</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Three things:&lt;/p&gt;
&lt;p&gt;1. rename #define DT_DRV_COMPAT adi_adxl355&lt;/p&gt;
&lt;p&gt;2. Move DT_DRV_COMPAT define to the top of the file&lt;/p&gt;
&lt;p&gt;3. your overlay file does not match any boards in zephyr. Rename to&amp;nbsp;../boards/nrf52840dk_nrf52840.overlay&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s several warnings that you should address.&lt;/p&gt;
&lt;p&gt;Could you try this and see if it works?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>