<?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>Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83039/merge-openthread-and-radio_test-code-radio_test-test-mpsl-assert-112-2235</link><description>Port the radio_test sample to the Coprocessor sample to test the radio_test function error 
 
 How do I merge the two examples 
 I was hoping you could help me out 
 many thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Jan 2022 12:18:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83039/merge-openthread-and-radio_test-code-radio_test-test-mpsl-assert-112-2235" /><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/346168?ContentTypeID=1</link><pubDate>Wed, 05 Jan 2022 12:18:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee388dc6-ea22-4bc6-8617-58828234c880</guid><dc:creator>Ethan.Shi</dc:creator><description>&lt;p&gt;Hi Simon&lt;/p&gt;
&lt;p&gt;&lt;span&gt;To improve factory efficiency,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have checked some materials and now Timeslot can work normally. Thanks again for the suggestion of using Timeslot,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m now ready to refine the code&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;Ethan&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/346134?ContentTypeID=1</link><pubDate>Wed, 05 Jan 2022 11:42:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09262bd6-89a7-4ae8-96d4-58eabed81902</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again Ethan&lt;/p&gt;
&lt;p&gt;I&amp;#39;m struggling to see the use case you&amp;#39;re going for here. Is there a reason you need both the radio test and the co-processor application as one sample rather than having two separate applications that you flash onto the device as needed?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;According to mpsl_timeslot.h, the maximum timeslot length that can be set is 100ms. Do you need the timeslot to be longer than this during the radio testing? If so you need to extend it by requesting an extension using&amp;nbsp;&lt;strong&gt;MPSL_TIMESLOT_SIGNAL_ACTION_EXTEND&lt;/strong&gt; withing the timeslot event.&amp;nbsp;&lt;span&gt;MPSL_TIMESLOT_SIGNAL_SESSION_IDLE&amp;nbsp;indicates that the timeout session has no more pending requests and is executed in the same context as&amp;nbsp;&lt;/span&gt;mpsl_low_priority_process();&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/346023?ContentTypeID=1</link><pubDate>Wed, 05 Jan 2022 06:54:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84fa2754-4e84-4ef2-9795-0f218fec2a3e</guid><dc:creator>Ethan.Shi</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span class="skip"&gt;I&amp;#39;m&amp;nbsp;sorry，&lt;/span&gt;&lt;/em&gt;The previous description might have been confusing.&lt;span&gt;Ignore the previous code.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am currently working on merging the radio_test sample with the Coprocessor sample，I think timeslot can accomplish this task. I want to be free from the influence of OpenThread when conducting radio test.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="tgt highlight"&gt;I plan to extend timeslot to realize radio test normally. The delay process always receives the signal MPSL_TIMESLOT_SIGNAL_SESSION_IDLE and will not continue to delay.&lt;/span&gt;&lt;span class="tgt"&gt; Is there any example of extending timeslot? The other examples I refer to are too old.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="tgt"&gt;Best regards,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="tgt"&gt;Ethan&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/346021?ContentTypeID=1</link><pubDate>Wed, 05 Jan 2022 06:28:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1fc7333-8448-4a4b-84e6-42dfd8b733ff</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Ethan&lt;/p&gt;
&lt;p&gt;I need some more information on what exactly is failing in your OpenThread test, as it&amp;#39;s hard to tell what&amp;#39;s causing this error by just looking at your main file. I would suggest making the timeslots smaller however, to see if that helps at all.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/345921?ContentTypeID=1</link><pubDate>Tue, 04 Jan 2022 13:24:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e48cb09c-8bb9-444b-b5f9-b6feab7f6e58</guid><dc:creator>Ethan.Shi</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I want the RX port to always print F0，&lt;span&gt;I configured the enum transmit_pattern pattern = TRANSMIT_PATTERN_11110000 in the radio_tx function.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Today, I solved this problem with the following code, causing the OpenThread test to fail.Using the Wpantund tool to test OpenThread,&amp;nbsp;&amp;nbsp;I think this has something to do with timeslot taking up time all the time. Is there any suggestion for modification.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;kernel.h&amp;gt;
#include &amp;lt;console/console.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;lt;sys/printk.h&amp;gt;
#include &amp;lt;zephyr/types.h&amp;gt;
#include &amp;lt;irq.h&amp;gt;

