<?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>Radio stops working after disable softdevice. No receiver interrupts.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112806/radio-stops-working-after-disable-softdevice-no-receiver-interrupts</link><description>nRF51822QFAC SDK v10 S130 
 In the completed project it was necessary to make an update. It is necessary to switch off the softdevice and switch to its own Rx protocol. After performing the standard shutdown procedure, Radio interrupts stop coming. All</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 09 Jul 2024 17:05:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112806/radio-stops-working-after-disable-softdevice-no-receiver-interrupts" /><item><title>RE: Radio stops working after disable softdevice. No receiver interrupts.</title><link>https://devzone.nordicsemi.com/thread/493027?ContentTypeID=1</link><pubDate>Tue, 09 Jul 2024 17:05:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba296407-ae02-40e6-b095-a128f89414e5</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;I ran the case through a couple of people more knowledgeable.&amp;nbsp;One tried to reproduce your issue but couldn&amp;#39;t. Interrupts work as expected.&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/pastedimage1720544411790v1.png" alt=" " /&gt;&lt;/p&gt;
[quote user="sevstels"]We&amp;#39;re not talking about yours API. We are saying that other companies&amp;#39; stacks do not support Timeslot. Therefore, it&amp;#39;s useless. The second device we have is running on the TI stack. And it doesn&amp;#39;t. It&amp;#39;s not in the BLE standard at all.[/quote]
&lt;p&gt;We are not sure you understand the Timeslot API correctly. It is just there to&amp;nbsp;tell the application when the radio is free, so that the application can implement another protocol without&amp;nbsp;radio-usage conflict with the SoftDevice.&lt;/p&gt;
&lt;p&gt;Therefore, if you disable all BLE functionalities, the Timeslot API should basically let you do anything, as if the SoftDevice isn&amp;#39;t there.&lt;/p&gt;
&lt;p&gt;But in any cases, even with the SoftDevice disabled, we cannot reproduce your issue.&lt;/p&gt;
&lt;p&gt;Do you have a minimal project where the issue can be reproduced?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio stops working after disable softdevice. No receiver interrupts.</title><link>https://devzone.nordicsemi.com/thread/492830?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 20:23:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:446c3c19-1442-45fa-b005-50a5f274c96e</guid><dc:creator>sevstels</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt;I honestly am not very well versed at the very low-level interrupt and vector table handling topic and also not experienced with the IAR environment either.&amp;nbsp;Thus, please&amp;nbsp;overlook it if my questions were obvious.&lt;/p&gt;
&lt;p&gt;Hmm... sounds like a battle against common sense! So as not to waste your time. I&amp;#39;d like the advice of someone who knows how this works. Do you have any such experts? Thank you. I&amp;#39;m not asking because I want your secrets. I want this piece of *** to work right.&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;Could you elaborate why Timeslot API does not work?&lt;/p&gt;
&lt;p&gt;We&amp;#39;re not talking about yours API. We are saying that other companies&amp;#39; stacks do not support Timeslot. Therefore, it&amp;#39;s useless. The second device we have is running on the TI stack. And it doesn&amp;#39;t. It&amp;#39;s not in the BLE standard at all.&lt;/p&gt;
&lt;p&gt;I get along fine without Timeslot using my own protocol. And I transmit synchro through a normal BLE channel. The only thing I need is that the Softdevice does not spoil the work of the radio when switched off. Make my job easier. Tell me the address where the forwarder is. And I&amp;#39;ll give it a hard hack to make it work right.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio stops working after disable softdevice. No receiver interrupts.</title><link>https://devzone.nordicsemi.com/thread/492828?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 20:13:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52862278-f9be-4109-b93c-ec06c5530256</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Was this line an indication that the SoftDevice has been re-enabled at this point, or was it for some other use in your application?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;SoftDev_enabled = softdevice_handler_isEnabled();&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Have you tried running only&amp;nbsp;softdevice_handler_init() or&amp;nbsp;sd_softdevice_enable(), and then&amp;nbsp;sd_softdevice_vector_table_base_set() to see if the interrupt forwarding works?&lt;/p&gt;
[quote user="sevstels"]Timeslot API will not working here . Because the connection is established via a standard BLE dongle, where there is no access to code changes.[/quote]
&lt;p&gt;I am a little confused about this statement. Could you elaborate why Timeslot API does not work? It is used to implement multiprotocol co-existence in the nRF5 SDK. In your opening post, you wrote:&lt;/p&gt;
[quote user=""]It is necessary to switch off the softdevice and switch to its own Rx protocol.[/quote]
&lt;p&gt;The timeslot API will let the application run a proprietary RX protocol. If BLE is not necessary, the application can simply&amp;nbsp;turn off all BLE activities, and not worry about disabling the SoftDevice.&lt;/p&gt;
&lt;p&gt;Besides the example I linked, please also see the docs:&amp;nbsp;&lt;a title="This section describes the calls, events, signals, and return actions of the Radio Timeslot API." href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.sds/dita/softdevices/s130/concurrent_multiprotocol_tsl_api/radio_tsl_api.html"&gt;Radio Timeslot API&lt;/a&gt;.&lt;/p&gt;
[quote user="sevstels"]How can I view the integrity of the code for forwarding with the IAR disassembler debugger? Could you please tell me which code does it at which addresses?[/quote]
&lt;p&gt;Do you want to see the SoftDevice forwarding the interrupt? I am afraid&amp;nbsp;debugging the SoftDevice is not possible, as it is proprietary, and we don&amp;#39;t release source code or .elf files.&lt;/p&gt;
&lt;p&gt;I honestly am not very well versed at the very low-level interrupt and vector table handling topic and also not experienced with the IAR environment either.&amp;nbsp;Thus, please&amp;nbsp;overlook it if my questions were obvious.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio stops working after disable softdevice. No receiver interrupts.</title><link>https://devzone.nordicsemi.com/thread/492808?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 17:42:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d56bfc6-2709-491b-b0e2-51e1792e52f5</guid><dc:creator>sevstels</dc:creator><description>&lt;p&gt;Timeslot API will not working here . Because the connection is established via a standard BLE dongle, where there is no access to code changes. So when switching to Timeslot another node breaks the connection. About&amp;nbsp;of the vector table transfer. I stop all interrupts before transferring by the function sd_softdevice_vector_table_base_set(). Clear all pending ones. I check it visually in debugger in NVIC registers settings. Everything is restored as it was before using the stack. Then I reinitialise and enable the interrupts used in the program. All of them work fine except Radio. It doesn&amp;#39;t come in.&amp;nbsp; Even running the stack once breaks the reception irrevocably.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;error = softdevice_handler_sd_disable();
APP_ERROR_CHECK(error); //no err

