<?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>Using CONFIG_DEBUG_OPTIMIZATIONS with Thingy:91 and Asset Tracker v2</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/109482/using-config_debug_optimizations-with-thingy-91-and-asset-tracker-v2</link><description>I&amp;#39;m getting started with the nRF Connect SDK v2.6 and the Asset Tracker v2 application on a Thingy:91. 
 
 I can build and flash the unmodified app, and it pushes sensor data to nRF Cloud, using both ` overlay-debug.conf` and `overlay-low-power.conf`</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Mar 2024 14:32:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/109482/using-config_debug_optimizations-with-thingy-91-and-asset-tracker-v2" /><item><title>RE: Using CONFIG_DEBUG_OPTIMIZATIONS with Thingy:91 and Asset Tracker v2</title><link>https://devzone.nordicsemi.com/thread/476187?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2024 14:32:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2119612f-c8cd-437e-a124-5abaf05c4a27</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Håkon is out of office, so I will look into your ticket. Please note that I will be out of office as well from tomorrow, due to public holidays here in Norway. We will be back on April 2nd. I am sorry for the inconvenience.&lt;/p&gt;
&lt;p&gt;What do you mean by &amp;quot;implement the two stage build with west build&amp;quot;? And what is &amp;quot;awk&amp;quot; and &amp;quot;sed&amp;quot;?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are talking about having two different build configurations, you can use different sets of .conf files. Alternatively, you can include configs in your west build command. E.g. if you want to add a config like:&lt;/p&gt;
&lt;p&gt;CONFIG_BT=y&lt;/p&gt;
&lt;p&gt;You can use the build command:&lt;/p&gt;
&lt;p&gt;west build -b &amp;lt;board&amp;gt; -d &amp;lt;build_dir&amp;gt; -- -DCONFIG_BT=y&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For several sets of build commands, please see the ncs\nrf\applications\matter_weather_station as an example. It has prj.conf and prj_release.conf. So you can build with one or the other. By changing the name of the build folder, you can have many concurrent builds in your application.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using CONFIG_DEBUG_OPTIMIZATIONS with Thingy:91 and Asset Tracker v2</title><link>https://devzone.nordicsemi.com/thread/475420?ContentTypeID=1</link><pubDate>Fri, 22 Mar 2024 14:20:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38ca4341-9c4a-4462-bfaf-9bc983202992</guid><dc:creator>Cambridge_dev</dc:creator><description>&lt;p&gt;It&amp;nbsp;built and ran&amp;nbsp;when I followed your instructions carefully :- )&lt;/p&gt;
&lt;p&gt;I&amp;#39;m creating bash scripts to automate building different versions e.g debug, lowpower&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you suggest how I could implement the two stage build with west build ?&lt;/p&gt;
&lt;p&gt;I can use sed or awk to modify the .config file between the two build steps, but I&amp;#39;m not sure what arguments to give west build to replicate the vscode workflow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using CONFIG_DEBUG_OPTIMIZATIONS with Thingy:91 and Asset Tracker v2</title><link>https://devzone.nordicsemi.com/thread/475363?ContentTypeID=1</link><pubDate>Fri, 22 Mar 2024 11:03:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0847c74f-e2f3-498e-80cc-6da6418aa803</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Cambridge_dev"]&lt;p&gt;Doing&amp;nbsp;as you suggest does let me build an image with debug optimisations - thanks !&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, when I flash that image to the board it doesn&amp;#39;t run the Asset Tracker app. When I try a debugging session with this image the console gives me:&lt;/p&gt;[/quote]
&lt;p&gt;You will need to build the whole project and flash the merge.hex file afterwards, as this changes your application. I suspect that you only updated the zephyr/zephyr.hex, while you should have flashed the zephyr/merged.hex to successfully get it to run.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Cambridge_dev"]&lt;p&gt;I&amp;#39;ve also tried to define a custom partition map that gives tfm more space, by creating a pm_static.yml file from the partitions.yml file in the build directory.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But the build doesn&amp;#39;t pick this up, and continues to use&amp;nbsp;thingy91_pm_static.yml from the SDK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How can I get the build to use my partition file ?&lt;/p&gt;[/quote]
&lt;p&gt;This is the main issue with using thingy91 as a development platform - it isn&amp;#39;t targeted as a full development kit, rather a&amp;nbsp;prototyping platform device.&lt;/p&gt;
&lt;p&gt;The .yml file is set in the board itself, more specifically here:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.5.2/boards/arm/thingy91_nrf9160/CMakeLists.txt#L26"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.5.2/boards/arm/thingy91_nrf9160/CMakeLists.txt#L26&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You will need to add your changes to the thingy91_pm_static.yml file, or change the thingy91_nrf9160 board to not load the default board .yml file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using CONFIG_DEBUG_OPTIMIZATIONS with Thingy:91 and Asset Tracker v2</title><link>https://devzone.nordicsemi.com/thread/475301?ContentTypeID=1</link><pubDate>Fri, 22 Mar 2024 08:04:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60823c25-f97a-47b9-8073-430117e283c9</guid><dc:creator>Cambridge_dev</dc:creator><description>&lt;p&gt;I&amp;#39;ve also tried to define a custom partition map that gives tfm more space, by creating a pm_static.yml file from the partitions.yml file in the build directory.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But the build doesn&amp;#39;t pick this up, and continues to use&amp;nbsp;thingy91_pm_static.yml from the SDK.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How can I get the build to use my partition file ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using CONFIG_DEBUG_OPTIMIZATIONS with Thingy:91 and Asset Tracker v2</title><link>https://devzone.nordicsemi.com/thread/475216?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2024 16:58:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92eb8855-69e6-46f4-8657-a04d48b3b250</guid><dc:creator>Cambridge_dev</dc:creator><description>&lt;p&gt;Doing&amp;nbsp;as you suggest does let me build an image with debug optimisations - thanks !&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, when I flash that image to the board it doesn&amp;#39;t run the Asset Tracker app. When I try a debugging session with this image the console gives me:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;JLinkGDBServerCLexe: SEGGER J-Link GDB Server V7.94e Command Line Version&lt;br /&gt;JLinkGDBServerCLexe: &lt;br /&gt;JLinkGDBServerCLexe: JLinkARM.dll V7.94e (DLL compiled Jan 15 2024 15:13:39)&lt;br /&gt;JLinkGDBServerCLexe: &lt;br /&gt;JLinkGDBServerCLexe: -----GDB Server start settings-----&lt;br /&gt;JLinkGDBServerCLexe: GDBInit file: none&lt;br /&gt;JLinkGDBServerCLexe: GDB Server Listening port: 58700&lt;br /&gt;JLinkGDBServerCLexe: SWO raw output listening port: 2332&lt;br /&gt;JLinkGDBServerCLexe: Terminal I/O port: 2333&lt;br /&gt;JLinkGDBServerCLexe: Accept remote connection: yes&lt;br /&gt;JLinkGDBServerCLexe: Generate logfile: off&lt;br /&gt;JLinkGDBServerCLexe: Verify download: off&lt;br /&gt;JLinkGDBServerCLexe: Init regs on start: off&lt;br /&gt;JLinkGDBServerCLexe: Silent mode: on&lt;br /&gt;JLinkGDBServerCLexe: Single run mode: on&lt;br /&gt;JLinkGDBServerCLexe: Target connection timeout: 0 ms&lt;br /&gt;JLinkGDBServerCLexe: ------J-Link related settings------&lt;br /&gt;JLinkGDBServerCLexe: J-Link Host interface: USB&lt;br /&gt;JLinkGDBServerCLexe: J-Link script: none&lt;br /&gt;JLinkGDBServerCLexe: J-Link settings file: none&lt;br /&gt;JLinkGDBServerCLexe: ------Target related settings------&lt;br /&gt;JLinkGDBServerCLexe: Target device: cortex-m33&lt;br /&gt;JLinkGDBServerCLexe: Target device parameters: none&lt;br /&gt;JLinkGDBServerCLexe: Target interface: SWD&lt;br /&gt;JLinkGDBServerCLexe: Target interface speed: 12000kHz&lt;br /&gt;JLinkGDBServerCLexe: Target endian: little&lt;br /&gt;JLinkGDBServerCLexe: &lt;br /&gt;=thread-group-added,id=&amp;quot;i1&amp;quot;&lt;br /&gt;=cmd-param-changed,param=&amp;quot;pagination&amp;quot;,value=&amp;quot;off&amp;quot;&lt;br /&gt;fih_panic_loop () at /opt/nordic/ncs/v2.6.0/bootloader/mcuboot/boot/bootutil/src/fault_injection_hardening.c:68&lt;br /&gt;68 __asm volatile (&amp;quot;b fih_panic_loop&amp;quot;);&lt;br /&gt;[New Thread 1879048192]&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;and I can&amp;#39;t stop the code at breakpoints. If i use an image without DEBUG_OPTIMISATION the debugger works as expected. Looks like the boot process is broken....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using CONFIG_DEBUG_OPTIMIZATIONS with Thingy:91 and Asset Tracker v2</title><link>https://devzone.nordicsemi.com/thread/475168?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2024 14:33:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:646e28c9-68f2-4964-a070-0dbbeb8e17ac</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you add CONFIG_DEBUG_OPTIMIZATIONS=y in your prj.conf, TF-M will also be compiled with debug optimizations, which will cause the partition size to be exceeded.&lt;/p&gt;
&lt;p&gt;thingy91_nrf9160_ns will follow this specific partition layout:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.5.2/boards/arm/thingy91_nrf9160/thingy91_pm_static.yml"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.5.2/boards/arm/thingy91_nrf9160/thingy91_pm_static.yml&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;One way around this is to configure your project with CONFIG_SIZE_OPTIMIZATIONS, and afterwards go into menuconfig and change the application&amp;#39;s optimization level. This will cause TF-M to be left with the default optimization, and only set DEBUG_OPTIMIZATION for the asset tracker v2.&lt;/p&gt;
&lt;p&gt;You can do this via vscode nRF Kconfig&amp;nbsp;GUI or manually edit and save the .config file:&lt;/p&gt;
&lt;p&gt;The .config file is located in ../asset_tracker_v2/my-build-folder/zephyr/.config - Search for &amp;quot;CONFIG_SIZE_OPTIMIZATION&amp;quot; and comment out this with a &amp;quot;#&amp;quot; and then add CONFIG_DEBUG_OPTIMIZATIONS=y and then press &amp;quot;build&amp;quot; in vscode.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>