#include &amp;lt;mpsl_timeslot.h&amp;gt;
#include &amp;lt;mpsl.h&amp;gt;
#include &amp;lt;hal/nrf_timer.h&amp;gt;

#include &amp;lt;shell/shell_uart.h&amp;gt;
#include &amp;lt;drivers/uart.h&amp;gt;
#include &amp;lt;init.h&amp;gt;


#define TIMESLOT_REQUEST_DISTANCE_US (1000000)
#define TIMESLOT_LENGTH_US           (20000)
#define TIMER_EXPIRY_US (TIMESLOT_LENGTH_US - 50)

#define MPSL_THREAD_PRIO             CONFIG_MPSL_THREAD_COOP_PRIO
#define STACKSIZE                    CONFIG_MAIN_STACK_SIZE
#define THREAD_PRIORITY              K_LOWEST_APPLICATION_THREAD_PRIO


extern void radio_tx(void);



static uint32_t extension_count;

/* MPSL API calls that can be requested for the non-preemptible thread */
enum mpsl_timeslot_call {
	OPEN_SESSION,
	MAKE_REQUEST,
	CLOSE_SESSION,
};

/* Timeslot requests */
static mpsl_timeslot_request_t timeslot_request_earliest = {
	.request_type = MPSL_TIMESLOT_REQ_TYPE_EARLIEST,
	//.params.earliest.hfclk = MPSL_TIMESLOT_HFCLK_CFG_NO_GUARANTEE,
    .params.normal.hfclk = MPSL_TIMESLOT_HFCLK_CFG_XTAL_GUARANTEED,
	//.params.earliest.priority = MPSL_TIMESLOT_PRIORITY_NORMAL,
    .params.normal.priority = MPSL_TIMESLOT_PRIORITY_HIGH,
	.params.earliest.length_us = TIMESLOT_LENGTH_US,
	.params.earliest.timeout_us = 1000000
};
static mpsl_timeslot_request_t timeslot_request_normal = {
	.request_type = MPSL_TIMESLOT_REQ_TYPE_NORMAL,
	//.params.normal.hfclk = MPSL_TIMESLOT_HFCLK_CFG_NO_GUARANTEE,
	.params.normal.hfclk = MPSL_TIMESLOT_HFCLK_CFG_XTAL_GUARANTEED,
    //.params.normal.priority = MPSL_TIMESLOT_PRIORITY_NORMAL,
	.params.normal.priority = MPSL_TIMESLOT_PRIORITY_HIGH,
    .params.normal.distance_us = TIMESLOT_REQUEST_DISTANCE_US,
	.params.normal.length_us = TIMESLOT_LENGTH_US
};

static mpsl_timeslot_signal_return_param_t signal_callback_return_param;

/* Message queue for printing the signal type from timeslot callback */
//K_MSGQ_DEFINE(callback_msgq, sizeof(uint32_t), 100, 4);

/* Message queue for requesting MPSL API calls to non-preemptible thread */
K_MSGQ_DEFINE(mpsl_api_msgq, sizeof(enum mpsl_timeslot_call), 10, 4);

static void error(void)
{
	printk(&amp;quot;ERROR!\n&amp;quot;);
	while (true) {
		/* Spin for ever */
		k_sleep(K_MSEC(1000));
	}
}


