<?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>nrf52 NFC with softdevice running</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25109/nrf52-nfc-with-softdevice-running</link><description>Hi all,
Here is my first question on this forum after many hours working with the NRF but for the first time I didn&amp;#39;t found the answer :) 
 My problem is :
I would like to run the NFC in ISO/ICE 14443 Type A mode with t4t for reading and writing.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 13 Sep 2017 15:12:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25109/nrf52-nfc-with-softdevice-running" /><item><title>RE: nrf52 NFC with softdevice running</title><link>https://devzone.nordicsemi.com/thread/98884?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 15:12:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a8d017a-713f-427d-bea2-0a257faea95c</guid><dc:creator>ispare</dc:creator><description>&lt;p&gt;I think I found the source but not the solution :
In fact we need hf clock for NFC but it seems like the stack can&amp;#39;t enable it alone.
In hal_nfc_t4t.c line 954 function: nrf_nfct_field_event_handler (the one for the HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND) there is a call to nrf_drv_clock_hfclk_request which seems to be blocking call...
If I put sd_clock_hfclk_request() before my while(1) loop, nfc is working and I can get out of sd_app_evt_wait() but the hfclk is always active so I can&amp;#39;t reach my 3µA...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 NFC with softdevice running</title><link>https://devzone.nordicsemi.com/thread/98886?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 12:06:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98d03fdd-5d5e-4619-8a1b-345173bd0ab5</guid><dc:creator>ispare</dc:creator><description>&lt;p&gt;Hi Sigurd,
I reach 3µA when uart is disabled, and sleep mode is OK. But since I approach my NFC reader the consumption rises to 5mA but I&amp;#39;m still in sd_app_evt_wait()... It&amp;#39;s like something happens in the core but no event or interrupt to wakeup.
I&amp;#39;m pretty sur that I&amp;#39;m in sleep mode because my debug prints something to tell me when it wakes...
I tried to call bsp_nfc_sleep_mode_prepare() but nothing changed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 NFC with softdevice running</title><link>https://devzone.nordicsemi.com/thread/98885?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 11:31:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19287930-ef7b-41ba-9bbe-62b56bb51d40</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you seen the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v13.0.0%2Fnfc_wake_on_nfc.html&amp;amp;resultof=%22wake_on_nfc%22%20"&gt;Wake on NFC Example&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Take a look at the &lt;code&gt;bsp_nfc_sleep_mode_prepare()&lt;/code&gt; function.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So I initialized NFC as usual but
since I go to sleep with
&amp;quot;sd_app_evt_wait&amp;quot; it doesn&amp;#39;t wake up
when I try to use NFC but the power
consumption rise up to 5mA instead of
3µA before approaching the smartphone.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You are getting 5mA in sleep mode? and by disabling UART0 you get 3µA?&lt;/p&gt;
&lt;p&gt;Could it be that you are not actually entering sleep mode when the UART0 is enabled, or that you are immediately waking up from sleep mode when UART0 is enabled? And since you have not configured NFC correctly as a wakeup-source, you are only able to use the NFC when UART0 is running(i.e. when you are not in sleep mode) ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 NFC with softdevice running</title><link>https://devzone.nordicsemi.com/thread/98887?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 09:30:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30f767fc-4711-4875-bb9b-c0fa54219cbd</guid><dc:creator>ispare</dc:creator><description>&lt;p&gt;If I put a comment on nrf_uart_disable(NRF_UART0); so UART0 stays enable,
It wakes up and get out of sd_app_evt_wait(), same behaviour if I replace sd_app_evt_wait() with __WFI();
But what&amp;#39;s the link between UART and NFC ? no idea...&lt;/p&gt;
&lt;p&gt;Anyway, this solution is not acceptable because of power consumption...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 NFC with softdevice running</title><link>https://devzone.nordicsemi.com/thread/98883?ContentTypeID=1</link><pubDate>Wed, 13 Sep 2017 08:34:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4d4ee3d-9626-4ea6-b69a-d4f1e6bade06</guid><dc:creator>ispare</dc:creator><description>&lt;p&gt;I think I have an answer for my first problem (nfc_lib stops working properly) :
Seems that the define HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND helps solving the problem. It&amp;#39;s enabled by default when using BOARD_PCA10040 but since I&amp;#39;m on a custom board I had to add it in my own sdk_config.h.&lt;/p&gt;
&lt;p&gt;But still my second problem is there, I can&amp;#39;t wake up from sd_app_evt_wait() with NFC field.
After many tries, if I comment my Sys_Sleep it works but what I&amp;#39;m doing in here is only disabling UART0 to reach 3µA consumption
CODE :&lt;/p&gt;
&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code&gt;	nrf_uart_int_disable(NRF_UART0, NRF_UART_INT_MASK_RXDRDY | NRF_UART_INT_MASK_TXDRDY | NRF_UART_INT_MASK_ERROR | NRF_UART_INT_MASK_RXTO);
   	nrf_drv_common_irq_disable(nrf_drv_get_IRQn(NRF_UART0));
	nrf_uart_disable(NRF_UART0);
	nrf_uart_txrx_pins_disconnect(NRF_UART0);
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;Please let me know if you have any idea on this strange behavior...&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;EDIT :
After many tries and research, I found that it was question of timming.
In fact, NFC lib and SoftDevice callback seems to be very sensitive.
I had a pulling printf in sys_evt_dispatch callback. Because it was printing on UART at 9600bds I think NFC timming and lib was not guaranteed so it went wrong (I suppose)...
Now all seems to be OK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52 NFC with softdevice running</title><link>https://devzone.nordicsemi.com/thread/98882?ContentTypeID=1</link><pubDate>Tue, 12 Sep 2017 17:19:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee834ac0-ab1d-46ac-a3de-3b4ed554b5f6</guid><dc:creator>ispare</dc:creator><description>&lt;p&gt;Just to complete, I&amp;#39;m using NRF52832 and SDK 13.0.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>