<?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>Hard fault when calling nrf_drv_twi_tx(). nRF52832.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58996/hard-fault-when-calling-nrf_drv_twi_tx-nrf52832</link><description>I&amp;#39;m trying to use an MMA8652FC accelerometer with the nRF52832. When I call the function nrf_drv_twi_tx() the board hard faults, stopping in &amp;lt;SDK&amp;gt;\components\libraries\util\app_error_weak.c line 100. I&amp;#39;m not sure what is happening and I don&amp;#39;t get any</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 17 Mar 2020 10:27:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58996/hard-fault-when-calling-nrf_drv_twi_tx-nrf52832" /><item><title>RE: Hard fault when calling nrf_drv_twi_tx(). nRF52832.</title><link>https://devzone.nordicsemi.com/thread/240211?ContentTypeID=1</link><pubDate>Tue, 17 Mar 2020 10:27:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e210509-bf84-4df1-b181-2ea4409a0075</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="ConnorOsborn"]They stay high.&amp;nbsp; I have tried P0.09, P0.10 and P019, P0.20[/quote]
&lt;p&gt;&amp;nbsp;P0.09 and P0.10 is the NFC pins. P0.19 and P0.20 are normally connected to LEDs on the DK, which can be problematic when you&amp;#39;re trying to sink current (ie: then driving the pin to GND), so I would recommend that you try a GPIO that is unused, like P0.23 and P0.24. Flip over the DK, and you can see which pins are currently in use.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try this and see if it starts working?&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: Hard fault when calling nrf_drv_twi_tx(). nRF52832.</title><link>https://devzone.nordicsemi.com/thread/240139?ContentTypeID=1</link><pubDate>Mon, 16 Mar 2020 21:31:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cc7ef2e-b794-4ba7-85ca-8d9ec644d20c</guid><dc:creator>ConnorOsborn</dc:creator><description>&lt;p&gt;After I switch the handle&amp;nbsp; to NULL I still get the same issue.&amp;nbsp; I would assume I should see something on the bus and clk happening but it always stays high on the scope.&amp;nbsp; I have check that I am using the correct pins as well.&lt;/p&gt;
&lt;p&gt;Edit: When I load up the twi_sensor example, I still see no change on SDA or SCL.&amp;nbsp; They stay high.&amp;nbsp; I have tried P0.09, P0.10 and P019, P0.20&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hard fault when calling nrf_drv_twi_tx(). nRF52832.</title><link>https://devzone.nordicsemi.com/thread/239866?ContentTypeID=1</link><pubDate>Mon, 16 Mar 2020 06:58:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7663226-065f-42f0-9b33-62763fe3cb2d</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="ConnorOsborn"]&amp;lt;error&amp;gt; app: ERROR 17 [NRF_ERROR_BUSY] at :0[/quote]
&lt;p&gt;&amp;nbsp;The nrf_drv_twi has been configured in non-blocking mode (ie: by providing a handler to the nrf_drv_twi_init() function), and the result is that the previous TWI bus transaction isn&amp;#39;t finished yet when you&amp;#39;re calling the next one. Since the library functions you&amp;#39;re using assumes blocking, I would recommend that you init the driver in blocking mode:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;err_code = nrf_drv_twi_init(&amp;amp;m_twi, &amp;amp;twi_MMA8652FC_config, NULL, NULL);&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: Hard fault when calling nrf_drv_twi_tx(). nRF52832.</title><link>https://devzone.nordicsemi.com/thread/239813?ContentTypeID=1</link><pubDate>Fri, 13 Mar 2020 21:16:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:458934db-3666-4596-bee5-d5f79a6441d9</guid><dc:creator>ConnorOsborn</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It never returns to the function, so I do not know the error code.&lt;br /&gt;And yes, I verified the address in the data sheet.&amp;nbsp; It couldn&amp;#39;t have been changed because it states it is factory set and to have a different address it must be requested.&lt;/p&gt;
&lt;p&gt;I have debug output now.&amp;nbsp; I get this:&lt;br /&gt;&amp;lt;info&amp;gt; app: Debug logging for UART over RTT started.&lt;br /&gt;&amp;lt;info&amp;gt; app: Connected&lt;br /&gt;&amp;lt;info&amp;gt; app: Data len is set to 0xF4(244)&lt;br /&gt;&amp;lt;error&amp;gt; app: ERROR 17 [NRF_ERROR_BUSY] at :0&lt;br /&gt;PC at: 0x00000000&lt;br /&gt;&amp;lt;error&amp;gt; app: End of error report&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hard fault when calling nrf_drv_twi_tx(). nRF52832.</title><link>https://devzone.nordicsemi.com/thread/239649?ContentTypeID=1</link><pubDate>Fri, 13 Mar 2020 07:53:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad4c493e-8f57-4326-823a-25712907f936</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=""]&amp;nbsp; &amp;nbsp; err_code = nrf_drv_twi_tx(&amp;amp;m_twi, MMA8652FC_ADDR, caddr, sizeof *caddr, true); // &amp;lt;-- Crash in this function&lt;br /&gt;&amp;nbsp; &amp;nbsp; APP_ERROR_CHECK(err_code);[/quote]
&lt;p&gt;What is the returned error code? Have you ensured that you have the correct address?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>