<?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>questions about go into the interruption handle function</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69560/questions-about-go-into-the-interruption-handle-function</link><description>Hi Nordic, 
 I am testing the sensor LSM9DS1 with the nrf52840. I try to make one pin attach to handle the interruption for the FIFO full interrupt.The FIFO handling function is&amp;quot;uint8_t read_out_FIFO_float(void)&amp;quot; in line No.41 to No.53. But I find in</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Dec 2020 11:24:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69560/questions-about-go-into-the-interruption-handle-function" /><item><title>RE: questions about go into the interruption handle function</title><link>https://devzone.nordicsemi.com/thread/285592?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2020 11:24:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:575a7923-e35b-4991-93ca-ed6a8fa558ec</guid><dc:creator>liuluan1984</dc:creator><description>&lt;p&gt;It is&amp;nbsp;&lt;span&gt;priority&amp;nbsp; issue, now the problem has been fixed&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: questions about go into the interruption handle function</title><link>https://devzone.nordicsemi.com/thread/285438?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 17:10:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc34881d-9f0f-4da7-8ca1-f67a21a52d93</guid><dc:creator>liuluan1984</dc:creator><description>&lt;p&gt;I think both the IRQ &lt;span&gt;priority&amp;nbsp;are at 6&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;#ifndef GPIOTE_CONFIG_IRQ_PRIORITY&lt;br /&gt;#define GPIOTE_CONFIG_IRQ_PRIORITY 6&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;#ifndef SPI_IRQ_PRIORITY&lt;br /&gt;#define SPI_IRQ_PRIORITY 6&lt;br /&gt;#endif&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My guessing is the GPIO interruption conflicts with the SPI function, make the SPI stops working&lt;/p&gt;
