<?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 initializing I2C on Arduino Nano 33 BLE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77845/problem-initializing-i2c-on-arduino-nano-33-ble</link><description>I&amp;#39;m running into an issue in which I cannot initialized the I2C drivers on an Arduino Nano 33 BLE (nrf52840). The output from error logging is 
 
 I have this prj.conf file: 
 
 I have also modified the arduino_nano_33_ble.dts to enable mcu_boot and added</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Jul 2021 23:18:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77845/problem-initializing-i2c-on-arduino-nano-33-ble" /><item><title>RE: Problem initializing I2C on Arduino Nano 33 BLE</title><link>https://devzone.nordicsemi.com/thread/321910?ContentTypeID=1</link><pubDate>Mon, 26 Jul 2021 23:18:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f58a565-cc95-4454-9258-88c0e71c5693</guid><dc:creator>thanhnha</dc:creator><description>&lt;p&gt;Ok, I solved the issue. It turns out that the hardware designer of the Arduino Nano 33 BLE board uses GPIO pins as an enable pin for all the I2C sensors. The init_sensors.c file has to be change in order to accommodate for this.&lt;/p&gt;
&lt;p&gt;The original init_sensors.c file calls the initializing function board_internal_sensors_init with priority at PRE_KERNEL_1. However, this function requires the use of GPIO pins in order to work. Thus, you have to run this function after the GPIO pins are initialized. The GPIO pins are initialized during POST_KERNEL with priority number 40.&lt;/p&gt;
&lt;p&gt;However, the I2C driver is initialized at POST_KERNEL with priority number 60. So you have to pick a number between 40 and 60 to run the board_internal_sensors_init callback.&lt;/p&gt;
&lt;p&gt;I thought that would have solved everything, but it turns out the GPIO pins can&amp;#39;t quickly pull up the voltage enough. This will still cause issue when you try to initialize your I2C sensors. I added a small delay in the callback function to give enough time for the voltage to be pull up.&lt;/p&gt;
&lt;p&gt;The final sensor_init.c should be as follow.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1033.init_5F00_sensors.c"&gt;devzone.nordicsemi.com/.../1033.init_5F00_sensors.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This seems to fix everything so far.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>