<?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>SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127250/spi-slave-needs-rtt-debug-connection-to-work</link><description>Hello, 
 We use the nrfx spis driver for communication between a ST processor (master) and a Fanstel BT840 module (nRF52840). 
 We have upgraded ncs from 2.6.0 to 3.2.1 and ran into a problem. The nRF52840 must now have a debugger (RTT) connected for</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Mar 2026 15:30:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127250/spi-slave-needs-rtt-debug-connection-to-work" /><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/563601?ContentTypeID=1</link><pubDate>Wed, 18 Mar 2026 15:30:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab9da996-10a8-4f8d-a517-848507bb4ca2</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;&lt;span&gt;Ok thanks for confirming. I think there must be another explanation for why it is not working in your application. I still find it very strange that it works fine when the chip is in debug interface mode, but not in constant latency mode. From the cases I can recall where something worked in debug interface mode but not in low power mode, it would also work in constant latency mode. Using my test sample also confirms that the SPIS is behaving according to the specification. Suggestions for further troubleshooting: 1. Read out the peripheral registers from both projects do see if there are any differences in the configuration. 2. if possible, measure the sleep current of the nRF52840 alone to confirm that the chip stays in constant latency mode.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/563556?ContentTypeID=1</link><pubDate>Wed, 18 Mar 2026 12:13:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:469c4b0e-39a3-474f-992d-65b0f9edc944</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;We are using the nrfx_spis.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/563554?ContentTypeID=1</link><pubDate>Wed, 18 Mar 2026 12:06:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09fa7313-cdf7-4357-8d16-06d10572c034</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;It should not make any difference.&amp;nbsp;Which API are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/563553?ContentTypeID=1</link><pubDate>Wed, 18 Mar 2026 12:00:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab88c482-ede4-4886-8bf1-aae8dbd55b13</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;I have tried the example (&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8030.spis_5F00_test.zip"&gt;8030.spis_test.zip&lt;/a&gt;), and it works, but it is using the blocking version of the SPIS driver.&lt;/p&gt;
