<?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>Identifying a High-Frequency ISR in SystemView</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118797/identifying-a-high-frequency-isr-in-systemview</link><description>I started analyzing my application using SystemView to try to resolve a bug. I think I have configured everything correctly. However, when I start the analysis, I notice that an ISR is being called periodically every 61 microseconds, significantly occupying</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Feb 2025 10:38:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118797/identifying-a-high-frequency-isr-in-systemview" /><item><title>RE: Identifying a High-Frequency ISR in SystemView</title><link>https://devzone.nordicsemi.com/thread/522820?ContentTypeID=1</link><pubDate>Thu, 13 Feb 2025 10:38:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b60556a-05c7-4c34-b5a9-d18206fe659c</guid><dc:creator>Andrea Verdecchia</dc:creator><description>&lt;p&gt;I ran some tests and discovered that the new error is still caused by the call to the &lt;code data-start="86" data-end="108"&gt;bt_hci_cmd_send_sync&lt;/code&gt; function (this time in the &lt;code data-start="136" data-end="149"&gt;hci_vs_init&lt;/code&gt; function), which returns &lt;code data-start="175" data-end="184"&gt;ENOBUFS&lt;/code&gt;. So, I further increased the value of &lt;code data-start="223" data-end="251"&gt;CONFIG_BT_BUF_CMD_TX_COUNT=20.&amp;nbsp;This time, I didn&amp;rsquo;t get any errors. However, the problem is that when I try to establish a Bluetooth connection, the application freezes. At this point, I tried the modification in kernel.h that you posted, removing the previous configurations and leaving only that change&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_TRACING=y
CONFIG_SEGGER_SYSTEMVIEW=y

# CONFIG_BT_BUF_EVT_RX_COUNT=20
# CONFIG_BT_BUF_EVT_RX_SIZE=255
# CONFIG_BT_BUF_CMD_TX_COUNT=20
# CONFIG_BT_BUF_CMD_TX_SIZE=255
# CONFIG_BT_RX_STACK_SIZE=2048
# CONFIG_BT_HCI_TX_STACK_SIZE=2048&lt;/pre&gt;&lt;/p&gt;
&lt;p data-start="535" data-end="655"&gt;Now, everything seems to be working. Are there any downsides to keeping this modification in &lt;code data-start="628" data-end="638"&gt;kernel.h&lt;/code&gt;? Thanks a lot!&lt;/p&gt;
&lt;p data-start="657" data-end="804" data-is-last-node=""&gt;Regarding the ISR from my initial question, I&amp;rsquo;ve filtered it for now, but it&amp;rsquo;s still present. I&amp;rsquo;ll look into it further, but for now, I can manage.&lt;/p&gt;
&lt;p&gt;&lt;code data-start="223" data-end="251"&gt;&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Identifying a High-Frequency ISR in SystemView</title><link>https://devzone.nordicsemi.com/thread/522784?ContentTypeID=1</link><pubDate>Thu, 13 Feb 2025 08:24:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44a7a390-6fc1-47ef-882c-5ecec9c535cd</guid><dc:creator>Elfving</dc:creator><description>[quote user="Thoraz"]Does the fix you sent me apply to my case? I&amp;#39;m working with NCS 2.9.0[/quote]
&lt;p&gt;I don&amp;#39;t think it&amp;#39;s included.&lt;a href="https://github.com/zephyrproject-rtos/zephyr/pull/82828/commits/f2f61094b5e1ba5b841d78e5dd88b2076fbc99ee"&gt; You could cherry pick that if you want to&lt;/a&gt;, but if the buffer modification works I guess it&amp;#39;s fine.&amp;nbsp;&lt;/p&gt;
[quote user="Thoraz"]If you have any suggestions regarding the new error, they are more than welcome.[/quote]
&lt;p&gt;I&amp;#39;m not 100% sure here.&amp;nbsp;But just to start with &amp;quot;&lt;span&gt;Vendor HCI extensions not available&amp;quot;, as that also might&amp;#39;ve affected everything else, do you know what HCI extensions in your app it could be referring to?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Elfving&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Identifying a High-Frequency ISR in SystemView</title><link>https://devzone.nordicsemi.com/thread/522737?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 18:51:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82c216bb-c69c-4ef7-86d6-a020412a0c12</guid><dc:creator>Andrea Verdecchia</dc:creator><description>&lt;p&gt;Yes, exactly. After replying to you, I went to look for the source of the error and arrived at the function &lt;code data-start="108" data-end="130"&gt;bt_hci_cmd_send_sync&lt;/code&gt; (specifically &lt;code data-start="145" data-end="160"&gt;net_buf_alloc&lt;/code&gt;). At this point, after searching online, I added these configurations&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BT_BUF_EVT_RX_COUNT=10
CONFIG_BT_BUF_EVT_RX_SIZE=255
CONFIG_BT_BUF_CMD_TX_COUNT=10
CONFIG_BT_BUF_CMD_TX_SIZE=255
CONFIG_BT_RX_STACK_SIZE=2048
CONFIG_BT_HCI_TX_STACK_SIZE=2048&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The issue related to &lt;code data-start="256" data-end="271"&gt;net_buf_alloc&lt;/code&gt; seems to be resolved, but now a new error appears in the logs:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting My Application v0.0.10-31b40401242e ***
00&amp;gt; *** Using nRF Connect SDK v2.9.0-7787b2649840 ***
00&amp;gt; *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
00&amp;gt; [00:00:00.023,101] &amp;lt;wrn&amp;gt; bt_hci_core: Vendor HCI extensions not available
00&amp;gt; [00:00:00.023,132] &amp;lt;wrn&amp;gt; bt_id: Failed to read public address
00&amp;gt; [00:00:00.023,223] &amp;lt;wrn&amp;gt; bt_id: Read Static Addresses command not available
00&amp;gt; [00:00:00.023,742] &amp;lt;err&amp;gt; bt_id: Unable to set random address
00&amp;gt; [00:00:00.023,742] &amp;lt;wrn&amp;gt; ble_connection: Ble_Connection_Ready returned err -105&lt;/pre&gt;&lt;/p&gt;
&lt;p data-start="338" data-end="567"&gt;I don&amp;rsquo;t have the device with me right now, but I will run more tests tomorrow. Thanks in the meantime for confirming the possible solution with CONFIG_BT_BUF_CMD_TX_COUNT. If you have any suggestions regarding the new error, they are more than welcome.&lt;/p&gt;
&lt;p data-start="569" data-end="639" data-is-last-node=""&gt;Does the fix you sent me apply to my case? I&amp;#39;m working with NCS 2.9.0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Identifying a High-Frequency ISR in SystemView</title><link>https://devzone.nordicsemi.com/thread/522691?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 15:44:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40b10548-2a96-4d97-ab52-c327c0163068</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;No problem &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
[quote user="Thoraz"]By the way, do you know anything about the ENOBUFS error that the &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Ble_Connection_Ready()&lt;/span&gt; function returns when I use it in &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;bt_enable()&lt;/span&gt;?&amp;nbsp;The problem only appears if I enable tracing.[/quote]
&lt;p&gt;Must have missed that question in the OP.&amp;nbsp;It is out of &lt;a href="https://docs.nordicsemi.com/bundle/zephyr-apis-latest/page/group_system_errno.html"&gt;buffer space&lt;/a&gt;. Tracing requires a bit more resources, so it does make sense that it can affect things. Does increasing the buffer size help? Use&amp;nbsp;&lt;span&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/kconfig/index.html#CONFIG_BT_BUF_CMD_TX_COUNT"&gt;CONFIG_BT_BUF_CMD_TX_COUNT&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/116975/systemview-broken-on-sdk-2-8-0-kernel-3-7-99?ReplyFilter=Answers&amp;amp;ReplySortBy=Answers&amp;amp;ReplySortOrder=Descending"&gt;This does look a bit similar to this recent issue.&lt;/a&gt;.., What NCS version are you using?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Identifying a High-Frequency ISR in SystemView</title><link>https://devzone.nordicsemi.com/thread/522603?ContentTypeID=1</link><pubDate>Wed, 12 Feb 2025 09:49:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c002ce98-52ef-4eeb-b3ce-c54e9757f8c7</guid><dc:creator>Andrea Verdecchia</dc:creator><description>&lt;p&gt;Thanks for the links you sent me. I&amp;#39;ll check them and see if I can solve the issue. Thanks. By the way, do you know anything about the ENOBUFS error that the &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;Ble_Connection_Ready()&lt;/span&gt; function returns when I use it in &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;bt_enable()&lt;/span&gt;?&amp;nbsp;The problem only appears if I enable tracing.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void Ble_Connection_Ready( int err )
{
    if ( err )
    {
        LOG_WRN( &amp;quot;Ble_Connection_Ready returned err %d&amp;quot;, err );
        return;
    }

    k_sem_give( &amp;amp;bluetoothReady );
}