static mpsl_timeslot_signal_return_param_t *mpsl_timeslot_callback(
	mpsl_timeslot_session_id_t session_id,
	uint32_t signal_type)
{
        //printk(&amp;quot;sig=%d\n&amp;quot;,signal_type);
	(void) session_id; /* unused parameter */
        
	mpsl_timeslot_signal_return_param_t *p_ret_val = NULL;

	switch (signal_type) {

	case MPSL_TIMESLOT_SIGNAL_START:
		/* No return action */
                
                printk(&amp;quot;START11\n&amp;quot;);              
               // if(tx_flag==1)
               // {
                  //printk(&amp;quot;start radio_tx\n&amp;quot;);
                radio_tx();//Fixed parameter Radio tx function 
               // }
                //NRF_RADIO-&amp;gt;POWER                = (RADIO_POWER_POWER_Enabled &amp;lt;&amp;lt; RADIO_POWER_POWER_Pos);
                //NVIC_EnableIRQ(RADIO_IRQn);
                
		signal_callback_return_param.callback_action =
			MPSL_TIMESLOT_SIGNAL_ACTION_NONE;
		p_ret_val = &amp;amp;signal_callback_return_param;

		/* Setup timer to trigger an interrupt (and thus the TIMER0
		 * signal) before timeslot end.
		 */
		nrf_timer_cc_set(NRF_TIMER0, NRF_TIMER_CC_CHANNEL0,
			TIMER_EXPIRY_US);
		nrf_timer_int_enable(NRF_TIMER0, NRF_TIMER_INT_COMPARE0_MASK);

		break;
        case MPSL_TIMESLOT_SIGNAL_RADIO:
                
                break;

               
	case MPSL_TIMESLOT_SIGNAL_TIMER0:

		/* Clear event */
		
		
                /* Request new timeslot when callback returns */
                if (extension_count)
                {
                    extension_count--;
                    signal_callback_return_param.params.extend.length_us = TIMESLOT_LENGTH_US;
                    signal_callback_return_param.callback_action = MPSL_TIMESLOT_SIGNAL_ACTION_EXTEND;  //End the current timeslot and request a new one            
                }
                else
                {
                    signal_callback_return_param.callback_action = MPSL_TIMESLOT_SIGNAL_ACTION_END;  //End the current timeslot and request a new one
                }
        
                
		p_ret_val = &amp;amp;signal_callback_return_param;

		break;
        case MPSL_TIMESLOT_SIGNAL_EXTEND_FAILED:
                signal_callback_return_param.params.request.p_next = &amp;amp;timeslot_request_earliest;
                signal_callback_return_param.callback_action = MPSL_TIMESLOT_SIGNAL_ACTION_EXTEND;
                p_ret_val = &amp;amp;signal_callback_return_param;
                break;
                break;
        case MPSL_TIMESLOT_SIGNAL_EXTEND_SUCCEEDED:
                NRF_TIMER0-&amp;gt;EVENTS_COMPARE[0]=0;
                NRF_TIMER0-&amp;gt;TASKS_CLEAR = 1;
                //signal_callback_return_param.params.request.p_next = &amp;amp;timeslot_request_normal;
                signal_callback_return_param.callback_action = MPSL_TIMESLOT_SIGNAL_ACTION_EXTEND;
                p_ret_val = &amp;amp;signal_callback_return_param;
                break;
	case MPSL_TIMESLOT_SIGNAL_SESSION_IDLE:
		break;
	case MPSL_TIMESLOT_SIGNAL_SESSION_CLOSED:
		break;
	default:
		printk(&amp;quot;unexpected signal: %u&amp;quot;, signal_type);
		//error();
		break;
	}

	

	return p_ret_val;
}

void mpsl_timeslot_demo(void)
{
	int err;
	
	enum mpsl_timeslot_call api_call;


    extension_count = 1000;
	api_call = OPEN_SESSION;
	err = k_msgq_put(&amp;amp;mpsl_api_msgq, &amp;amp;api_call, K_FOREVER);
	if (err) {
		error();
	}
        
	api_call = MAKE_REQUEST;
	err = k_msgq_put(&amp;amp;mpsl_api_msgq, &amp;amp;api_call, K_FOREVER);
	if (err) {
                printk(&amp;quot;198error\n&amp;quot;);
		error();
	}

}

/* To ensure thread safe operation, call all MPSL APIs from a non-preemptible
 * thread.
 */
