<?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>nRF Connect with VSCode: how to generate assembly files</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105242/nrf-connect-with-vscode-how-to-generate-assembly-files</link><description>I&amp;#39;m using the latest nRF Connect (2.4.2) in VSCode (on Windows) to develop an application on an nRF52840. I would like to look at some of the assembly code generated by the compiler. How do I do that in this environment? With gcc I would use the -S switch;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Jan 2024 21:23:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105242/nrf-connect-with-vscode-how-to-generate-assembly-files" /><item><title>RE: nRF Connect with VSCode: how to generate assembly files</title><link>https://devzone.nordicsemi.com/thread/463238?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2024 21:23:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07c1932b-7cb7-4f9f-87f6-22a46d9c2e94</guid><dc:creator>Mattias</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;yes both methods worked as expected.&lt;/p&gt;
&lt;p&gt;Thanks again,&lt;/p&gt;
&lt;p&gt;Mattias&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect with VSCode: how to generate assembly files</title><link>https://devzone.nordicsemi.com/thread/463224?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2024 18:28:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebe7623f-5b87-409c-9a4c-2d6e6932068f</guid><dc:creator>mkjones</dc:creator><description>&lt;p&gt;I can confirm that CONFIG_OUTPUT_DISASSEMBLY=y does indeed produce a zephyr.lst file.&lt;/p&gt;
&lt;p&gt;It would still be nicer if we could easily get the disassembly for just one (or specified) source files; but this is almost as good (and in some cases would be more useful).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect with VSCode: how to generate assembly files</title><link>https://devzone.nordicsemi.com/thread/463063?ContentTypeID=1</link><pubDate>Mon, 08 Jan 2024 08:21:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a915b58-93bb-4afa-abae-558ca2c63543</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Mattias,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Glad to hear that it worked.&lt;/p&gt;
[quote user="mathae"]With the minor difference is that I use arm-none-eabi-objdump.[/quote]
&lt;p&gt;Did you try the CONFIG_OUTPUT_DISASSEMBLY=y ? As mentioned, this is highly likely the easiest option to create a list file (build/zephyr/zephyr.lst).&lt;/p&gt;
&lt;p&gt;My apologies for missing this configuration earlier.&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: nRF Connect with VSCode: how to generate assembly files</title><link>https://devzone.nordicsemi.com/thread/462955?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2024 15:39:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a06cb18-f37f-429a-b712-f4276cb437e4</guid><dc:creator>Mattias</dc:creator><description>&lt;p&gt;Yes that worked!&lt;/p&gt;
&lt;p&gt;With the minor difference is that I use arm-none-eabi-objdump.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect with VSCode: how to generate assembly files</title><link>https://devzone.nordicsemi.com/thread/462954?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2024 15:38:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64288322-0b88-43fa-850c-6368c704f8fd</guid><dc:creator>Mattias</dc:creator><description>&lt;p&gt;Thanks H&amp;aring;kon, that works fine!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect with VSCode: how to generate assembly files</title><link>https://devzone.nordicsemi.com/thread/462942?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2024 15:04:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d016bee-12a6-463f-a2c2-7211dd917adf</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Mattias and mkj,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is a configuration, CONFIG_OUTPUT_DISASSEMBLY, that can be set and it&amp;#39;ll create a .lst output.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll leave the former CMakeLists.txt hack, in case you actually need to run a post-process command, but I would recommend just setting the above&amp;nbsp;kconfig&amp;nbsp;if you want to see the assembly lst file.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My deepest apologies for missing this configuration..&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: nRF Connect with VSCode: how to generate assembly files</title><link>https://devzone.nordicsemi.com/thread/462921?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2024 14:12:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05527466-cdd6-45ee-ba47-8033b735dd80</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Mattias,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I spent some extra time on this, and found that this seems to work:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;# SPDX-License-Identifier: Apache-2.0

set(MY_OBJDUMP /opt/zephyr-sdk/zephyr-sdk-0.16.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-objdump)

set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts
  COMMAND ${MY_OBJDUMP} -S --disassemble ${CMAKE_BINARY_DIR}/zephyr/zephyr.elf &amp;gt; ${CMAKE_BINARY_DIR}/zephyr/zephyr.asm
)

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
...rest of file&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that the placement is before find_package(...) in the projects CMakeLists.txt file.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try this and see if it works in your project as well?&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: nRF Connect with VSCode: how to generate assembly files</title><link>https://devzone.nordicsemi.com/thread/462846?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2024 09:53:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2948a0de-da19-4ece-bdb5-8e313410e47b</guid><dc:creator>Mattias</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;isn&amp;#39;t the a way to get assembly files to be kept in the build folder? I&amp;#39;m so far using arm-none-eabi-objdump to get assembly from zephyr.elf but would prefer to get it automatically at every build. I have tried different directives in CMakeLists.txt without any success. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;
&lt;p&gt;Mattias&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect with VSCode: how to generate assembly files</title><link>https://devzone.nordicsemi.com/thread/453650?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2023 09:58:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e3575e6-e554-4861-846e-462e6daadf84</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi mkj,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Glad to hear that this helped!&lt;/p&gt;
[quote user="mkjones"]once I remembered to add the &amp;quot;nRF Connect&amp;quot; shell in VSCode, since it has the correct PATH already set up[/quote]
&lt;p&gt;Sorry about this, I should have added a c:\PATH\to\ in my former post. You can do an absolute path towards objdump if you want to add this to some sort of &amp;quot;post build operation&amp;quot; in vscode, , ie. :&amp;nbsp;c:\ncs\toolchains\...\bin\arm-zephyr-eabi-objdump &amp;lt;file.elf&amp;gt;&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: nRF Connect with VSCode: how to generate assembly files</title><link>https://devzone.nordicsemi.com/thread/453555?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2023 15:29:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:009a8a38-0ee3-417c-8303-ab4f2cc8bb50</guid><dc:creator>mkjones</dc:creator><description>&lt;p&gt;That did the trick (once I remembered to add the &amp;quot;nRF Connect&amp;quot; shell in VSCode, since it has the correct PATH already set up).&amp;nbsp; And, with the DEBUG build anyway, there is enough context from the C code to easily find the functions I was interested in.&lt;/p&gt;
&lt;p&gt;Thanks so much for the quick response!&lt;/p&gt;
&lt;p&gt;--mkj&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF Connect with VSCode: how to generate assembly files</title><link>https://devzone.nordicsemi.com/thread/453478?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2023 11:29:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa8be3df-ae75-4f73-9f19-4ada0b694d55</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi mkj,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you mention, normally you output .asm via the &amp;quot;-S&amp;quot; switch in GCC.&lt;/p&gt;
&lt;p&gt;Adding custom compiler switches can be done using &amp;quot;CONFIG_COMPILER_OPT&amp;quot;, but the adding the -S switch does not combine well with the build system in zephyr.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What you can do is, after the fact, use objdump to disassemble your .elf file:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;arm-zephyr-eabi-objdump -S --disassemble my-build-folder/zephyr/zephyr.elf &amp;gt; disassembly.lst&lt;/pre&gt;&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>