[...]

if ( bt_enable( Ble_Connection_Ready ) != 0 )
{
	return SYSTEM_ERROR;
}

if ( k_sem_take( &amp;amp;bluetoothReady, K_SECONDS( 5 ) ) != 0 )
{
    return SYSTEM_ERROR;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can find my configuration &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;prj.conf&lt;/span&gt; in the previous post.&lt;/p&gt;
&lt;p&gt;Or would it be better to open another topic?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Identifying a High-Frequency ISR in SystemView</title><link>https://devzone.nordicsemi.com/thread/522473?ContentTypeID=1</link><pubDate>Tue, 11 Feb 2025 14:41:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:392c37a7-44d4-431f-9d73-a513e48faedd</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hi Andrea,&lt;/p&gt;
&lt;p&gt;It is hard to immediately say what is causing this, though this &lt;a href="https://docs.nordicsemi.com/bundle/sds_s140/page/SDS/s1xx/ble_processor_avail_interrupt_latency/ble_scanner_performance.html#ariaid-title1"&gt;interrupt definitely could be from the softdevice&lt;/a&gt;. One question is if you are you seeing this on just your application, on all samples, or maybe just the BLE ones.&lt;/p&gt;
[quote user=""]How can I determine which ISR it is? Is it possible to assign names to ISRs when tracing?[/quote]
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/instrumenting-with-segger-systemview"&gt;There should be some info on how to do this here.&lt;/a&gt;&lt;/p&gt;
[quote user=""]Why don&amp;#39;t I see the Zephyr RTOS tick ISR?[/quote]
&lt;p&gt;The blog mentions that&amp;nbsp;&lt;span&gt;you need to explicitly enable logging for specific interrupts, eg.&amp;nbsp;sysview_irq_log( RTC1_IRQn, true );&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Elfving&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>