static void mpsl_nonpreemptible_thread(void)
{
	int err;
	enum mpsl_timeslot_call api_call = 0;

	/* Initialize to invalid session id */
	mpsl_timeslot_session_id_t session_id = 0xFFu;

	while (1) {
		if (k_msgq_get(&amp;amp;mpsl_api_msgq, &amp;amp;api_call, K_FOREVER) == 0) {
			switch (api_call) {
			case OPEN_SESSION:
				err = mpsl_timeslot_session_open(
					mpsl_timeslot_callback,
					&amp;amp;session_id);
				if (err) {
					error();
				}
				break;
			case MAKE_REQUEST:
				err = mpsl_timeslot_request(
					session_id,
					&amp;amp;timeslot_request_earliest);
				if (err) {
                                        printk(&amp;quot;237error\n&amp;quot;);
					error();
				}
				break;
			case CLOSE_SESSION:
				err = mpsl_timeslot_session_close(session_id);
				if (err) {
					error();
				}
				break;
			default:
				error();
				break;
			}
		}
	}
}


K_THREAD_DEFINE(mpsl_nonpreemptible_thread_id, STACKSIZE,
		mpsl_nonpreemptible_thread, NULL, NULL, NULL,
		K_PRIO_COOP(MPSL_THREAD_PRIO), 0, 0);&lt;/pre&gt;&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;Ethan.Shi&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/345910?ContentTypeID=1</link><pubDate>Tue, 04 Jan 2022 12:58:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91be4b9e-ff7d-456d-91e0-48805f7e4b91</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t see what the issue here is. What are you expecting to receive on the RX side here? I think having such a large timeslot might cause issues on the Thread side if there are time critical tasks to take care of, but if it&amp;#39;s only to be a thread node for example I think it should be fine.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/345836?ContentTypeID=1</link><pubDate>Tue, 04 Jan 2022 09:11:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69331768-f046-404c-b05d-a5b941e8f5c0</guid><dc:creator>Ethan.Shi</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Do you have any problems with my timeslot&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Ethan.Shi&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/345834?ContentTypeID=1</link><pubDate>Tue, 04 Jan 2022 09:08:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70d20a57-d515-401d-8560-b0d4dcb7841a</guid><dc:creator>Ethan.Shi</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is my current Timeslot code&amp;nbsp; .I wanted to keep Radio TX on for a long time, but actually testing phenomenon RX was wrong &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;kernel.h&amp;gt;
#include &amp;lt;console\console.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;lt;sys\printk.h&amp;gt;
#include &amp;lt;zephyr\types.h&amp;gt;
#include &amp;lt;irq.h&amp;gt;

#include &amp;lt;mpsl_timeslot.h&amp;gt;
#include &amp;lt;mpsl.h&amp;gt;
#include &amp;lt;hal\nrf_timer.h&amp;gt;

#include &amp;lt;shell\shell_uart.h&amp;gt;
#include &amp;lt;drivers\uart.h&amp;gt;
#include &amp;lt;init.h&amp;gt;



#define TIMESLOT_REQUEST_DISTANCE_US (1000000)
#define TIMESLOT_LENGTH_US           (20000)
#define TIMER_EXPIRY_US (TIMESLOT_LENGTH_US - 50)

#define MPSL_THREAD_PRIO             CONFIG_MPSL_THREAD_COOP_PRIO
#define STACKSIZE                    CONFIG_MAIN_STACK_SIZE
#define THREAD_PRIORITY              K_LOWEST_APPLICATION_THREAD_PRIO

extern void radio_tx(void);

static uint32_t extension_count;

/* MPSL API calls that can be requested for the non-preemptible thread */
enum mpsl_timeslot_call {
	OPEN_SESSION,
	MAKE_REQUEST,
	CLOSE_SESSION,
};

