<?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>Custom board I2C, device_is_ready() failing with init_res == 5</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83753/custom-board-i2c-device_is_ready-failing-with-init_res-5</link><description>Hello Devzone Community, 
 I am facing a run time, peripheral or sensor initialization error in a Zephyr based app, built using sdk-nrf v1.6.1, and its corresponding Zephyr RTOS release 2.6.0. More specifically, I am having trouble porting a firmware</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Jan 2022 06:27:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83753/custom-board-i2c-device_is_ready-failing-with-init_res-5" /><item><title>RE: Custom board I2C, device_is_ready() failing with init_res == 5</title><link>https://devzone.nordicsemi.com/thread/348167?ContentTypeID=1</link><pubDate>Tue, 18 Jan 2022 06:27:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64cf7c18-2d92-47e2-b2bd-9fee8bcb8f1d</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello again Devzone,&lt;/p&gt;
&lt;p&gt;In an unusual turn I have found the root cause soon after posting here, of our Zephyr based firmware on custom board returning *sensor-&amp;gt;state-&amp;gt;initialized = true, and *sensor-&amp;gt;state-&amp;gt;init_res = 5.&amp;nbsp; While I created most of the required custom board DTS and Kconfig files, I missed [custom_board_name].yaml.&amp;nbsp; Poor mistake on my part.&amp;nbsp; I also did not see direct mention of this .yaml file or its purpose in the general Device Tree how-to readings, nor Kconfig tutorials and explanatory notes.&lt;/p&gt;
&lt;p&gt;The custom board .yaml file contains the following:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;identifier: custom-board-name&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;name: Custom-Board-Name-Non-Secure&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;type: mcu &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;arch: arm &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;toolchain:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt; - gnuarmemb&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt; - zephyr&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;ram: 128 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;flash: 256 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt;supported:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new, courier;"&gt; - i2c&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The first two stanzas are all that I modified.&amp;nbsp; These appear to be free-form strings.&amp;nbsp; The last line caught my eye, as it was the I2C device which it felt like Zephyr was reporting to have a general I/O error.&amp;nbsp; Somehow it looks like `supported:&amp;nbsp; - i2c` is necessary in this .yaml file in addition to the app&amp;#39;s prj.conf file which includes the line `CONFIG_I2C=y`.&lt;/p&gt;
&lt;p&gt;One thing that is strange, the RAM and FLASH sizes here are smaller than what&amp;#39;s specified in Nordic nRF9160 documentation.&amp;nbsp; Those docs say that the application processor, an ARM Cortex-M33 has 256kB static RAM and 1024kB program flash.&amp;nbsp; I wonder why these differ?&lt;/p&gt;
&lt;p&gt;It is okay for Nordic Semi engineers to close this ticket.&amp;nbsp; Our firmware is largely ported to a custom board with this fix.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>