<?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>SPIM could not enter spi_xfer_handler function when app timer is used.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56629/spim-could-not-enter-spi_xfer_handler-function-when-app-timer-is-used</link><description>Hi, 
 
 Good day! 
 In our application, we are using the SPI protocol to communicate with the LED driver. For a graphic effect like text scroll on the screen, we used nrf_delay_ms() function but this is blocking the CPU time. So we decided to go with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 17 Jan 2020 13:47:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56629/spim-could-not-enter-spi_xfer_handler-function-when-app-timer-is-used" /><item><title>RE: SPIM could not enter spi_xfer_handler function when app timer is used.</title><link>https://devzone.nordicsemi.com/thread/229634?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2020 13:47:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:611b9dd9-400f-44b3-839e-1bb1c2bb7eaa</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The different modules of the nRF52832 runs on a certain interrupt priority, this priority can be configured in the sdk_config file of the project. The interrupt model is documented &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/processor_avail_interrupt_latency/processor_avail_interrupt_latency.html?cp=4_5_2_0_15"&gt;here&lt;/a&gt;.It&amp;#39;s also important to note that each peripheral has assigned an &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/memory.html?cp=4_2_0_7_3#topic"&gt;instantiation ID&lt;/a&gt; which indicates which resources the peripheral is using. You can&amp;#39;t therefore use two peripherals that has the same ID. Using multiple instances of the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__app__timer.html?resultof=%22%61%70%70%22%20%22%74%69%6d%65%72%22%20"&gt;app timer module&lt;/a&gt; is fine. SDK16 has a new improved version of the app timer which can be imported to an older SDK by following the guide &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/migration.html?cp=7_1_1_8_2_1#migr_dfu_libs_app_timer"&gt;here&lt;/a&gt;. The first thing that you need to ensure is that you use instances of the peripherals that doesn&amp;#39;t use the same resources. Then you could proceed to merge examples from the SDK that use the peripherals that you&amp;#39;re going to use. &lt;a href="https://github.com/NordicPlayground/nRF52-ADC-examples/tree/sdk_15.2.0_migration/ble_app_uart__saadc_timer_driven__scan_mode"&gt;Here &lt;/a&gt;is an demo that use the SAADC and UART. Note, the demo is an unsupported project.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPIM could not enter spi_xfer_handler function when app timer is used.</title><link>https://devzone.nordicsemi.com/thread/229402?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 12:27:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:903a2f9d-cb2f-4102-97bf-36bba38ea5c1</guid><dc:creator>AimHigh</dc:creator><description>&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Update:&lt;/span&gt; Found a post on Nordic devzone, it says this could happen due to the interrupt nesting, deadlock effect. I was able to solve this by setting SPI task priority in sdk_config.h file to value 3, while an app_timer config priority to value 7. This has solved the issue.&lt;/p&gt;
&lt;p&gt;And we have got few other modules in our application, for example, we use a capacitive touch interface with nrf52832 and it requires an app timer to differentiate between the 3 seconds long touch or 8-second long touch.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So, I got a few queries here in regard to the implementation part of different peripheral interfaces.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. Kindly share some resources which could explain interrupt nesting in nrf52832.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. Can I use multiple app_timer instances to deal with the led screen driver which uses SPI and capacitive touch sensor which uses TWI?&lt;/p&gt;
&lt;p&gt;Or Just use one app_timer instance and use multiple counters?&lt;/p&gt;
&lt;p&gt;3. We also have Li-Ion battery SMBus com fon charge controller, Li-Ion voltage and current sense over the SAADC, So please share some insights on how to interface all such modules so that they can work all work in sync.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kindly share the related resources.&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;Aim High.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>