/* Timeslot requests */
static mpsl_timeslot_request_t timeslot_request_earliest = {
	.request_type = MPSL_TIMESLOT_REQ_TYPE_EARLIEST,
	//.params.earliest.hfclk = MPSL_TIMESLOT_HFCLK_CFG_NO_GUARANTEE,
    .params.normal.hfclk = MPSL_TIMESLOT_HFCLK_CFG_XTAL_GUARANTEED,
	//.params.earliest.priority = MPSL_TIMESLOT_PRIORITY_NORMAL,
    .params.normal.priority = MPSL_TIMESLOT_PRIORITY_HIGH,
	.params.earliest.length_us = TIMESLOT_LENGTH_US,
	.params.earliest.timeout_us = 1000000
};
static mpsl_timeslot_request_t timeslot_request_normal = {
	.request_type = MPSL_TIMESLOT_REQ_TYPE_NORMAL,
	//.params.normal.hfclk = MPSL_TIMESLOT_HFCLK_CFG_NO_GUARANTEE,
	.params.normal.hfclk = MPSL_TIMESLOT_HFCLK_CFG_XTAL_GUARANTEED,
    //.params.normal.priority = MPSL_TIMESLOT_PRIORITY_NORMAL,
	.params.normal.priority = MPSL_TIMESLOT_PRIORITY_HIGH,
    .params.normal.distance_us = TIMESLOT_REQUEST_DISTANCE_US,
	.params.normal.length_us = TIMESLOT_LENGTH_US
};

static mpsl_timeslot_signal_return_param_t signal_callback_return_param;

/* Message queue for printing the signal type from timeslot callback */
K_MSGQ_DEFINE(callback_msgq, sizeof(uint32_t), 10, 4);

/* Message queue for requesting MPSL API calls to non-preemptible thread */
K_MSGQ_DEFINE(mpsl_api_msgq, sizeof(enum mpsl_timeslot_call), 10, 4);

static void error(void)
{
	printk(&amp;quot;ERROR!\n&amp;quot;);
	while (true) {
		/* Spin for ever */
		k_sleep(K_MSEC(1000));
	}
}


static mpsl_timeslot_signal_return_param_t *mpsl_timeslot_callback(
	mpsl_timeslot_session_id_t session_id,
	uint32_t signal_type)
{
        printk(&amp;quot;sig=%d\n&amp;quot;,signal_type);
	(void) session_id; /* unused parameter */
        
	mpsl_timeslot_signal_return_param_t *p_ret_val = NULL;

	switch (signal_type) {

	case MPSL_TIMESLOT_SIGNAL_START:
		/* No return action */
      
        radio_tx();//Fixed parameter Radio tx function 
            
		signal_callback_return_param.callback_action =
			MPSL_TIMESLOT_SIGNAL_ACTION_NONE;
		p_ret_val = &amp;amp;signal_callback_return_param;

		/* Setup timer to trigger an interrupt (and thus the TIMER0
		 * signal) before timeslot end.
		 */
		nrf_timer_cc_set(NRF_TIMER0, NRF_TIMER_CC_CHANNEL0,
			TIMER_EXPIRY_US);
		nrf_timer_int_enable(NRF_TIMER0, NRF_TIMER_INT_COMPARE0_MASK);

		break;
        case MPSL_TIMESLOT_SIGNAL_RADIO:
                
                break;

               
	case MPSL_TIMESLOT_SIGNAL_TIMER0:

		/* Clear event */
		
                /* Request new timeslot when callback returns */
                
                if (extension_count)
                {
                    extension_count--;
                    signal_callback_return_param.params.extend.length_us = TIMESLOT_LENGTH_US;
                    signal_callback_return_param.callback_action = MPSL_TIMESLOT_SIGNAL_ACTION_EXTEND;  //End the current timeslot and request a new one         
                }
                else
                {
                    signal_callback_return_param.callback_action = MPSL_TIMESLOT_SIGNAL_ACTION_END;  //End the current timeslot and request a new one
                }
        
                
		p_ret_val = &amp;amp;signal_callback_return_param;

		break;
        case MPSL_TIMESLOT_SIGNAL_EXTEND_FAILED:
       
                break;
        case MPSL_TIMESLOT_SIGNAL_EXTEND_SUCCEEDED:
                NRF_TIMER0-&amp;gt;EVENTS_COMPARE[0]=0;
                NRF_TIMER0-&amp;gt;TASKS_CLEAR = 1;
                signal_callback_return_param.callback_action = MPSL_TIMESLOT_SIGNAL_ACTION_NONE;
                p_ret_val = &amp;amp;signal_callback_return_param;
                break;
	case MPSL_TIMESLOT_SIGNAL_SESSION_IDLE:
		break;
	case MPSL_TIMESLOT_SIGNAL_SESSION_CLOSED:
		break;
	default:
		printk(&amp;quot;unexpected signal: %u&amp;quot;, signal_type);
		error();
		break;
	}

	/* Put callback info in the message queue. */
	int err = k_msgq_put(&amp;amp;callback_msgq, &amp;amp;signal_type, K_NO_WAIT);

	if (err) {
                printk(&amp;quot;164error\n&amp;quot;);
		error();
	}

	return p_ret_val;
}

