<?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>How to modify the advertisement packet content in the radio notification callback interrupt?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115696/how-to-modify-the-advertisement-packet-content-in-the-radio-notification-callback-interrupt</link><description>你好！ 
 我使用 NCS 2.5.0，radio_notification，无线电处理程序。 
 
 
 
 
 
 
 我想在每次启动天线时递增，并将 的值写入通告数据包。 i i 
 在函数 中，调用 会导致开发板每次崩溃。 radio_handler bt_le_ext_adv_set_data 
 
 
 
 
 
 
 你能帮我吗？ 
 
 
 错误信息如下： 
 *** Booting nRF Connect SDK v2.5.0 *** Starting Bluetooth multiple</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 23 Oct 2024 09:23:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115696/how-to-modify-the-advertisement-packet-content-in-the-radio-notification-callback-interrupt" /><item><title>RE: How to modify the advertisement packet content in the radio notification callback interrupt?</title><link>https://devzone.nordicsemi.com/thread/507530?ContentTypeID=1</link><pubDate>Wed, 23 Oct 2024 09:23:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93fc2085-9ece-4352-b78d-0c3f8a5295d7</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Allen&lt;/p&gt;
&lt;p&gt;I&amp;#39;d recommend checking out how the &lt;strong&gt;bt_le_ext_adv_set_data&lt;/strong&gt;() function is set in other samples as I don&amp;#39;t think it&amp;#39;s generally a good idea to have it within an interrupt callback which usually is very timing sensitive. In I.E. the Distance measurement sample, the&amp;nbsp;&lt;strong&gt;&lt;span&gt;bt_le_ext_adv_set_data()&lt;/span&gt;&lt;/strong&gt;&amp;nbsp;function is called within the adv_start() function initially, and then within an adv_update_data() function if the advertising set data needs to be updated during runtime. Also note that&amp;nbsp;&lt;em&gt;&amp;quot;when updating the advertising data while advertising the advertising&amp;nbsp;data and scan response data length must be smaller or equal to what&amp;nbsp;can be fit in a single advertising packet. Otherwise the a&lt;/em&gt;&lt;span&gt;&lt;em&gt;dvertiser must be stopped.&amp;quot;&lt;/em&gt; (from &lt;strong&gt;bluetooth.h&lt;/strong&gt; in&lt;strong&gt;&amp;nbsp;...\zephyr\include\zephyr\bluetooth\bluetooth.h&lt;/strong&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;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to modify the advertisement packet content in the radio notification callback interrupt?</title><link>https://devzone.nordicsemi.com/thread/507307?ContentTypeID=1</link><pubDate>Tue, 22 Oct 2024 10:25:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4387d60-a015-4f15-ad20-da07330deb14</guid><dc:creator>Allen23122452121</dc:creator><description>&lt;p&gt;Hello, thank you very much for your patient explanation.&lt;/p&gt;
&lt;p&gt;The issue causing the DK to crash is not the variables I mentioned, but rather the &lt;code&gt;bt_le_ext_adv_set_data&lt;/code&gt; function.This code runs well after commenting out the &lt;code&gt;bt_le_ext_adv_set_data&lt;/code&gt; function, but uncommenting it causes the DK to crash.&lt;/p&gt;
&lt;p&gt;What I want to know is whether it is possible to call &lt;code&gt;bt_le_ext_adv_set_data&lt;/code&gt; in the interrupt callback function &lt;code&gt;radio_handler&lt;/code&gt; to update the broadcast packet data. If it&amp;#39;s not feasible, how should I update the broadcast packet data within &lt;code&gt;radio_handler&lt;/code&gt;?&lt;/p&gt;
&lt;p&gt;By the way, could you tell me if there&amp;rsquo;s a problem with my interrupt setup? My interrupt setup is as follows：&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/pastedimage1729592561147v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;allen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to modify the advertisement packet content in the radio notification callback interrupt?</title><link>https://devzone.nordicsemi.com/thread/507280?ContentTypeID=1</link><pubDate>Tue, 22 Oct 2024 09:02:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:358dcab9-8317-4ac2-84b8-a0fb9bdc38b4</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I tried translating your initial question, and from that it seems like you say the DK crashes&amp;nbsp;&lt;strong&gt;every time&lt;/strong&gt;. Is that correct, or does it only crash sometimes? From the log you uploaded it seems like there is an assertion in the Zephyr kernel semaphores file, so I&amp;#39;m guessing this increment you&amp;#39;ve added is maybe causing timing issues with the other advertising sets in your application. Does the application work as expected if you remove this increment counter from your radio handler I think it would in general be better to add it after a radio event is completed instead of in the middle of it, since the radio peripheral is very timing critical. Seemingly it is causing some issues with the interrupt handing in your application.&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: How to modify the advertisement packet content in the radio notification callback interrupt?</title><link>https://devzone.nordicsemi.com/thread/507122?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2024 11:44:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d75cadc-998d-4fec-b604-adff3dd37a42</guid><dc:creator>Allen23122452121</dc:creator><description>&lt;p&gt;this is my mpsl radio notification set&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/pastedimage1729511087558v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>