&lt;p&gt;We are using the non-blocking version.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/563198?ContentTypeID=1</link><pubDate>Fri, 13 Mar 2026 10:52:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7af5ddc4-e265-46f3-b8c4-c94cd88ba6d3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I finally got around to test this, but I did not manage to reproduce the issue where the SPIS is not even responding with DEF.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here with&amp;nbsp;&lt;span&gt;CSN to CLK time set to 1 us:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/4111.pastedimage1773398735312v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;And same at 0.3 us:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/3250.pastedimage1773398894461v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Setup:&lt;/p&gt;
&lt;p&gt;- nRF52840 DK as SPI Slave&lt;/p&gt;
&lt;p&gt;- nRF Connect SDK v3.2.1&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8030.spis_5F00_test.zip"&gt;devzone.nordicsemi.com/.../8030.spis_5F00_test.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/562892?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2026 09:17:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5e98419-2b1f-4ff8-8cb8-c2fd5289849f</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;I have added a high resolution timer to the ST bootloader now, so I can set the CS to first clock pulse more accurate. It actually seems like the limit for SPIS is at about 2us.&amp;nbsp;I have measured the timing more accurate when SPIS fails as well, and this is actually 1.3us.&lt;/p&gt;
&lt;p&gt;I have tested a bit with delay at 3us now, and this seems to work fine.&lt;/p&gt;
&lt;p&gt;1.3us works fine in ncs 2.6.0, but not in ncs 3.2.0, so something has happened.&lt;/p&gt;
&lt;p&gt;I have tested the 3us delay on the unmodified SPI slave firmware (before&amp;nbsp;&lt;span&gt;requesting HFXO and constant latency mode changes was applied), and this works fine. So the problem has nothing with this do do. Only thing we see is that RTT connection resolves the problem.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/562829?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2026 14:01:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53d5d328-e6df-4b55-94eb-dfa49c9d47b2</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;&lt;span&gt;Thanks for confirming. I have not been able to find any other reports that seem similar to what you are observing. I will continue to investigate on my end. Please let me know if there is any progress on your end.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/562643?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2026 12:58:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63ee361e-0c30-4aa8-bcfd-15a56fece87e</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;The DEF is configured this way:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;spis_config&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;orc&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;0xaa&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;spis_config&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;def&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;0x55&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;so none of these.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;We have tried to extend the CS delay in the bootloader. We used 1ms since then we could use an existing timer. Then SPIS runs fine.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/562642?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2026 12:44:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfb14293-12b3-424a-975c-6696339738e3</guid><dc:creator>Vidar Berg</dc:creator><description>[quote userid="17713" url="~/f/nordic-q-a/127250/spi-slave-needs-rtt-debug-connection-to-work/562637"]There is no activity on MISO when SPIS fails.[/quote]
&lt;p&gt;It&amp;#39;s probably responding with the&amp;nbsp;default DEF character (0x0)&lt;/p&gt;
[quote userid="17713" url="~/f/nordic-q-a/127250/spi-slave-needs-rtt-debug-connection-to-work/562426"]bootloader on the ST is also immutable, so it can only be updated via SWI interface.[/quote]
&lt;p&gt;Had you also tried modifying the bootloader so only the CS delay is extended? That might help narrow down the problem.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/562637?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2026 12:26:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2003b492-f926-471f-b188-e62f01e2a00f</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;RTT logging is setup this way, both when SPIS fails (RTT disconnected) and when SPIS succeeds (RTT connected):&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;# Logging&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_LOG&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#CONFIG_USE_SEGGER_RTT=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;#CONFIG_LOG_BACKEND_RTT=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_LOG_MODE_IMMEDIATE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_LOG_BACKEND_UART&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_UART_CONSOLE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_CONSOLE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SERIAL&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Here are some plots:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;SPI fail. No debug connection:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/SPI_2D00_fails.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;SPI OK, RTT connected:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/SPI_2D00_success.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There is no activity on MISO when SPIS fails.&lt;/p&gt;
&lt;p&gt;Only difference between these captures are that the first is with RTT not connected, and the last is with RTT connected.&lt;/p&gt;
&lt;p&gt;Debug output backend is the same in both cases.&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/562607?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2026 07:13:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b7d387a-1c3b-4372-9bfc-a46e9eaca78e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Is the RTT logger backend disabled at this point?&lt;/p&gt;
[quote user="janarildroyneberg"]Also when the ST firmware is run normally (not in DFU mode), SPI runs flawlessly. But then we have about 18us delay between CS and first clock pulse.[/quote]
&lt;p&gt;Have you probed the bus lines with a logic analyzer or scope to confirm that the longer CS delay is the only difference, or are there other potentially relevant differences as well, such as longer delays between transfers? And is the SPIS clocking out anything on MISO?&lt;/p&gt;
&lt;p&gt;The transfer from the stm&amp;nbsp;will also be ignored if the semaphore is not released in time, see:&amp;nbsp;&lt;a style="font-family:inherit;" href="https://docs.nordicsemi.com/bundle/ps_nrf52840/page/spis.html#ariaid-title4"&gt;https://docs.nordicsemi.com/bundle/ps_nrf52840/page/spis.html#ariaid-title4&lt;/a&gt;&lt;span style="font-family:inherit;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/562451?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2026 14:18:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:246dfa46-14b4-4cdb-b99e-1d86cda76535</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;We have set the log output to be on the UART. The SPI slave still fails with this, and there is no error messages in log.&lt;/p&gt;
&lt;p&gt;We have added a log output in the&amp;nbsp;spis_handler (only &amp;quot;.&amp;quot;) for each time&amp;nbsp;&lt;span&gt;spis_handler&amp;nbsp;is entered, and the only thing we see is that this disappear (spis_handler&amp;nbsp;is not called anymore) when SPIS fails. No error messages are seen.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also when the ST firmware is run normally (not in DFU mode), SPI runs flawlessly. But then we have about 18us delay between CS and first clock pulse.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;SPI fails immediately or after a couple of messages when the ST enters DFU. In DFU mode the delay is 2us.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;But no error messages as we can see.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/562440?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2026 13:52:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41777287-3422-4c98-85a8-a84810f3946a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I&amp;#39;m surprised that requesting HFXO and constant latency mode both yield the same result. With constant latency enabled, the CS delay should work down to 1 us. Since you are getting the same with HFXO enabled, I don&amp;#39;t think the issue is that const latency mode is not enabled. Is it possible to attach with RTT after the failed DFU to capture any crash or debug information from the RTT buffer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/562426?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2026 13:11:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:627eb6a4-0028-449e-bb0c-b284f1985550</guid><dc:creator>janR</dc:creator><description>&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;We have tried the&amp;nbsp;&lt;span&gt;nrf_sys_event_request_global_constlat(), but this unfortunately does not change anything. SPI still fails with CS - first clock pulse at 2us.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also tried this:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/85fef3ca6680d73aa1e68169cb0d45f859a43f3c/samples/peripheral/radio_test/src/main.c#L11"&gt;https://github.com/nrfconnect/sdk-nrf/blob/85fef3ca6680d73aa1e68169cb0d45f859a43f3c/samples/peripheral/radio_test/src/main.c#L11&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This also did not work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We are using the nRF52 Fanstel module (SPI slave) to do FOTA on the ST processor, so the best solution will be to have a&amp;nbsp; fix for the nRF52, as this problem makes it impossible to update the ST firmware via FOTA. The bootloader on the ST is also immutable, so it can only be updated via SWI interface.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It is possible to update the ST firmware via SWI, but with considerable more work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What can be the reason for nrf_sys_event_request_global_constlat() to not work?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards, Jan&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SPI slave needs RTT debug connection to work</title><link>https://devzone.nordicsemi.com/thread/562410?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2026 11:07:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95d1eee2-e8df-47a9-a12d-b34e80076ae5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hei Jan,&lt;/p&gt;
&lt;p&gt;A delay of 2 us will only work if the HF clock is already running. Otherwise, you need a longer startup time (10 us should provide plenty of margin) to allow the HFINT to ramp up in time to sample the input.&lt;/p&gt;
&lt;p&gt;When you connect the RTT viewer, the chip is put&amp;nbsp;into debug interface mode, which prevents it from entering lower power saving modes. Like with&amp;nbsp;constant latency sub power mode, the HFINT is forced to stay on in idle. Other peripherals, such as the UART receiver, will&amp;nbsp;also keep the HF clock running while the system is idle when they are enabled.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]Any other workaround than delay between CS and first clock pulse?[/quote]
&lt;p&gt;For battery operated devices it is generally best to extend the CS delay when possible as this results in a considerably&amp;nbsp;lower&amp;nbsp;sleep current (~2 ua vs ~500 uA). If you want to enable&amp;nbsp;constant latency as a workaround, please to so via the&amp;nbsp;nrf_sys_event_request_global_constlat()/nrf_sys_event_release_global_constlat() APIs. These are reference counted and ensures that constant latency cannot be turned off by other SDK modules. API&amp;nbsp;is included in the build&amp;nbsp;with&amp;nbsp;&lt;span&gt;CONFIG_NRF_SYS_EVENT&lt;/span&gt;&lt;span&gt;=y.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>