&lt;p&gt;I have tested also with&amp;nbsp;&lt;span&gt;IRQ priorities: SPI = 1, GPIOTE = 3, still same problem&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: questions about go into the interruption handle function</title><link>https://devzone.nordicsemi.com/thread/285435?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 16:39:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52f84295-205d-4e12-b7cc-4d0222110233</guid><dc:creator>liuluan1984</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Here is the initial code for the interruption, I am not sure for the the&amp;nbsp;&lt;span&gt;priority level&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;static void interrupt_pin_init(void)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code;&lt;/p&gt;
&lt;p&gt;err_code = nrf_drv_gpiote_init();&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;//nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);&lt;/p&gt;
&lt;p&gt;//err_code = nrf_drv_gpiote_out_init(PIN_OUT, &amp;amp;out_config);&lt;br /&gt; //APP_ERROR_CHECK(err_code);&lt;br /&gt; //GPIOTE_CONFIG_IN_SENSE_LOTOHI //GPIOTE_RAW_CONFIG_IN_SENSE_LOTOHI&lt;br /&gt; nrf_drv_gpiote_in_config_t in_config =GPIOTE_CONFIG_IN_SENSE_LOTOHI(true);// GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);&lt;br /&gt; in_config.pull = NRF_GPIO_PIN_PULLDOWN;//NRF_GPIO_PIN_PULLUP;&lt;/p&gt;
&lt;p&gt;err_code = nrf_drv_gpiote_in_init(PIN_INTERRUPT, &amp;amp;in_config, in_pin_handler);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;nrf_drv_gpiote_in_event_enable(PIN_INTERRUPT, true);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here is the code for the spi init&lt;/p&gt;
&lt;p&gt;void spi_init(void)&lt;br /&gt;{ &lt;br /&gt; /* 初始化SPI0 */&lt;br /&gt; nrf_drv_spi_config_t spi_config = NRF_DRV_SPI_DEFAULT_CONFIG;&lt;br /&gt; spi_config.ss_pin = SPI_SS_PIN;//nRF52832只能使用GPIO作为片选，所以这个单独定义了SPI CS管脚&lt;br /&gt; spi_config.miso_pin = SPI_MISO_PIN;&lt;br /&gt; spi_config.mosi_pin = SPI_MOSI_PIN;&lt;br /&gt; spi_config.sck_pin = SPI_SCK_PIN;&lt;br /&gt; spi_config.frequency = NRF_DRV_SPI_FREQ_4M;&lt;br /&gt; nrf_gpio_cfg_output(IMU_CS_M_PIN); &lt;br /&gt; nrf_gpio_cfg_output(IMU_CS_AG_PIN);&lt;br /&gt; nrf_gpio_cfg_output(IMU_POWER_PIN);&lt;br /&gt; &lt;br /&gt; nrf_gpio_pin_set(IMU_CS_M_PIN); &lt;br /&gt; nrf_gpio_pin_set(IMU_CS_AG_PIN);&lt;br /&gt; nrf_gpio_pin_clear(IMU_POWER_PIN); &lt;br /&gt; APP_ERROR_CHECK(nrf_drv_spi_init(&amp;amp;spi, &amp;amp;spi_config, spi_event_handler, NULL));&lt;br /&gt; //nrf_delay_ms(600);&lt;br /&gt; //nrf_gpio_pin_clear(IMU_POWER_PIN);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: questions about go into the interruption handle function</title><link>https://devzone.nordicsemi.com/thread/285414?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 15:49:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bab482d-5830-478d-90aa-b5a13e664ae4</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Which priority is the GPIOTE interrupt running at? If&amp;nbsp;&lt;span&gt;lsm9ds1_fifo_data_level_get&amp;nbsp;have some blocking call waiting for a lower (or equal) priority event it will cause a deadlock/loop.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: questions about go into the interruption handle function</title><link>https://devzone.nordicsemi.com/thread/285398?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 15:29:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3beb6117-e236-4bb4-a3b2-352e01df6f64</guid><dc:creator>liuluan1984</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When I run&amp;nbsp;&lt;span&gt;lsm9ds1_fifo_data_level_get without the interruption part, it works fine. I have tested this.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: questions about go into the interruption handle function</title><link>https://devzone.nordicsemi.com/thread/285388?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 15:04:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe1f6677-f4a5-4618-9289-1859c2f9a873</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;What happens inside&amp;nbsp;lsm9ds1_fifo_data_level_get? Is the code stuck somewhere inside that function, or is there some error/HardFault?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: questions about go into the interruption handle function</title><link>https://devzone.nordicsemi.com/thread/285361?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 14:04:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d2c444e-6423-460f-942c-031bcedcd703</guid><dc:creator>liuluan1984</dc:creator><description>&lt;div class="author eye-protector-processed"&gt;
&lt;div class="avatar"&gt;&lt;a class="internal-link view-user-profile eye-protector-processed" href="https://devzone.nordicsemi.com/members/liuluan1984"&gt;&lt;img alt="liuluan1984" border="0px" src="https://devzone.nordicsemi.com/cfs-filesystemfile/__key/communityserver-components-imagefileviewer/system-images/anonymous.gif_2D00_88x88x2.png?_=637367235477900375" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="meta eye-protector-processed"&gt;&lt;span class="qa-votes eye-protector-processed"&gt;&lt;/span&gt;&lt;span class="user-name"&gt;&lt;span class="ui-userpresence ui-tip present"&gt;Online&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a class="internal-link view-user-profile eye-protector-processed" href="https://devzone.nordicsemi.com/members/liuluan1984"&gt;liuluan1984&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;a class="internal-link view-post navigable reply-permalink eye-protector-processed" href="https://devzone.nordicsemi.com/f/nordic-q-a/69560/questions-about-go-into-the-interruption-handle-function/285355#285355"&gt;&lt;span class="ui-agodate ui-tip eye-protector-processed"&gt;5 minutes ago&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="content full threaded-reply-content user-defined-markup"&gt;
&lt;div class="content"&gt;
&lt;p&gt;Hi, If I put&amp;nbsp;&lt;strong&gt;lsm9ds1_fifo_data_level_get(&amp;amp;dev_ctx_imu, &amp;amp;unread_size);&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;into the&amp;nbsp;&lt;span&gt;in_pin_handler(), the code will stuck, it will only print &amp;quot;I&amp;quot; of the&amp;nbsp;&lt;strong&gt;printf(&amp;quot;INTC\n&amp;quot;);nrf_delay_ms(1);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If I remove the&amp;nbsp;&amp;nbsp;&lt;strong&gt;lsm9ds1_fifo_data_level_get(&amp;amp;dev_ctx_imu, &amp;amp;unread_size);&amp;nbsp;&lt;/strong&gt;, it will print out INTC from the&amp;nbsp;&lt;strong&gt;printf(&amp;quot;INTC\n&amp;quot;);nrf_delay_ms(1);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: questions about go into the interruption handle function</title><link>https://devzone.nordicsemi.com/thread/285321?ContentTypeID=1</link><pubDate>Wed, 16 Dec 2020 12:56:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:007a5c5d-b371-4bfc-9973-b8a0f5b44528</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Is any of the code in&amp;nbsp;read_out_FIFO_float() executed? The function call seems to be commented out from&amp;nbsp;in_pin_handler(). If the function is executed, is&amp;nbsp;DEBUG_FIFO_SIZE_INSIDE defined somewhere?&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>