void mpsl_timeslot_demo(void)
{
	int err;
	
	enum mpsl_timeslot_call api_call;

    extension_count = 1000;
	api_call = OPEN_SESSION;
	err = k_msgq_put(&amp;amp;mpsl_api_msgq, &amp;amp;api_call, K_FOREVER);
	if (err) {
		error();
	}
        
	api_call = MAKE_REQUEST;
	err = k_msgq_put(&amp;amp;mpsl_api_msgq, &amp;amp;api_call, K_FOREVER);
	if (err) {
                printk(&amp;quot;198error\n&amp;quot;);
		error();
	}

}

/* To ensure thread safe operation, call all MPSL APIs from a non-preemptible
 * thread.
 */
static void mpsl_nonpreemptible_thread(void)
{
	int err;
	enum mpsl_timeslot_call api_call = 0;

	/* Initialize to invalid session id */
	mpsl_timeslot_session_id_t session_id = 0xFFu;

	while (1) {
		if (k_msgq_get(&amp;amp;mpsl_api_msgq, &amp;amp;api_call, K_FOREVER) == 0) {
			switch (api_call) {
			case OPEN_SESSION:
				err = mpsl_timeslot_session_open(
					mpsl_timeslot_callback,
					&amp;amp;session_id);
				if (err) {
					error();
				}
				break;
			case MAKE_REQUEST:
				err = mpsl_timeslot_request(
					session_id,
					&amp;amp;timeslot_request_earliest);
				if (err) {
                                        printk(&amp;quot;237error\n&amp;quot;);
					error();
				}
				break;
			case CLOSE_SESSION:
				err = mpsl_timeslot_session_close(session_id);
				if (err) {
					error();
				}
				break;
			default:
				error();
				break;
			}
		}
	}
}

static void console_print_thread(void)
{
	uint32_t signal_type = 0;

	while (1) {
		if (k_msgq_get(&amp;amp;callback_msgq, &amp;amp;signal_type, K_FOREVER) == 0) {
			switch (signal_type) {
			case MPSL_TIMESLOT_SIGNAL_START:
				printk(&amp;quot;Callback: Timeslot start\n&amp;quot;);
				break;
			case MPSL_TIMESLOT_SIGNAL_RADIO:
				printk(&amp;quot;Callback: radio signal\n&amp;quot;);
				break;
                        case MPSL_TIMESLOT_SIGNAL_TIMER0:
				printk(&amp;quot;Callback: Timer0 signal\n&amp;quot;);
				break;
			case MPSL_TIMESLOT_SIGNAL_SESSION_IDLE:
				printk(&amp;quot;Callback: Session idle\n&amp;quot;);
				break;
            case MPSL_TIMESLOT_SIGNAL_EXTEND_FAILED:
                    printk(&amp;quot;Callback: extend failed\n&amp;quot;);
                    break;
            case MPSL_TIMESLOT_SIGNAL_EXTEND_SUCCEEDED:
                   // printk(&amp;quot;extension_count=%d\n&amp;quot;,extension_count);
                    printk(&amp;quot;Callback: extend succeed\n&amp;quot;);
                    break;
			case MPSL_TIMESLOT_SIGNAL_SESSION_CLOSED:
				printk(&amp;quot;Callback: Session closed\n&amp;quot;);
				break;
			default:
				printk(&amp;quot;Callback: Other signal: %d\n&amp;quot;,
				       signal_type);
				break;
			}
		}
	}
}