SoftDev_enabled = softdevice_handler_isEnabled();

//----
NVIC_DisableIRQ(RADIO_IRQn);
NVIC_ClearPendingIRQ(RADIO_IRQn);

NVIC_DisableIRQ(TIMER0_IRQn);
NVIC_ClearPendingIRQ(TIMER0_IRQn);

NVIC_DisableIRQ(TIMER1_IRQn);
NVIC_ClearPendingIRQ(TIMER1_IRQn);

NVIC_DisableIRQ(TIMER2_IRQn);
NVIC_ClearPendingIRQ(TIMER2_IRQn);

NVIC_DisableIRQ(RTC0_IRQn);
NVIC_ClearPendingIRQ(RTC0_IRQn);

NVIC_DisableIRQ(RTC1_IRQn);
NVIC_ClearPendingIRQ(RTC1_IRQn);

NVIC_DisableIRQ(UART0_IRQn);
NVIC_ClearPendingIRQ(UART0_IRQn);

NVIC_DisableIRQ(SPI1_TWI1_IRQn);
NVIC_ClearPendingIRQ(SPI1_TWI1_IRQn);

NVIC_DisableIRQ(ADC_IRQn);
NVIC_ClearPendingIRQ(ADC_IRQn);

// NVIC-&amp;gt;ICER[0] = 0xffffffff;

error = sd_softdevice_vector_table_base_set(0x1C000);
APP_ERROR_CHECK(error); //no error

//then init application irq and run..&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Interrupts initially arrive at the beginning of the original vectors address in the memory begin. If there is no code there that throws them into the application&amp;#39;s interrupt section, they will not arrive. I suspect that the interrupt transfer for Radio is defective. Or something corrupts the code that does the forwarding during stack shutdown.&lt;/p&gt;
&lt;p&gt;How can I view the integrity of the code for forwarding with the IAR disassembler debugger? Could you please tell me which code does it at which addresses?&lt;/p&gt;
&lt;p&gt;I tried disabling stack interrupts before shutting it down. But it causes softdevice_handler_sd_disable() execution error; This is a very strange way of doing it. And judging by the number of problems other people have with disabling it, it is done crookedly.&lt;/p&gt;
&lt;p&gt;Checked the projects you linked to as an example. There are no softdevice_handler_sd_disable() calls anywhere; Therefore, these examples are about other things and do not fit my case.&lt;/p&gt;
&lt;p&gt;Probably a tested example where a softdevice_handler_sd_disable() call is made will help me. And then the radio is re-initialised and it works after that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Radio stops working after disable softdevice. No receiver interrupts.</title><link>https://devzone.nordicsemi.com/thread/492633?ContentTypeID=1</link><pubDate>Mon, 08 Jul 2024 08:44:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5544870-2faf-45e7-83ee-d344e273039e</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi sevstels,&lt;/p&gt;
&lt;p&gt;sd_softdevice_vector_table_base_set() is documented as &amp;quot;forwarding&amp;quot; interrupts to application, so it could be that the forwarding functionality&amp;nbsp;stops working when the SoftDevice is disabled.&lt;/p&gt;
&lt;p&gt;I suspect that you can start getting the interrupts again if you enable the SoftDevice again, but not the BLE stack. Could you please try this?&lt;/p&gt;
&lt;p&gt;Alternatively, you can also configure the RADIO interrupt on your own, independent of the SoftDevice.&lt;/p&gt;
&lt;p&gt;By the way, the intended way to add a proprietary protocol alongside BLE is to use the Timeslot API. It seems in nRF51 SDK v10.0.0, the API isn&amp;#39;t fully mature yet, but there is still an example for it here, if you want to try:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk51.v10.0.0/ble_sdk_radio_time_slot_api.html"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk51.v10.0.0/ble_sdk_radio_time_slot_api.html&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>