<?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>Need Help: Combining TinyML Inference with BLE DFU on nRF7002DK – Crashing at Runtime</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/120994/need-help-combining-tinyml-inference-with-ble-dfu-on-nrf7002dk-crashing-at-runtime</link><description>Hi everyone, 
 I’m working on a project involving the nRF7002DK, where I’m trying to combine two separately working applications: 
 
 A TinyML CIFAR-10 image classification project using TensorFlow Lite Micro 
 A BLE DFU-capable peripheral application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Apr 2025 06:54:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/120994/need-help-combining-tinyml-inference-with-ble-dfu-on-nrf7002dk-crashing-at-runtime" /><item><title>RE: Need Help: Combining TinyML Inference with BLE DFU on nRF7002DK – Crashing at Runtime</title><link>https://devzone.nordicsemi.com/thread/533303?ContentTypeID=1</link><pubDate>Tue, 29 Apr 2025 06:54:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b657b355-b10c-4400-9b12-92139b88aef0</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="Gowtham Raj"]For TF-M, I’ll try building the project without it, so everything just runs in the non-secure domain. Hopefully that will help with the crash during model setup. I’ll test it and let you know if the unaligned memory issue still shows up.[/quote]
&lt;p&gt;Without TF-M, everything will run in the Secure domain! This does not mean it is more secure, as it is the Separation that makes it secure. See &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm/processing_environments.html"&gt;Security by separation&lt;/a&gt; if you want to learn more.&lt;/p&gt;
[quote user="Gowtham Raj"]t would be great if you could try testing them on your side as well.[/quote]
&lt;p&gt;Perhaps later on. First I will try and help you solve this yourself. &lt;/p&gt;
&lt;p&gt;From the logs:&lt;br /&gt;In the fault message, it says (unknown). If you set CONFIG_THREAD_NAME, you can get this to instead tell you the thread name where it fails. This can sometimes be useful.&lt;/p&gt;
&lt;p&gt;Also, perhaps try to debug og add more prints after the &amp;quot;Initializing TinyML model...&amp;quot;, so we can see exactly which function is called when the fault happens.&lt;/p&gt;
&lt;p&gt;Oh and one more idea:&lt;br /&gt;You say that the sample crashes when you add BLE DFU. =&amp;gt; Is it the BLE or the DFU? &lt;br /&gt;Try to add only MCUboot to the project and not BLE. Does that cause the fault? &lt;br /&gt;Try to add only BLE to the project and not DFU. Does that cause the fault?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need Help: Combining TinyML Inference with BLE DFU on nRF7002DK – Crashing at Runtime</title><link>https://devzone.nordicsemi.com/thread/533274?ContentTypeID=1</link><pubDate>Mon, 28 Apr 2025 21:29:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b6dc1df-a681-4845-adcb-22257926ceb3</guid><dc:creator>Gowtham Raj</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;Thanks a lot for getting back to me.&lt;/p&gt;
&lt;p&gt;Based on what you suggested, here&amp;rsquo;s what I&amp;rsquo;m planning to do and a few things I wanted to check with you:&lt;/p&gt;
&lt;p&gt;For TF-M, I&amp;rsquo;ll try building the project without it, so everything just runs in the non-secure domain. Hopefully that will help with the crash during model setup. I&amp;rsquo;ll test it and let you know if the unaligned memory issue still shows up.&lt;/p&gt;
&lt;p&gt;About the flash and RAM layout, thanks for explaining that MCUboot and the app don&amp;rsquo;t share RAM. That makes sense now. I&amp;rsquo;ll also try tweaking the MCUboot partition size using CONFIG_PM_PARTITION_SIZE_MCUBOOT like you said, and see if adjusting things helps avoid any memory conflicts.&lt;/p&gt;
&lt;p&gt;Regarding the logs, yeah, I realize the screenshot wasn&amp;rsquo;t super clear. I uploaded&lt;/p&gt;
&lt;p&gt;it as a .txt file so it&amp;rsquo;s easier to go through.&lt;/p&gt;
&lt;p&gt;Also, if it helps, I&amp;rsquo;ve included the links above where you can download both the BLE DFU sample and my TinyML CIFAR-10 project. It would be great if you could try testing them on your side as well. One suggestion,&amp;nbsp; before building the TinyML CIFAR-10 application, please run the command &amp;quot;west config manifest.project-filter -- +tflite-micro&amp;quot; in the nRF Terminal to make sure the TensorFlow Lite Micro modules are properly pulled in. I found this step necessary to avoid module issues while building.&lt;/p&gt;
&lt;p&gt;Thanks again for helping me out with this, I&amp;rsquo;ll try the changes you mentioned and post back with updates soon.&lt;/p&gt;
&lt;p&gt;Best,&lt;br /&gt;Gowtham Raj&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/fatal_5F00_error.txt"&gt;devzone.nordicsemi.com/.../fatal_5F00_error.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need Help: Combining TinyML Inference with BLE DFU on nRF7002DK – Crashing at Runtime</title><link>https://devzone.nordicsemi.com/thread/533158?ContentTypeID=1</link><pubDate>Mon, 28 Apr 2025 10:57:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96c0ab5e-a604-40d8-b585-ee54cfed9919</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]&lt;p&gt;&lt;span&gt;Potential issues I’m considering include:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Flash/RAM layout conflicts&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;SPI/QSPI usage overlap&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Memory section misconfigurations&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Conflicts with TF-M or secure/non-secure regions&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;[/quote]
&lt;p&gt;I think your ideas on what could be the issues sound reasonable. Let me suggest some things for each:&lt;/p&gt;
[quote user=""]&lt;span&gt;Conflicts with TF-M or secure/non-secure regions&lt;/span&gt;[/quote]
&lt;p&gt;Can you try to just not use TF-M?&lt;/p&gt;
[quote user=""]&lt;span&gt;Flash/RAM layout conflicts&lt;/span&gt;[/quote]
&lt;p&gt;MCUboot and the application does not share RAM. TF-M is another story, but see above.&lt;/p&gt;
&lt;p&gt;Also, perhaps try to change the size of MCUboot using CONFIG_PM_PARTITION_SIZE_MUCBOOT to see if that somehow aligns things by chance. &lt;/p&gt;
[quote user=""]Happy to share logs or a zipped version of the project if needed.[/quote]
&lt;p&gt;The image is kinda low quality. Can you insert the logs as a .txt file?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>