K_THREAD_DEFINE(console_print_thread_id, STACKSIZE, console_print_thread,
		NULL, NULL, NULL, THREAD_PRIORITY, 0, 0);

K_THREAD_DEFINE(mpsl_nonpreemptible_thread_id, STACKSIZE,
		mpsl_nonpreemptible_thread, NULL, NULL, NULL,
		K_PRIO_COOP(MPSL_THREAD_PRIO), 0, 0);&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641287296431v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/345802?ContentTypeID=1</link><pubDate>Tue, 04 Jan 2022 07:46:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c36102dd-5285-49fd-8545-212d892a43d5</guid><dc:creator>Ethan.Shi</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I now comment out SYS_INIT in radio_cmd.c, that is, radio_test_init is not called&amp;nbsp; .&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641280687180v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641280929414v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;At this point, the shell echo on the emitter side is fine, but the sample code receiver receives the wrong data &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641281853141v3.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641282067744v4.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is one of my puzzles,&lt;/span&gt;Timeslot mechanism, I am trying to use it.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span class="skip"&gt;Happy New Year&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Ethan.Shi&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/345590?ContentTypeID=1</link><pubDate>Mon, 03 Jan 2022 08:54:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e471917-eac0-40d9-a0f2-467011a643f3</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry, but I don&amp;#39;t have much more specifics than that the shell module uses radio interrupts outside of the expected radio events, which is why the MPSL asserts. In order to use the radio_test functionalities you will have to port it to use timeslots instead, so that the radio has a specific time set for the radio_test to do what it&amp;#39;s supposed to without interfering with thread/MPSL.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/345081?ContentTypeID=1</link><pubDate>Mon, 27 Dec 2021 09:36:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da0041d3-6c37-4ae8-a4cd-229b514fbdba</guid><dc:creator>Ethan.Shi</dc:creator><description>&lt;p&gt;Hi&amp;nbsp; Simonr&lt;/p&gt;
&lt;p class="_tgt transPara grammarSection"&gt;&lt;span class="transSent"&gt;&lt;span&gt;The radio_test example includes shell init, which makes Openthrad not work properly, &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="_tgt transPara grammarSection"&gt;&lt;span class="transSent highlight"&gt;&lt;span&gt;I tried merging the code and found that the shell command line of audio_test was not displayed. Through testing, I found that the problem should be shell init priority.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;I am a novice, I want to know what is the specific reason of influence&lt;/p&gt;
&lt;p class="_tgt transPara grammarSection"&gt;Ethan.Shi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/344929?ContentTypeID=1</link><pubDate>Thu, 23 Dec 2021 11:49:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:199841e4-a6de-4145-818b-8691ecf99d41</guid><dc:creator>Ethan.Shi</dc:creator><description>&lt;p&gt;Thank you very much for your tip,Simonr!&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll try to fix it using TimesLots and get back to you.&lt;/p&gt;
&lt;p&gt;Ethan.Shi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/344875?ContentTypeID=1</link><pubDate>Thu, 23 Dec 2021 06:58:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17d7ad52-296d-4a2b-82ff-ccc078273946</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;This assert fails because your radio interrupts are only expected within a radio event. The radio_test is rather basic, and doesn&amp;#39;t use the radio events that MPSL expects. I think it should be possible to port the radio_test sample to use &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/mpsl/timeslot/README.html"&gt;timeslots &lt;/a&gt;instead, and make it work that way.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merge openThread and radio_test code, radio_test test MPSL assert:112,2235</title><link>https://devzone.nordicsemi.com/thread/344739?ContentTypeID=1</link><pubDate>Wed, 22 Dec 2021 08:37:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45d187a3-96c6-439f-8e70-0ec808dfc6bf</guid><dc:creator>Ethan.Shi</dc:creator><description>&lt;p&gt;&lt;span&gt;I use GPIO to control whether to enter OpenThread mode or Radio mode&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>