<?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>Help Needed with ARM Cross-Compilation Issues for nRF5340 on a Non-ARM MacBook Pro</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107893/help-needed-with-arm-cross-compilation-issues-for-nrf5340-on-a-non-arm-macbook-pro</link><description>Hello Nordic Community, 
 I am currently working on developing and programming applications for the nRF5340 using C, and I&amp;#39;ve encountered some challenges with cross-compilation that I hope to get some assistance with. 
 My development setup includes a</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 Jan 2024 12:59:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107893/help-needed-with-arm-cross-compilation-issues-for-nrf5340-on-a-non-arm-macbook-pro" /><item><title>RE: Help Needed with ARM Cross-Compilation Issues for nRF5340 on a Non-ARM MacBook Pro</title><link>https://devzone.nordicsemi.com/thread/466936?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2024 12:59:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09b50400-eb0e-4cf5-80ab-b791e4fd39c3</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Runqi,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I see you are using a gcc version higher than what is supplied in our latest toolchain, and I would advice that you use the toolchain from the toolchain manager as that has been used for our release testing and should work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regarding assemply that is not much used in the SDK, but there are some examples. I would not expect that inlining via macros should matter, as the preprocessor runds first, but perhaps it would make sense to avoide that until you get the bascs working to reduce compatibility. You can see examples of use of assemply in the SDK by searching for &amp;quot;__asm__&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Help Needed with ARM Cross-Compilation Issues for nRF5340 on a Non-ARM MacBook Pro</title><link>https://devzone.nordicsemi.com/thread/466904?ContentTypeID=1</link><pubDate>Wed, 31 Jan 2024 10:42:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38bb2b2d-3134-4bcc-a8cc-2197301f497a</guid><dc:creator>runqi</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thank you for your response and for confirming that the toolchain manager should work on both ARM and Intel Macs. I appreciate your help. Following your advice, I&amp;#39;ve delved deeper into the issue and have some additional details and questions.&lt;/p&gt;
&lt;p&gt;I am working on incorporating ARM assembly code within my C project for the nRF5340. The issue arises specifically when trying to use a macro that includes inline assembly. Here&amp;#39;s a simplified version of the macro causing the problem:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define CDK_ASM_ROUTINE_START(proc_type, proc_name, proc_args)   \
                             proc_type proc_name proc_args;   \
                             asm ( &amp;quot;\n\t&amp;quot; \
                             &amp;quot;.section .text\n\t&amp;quot; \
                             &amp;quot;&amp;quot; #proc_name &amp;quot;: \n\t&amp;quot; \
                             // More assembly code follows
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When I use this macro as follows:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;CDK_ASM_ROUTINE_START(void, myFunction, (int param))&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I encounter the following compilation error:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="golang"&gt;error: expected declaration specifiers or &amp;#39;...&amp;#39; before string constant&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This error seems to be related to the inline assembly syntax within the macro. I have checked and confirmed that the syntax follows GCC&amp;#39;s inline assembly guidelines. Here are the steps I have taken to troubleshoot the issue:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verified that the inline assembly syntax is correct according to GCC documentation.&lt;/li&gt;
&lt;li&gt;Checked that the macro expands correctly in other contexts.&lt;/li&gt;
&lt;li&gt;Attempted to isolate the assembly code in a separate function to see if the issue persists.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Despite these efforts, the error remains. Could there be specific configurations or considerations for using inline assembly within macros for cross-compilation with the nRF toolchain?&lt;/p&gt;
&lt;p&gt;I am using [&lt;span class="s1"&gt;Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)&lt;/span&gt;] on a [MacBook Pro Core Intel i5] running [14.2.1 (23C71)].&lt;/p&gt;
&lt;p&gt;Any further insights or suggestions you could offer would be greatly appreciated.&lt;/p&gt;
&lt;p&gt;Thank you very much for your time and assistance.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Runqi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Help Needed with ARM Cross-Compilation Issues for nRF5340 on a Non-ARM MacBook Pro</title><link>https://devzone.nordicsemi.com/thread/466752?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 12:26:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3786574-deec-4243-ac1f-b5fb362ef134</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Runqi,&lt;/p&gt;
&lt;p&gt;Our tools (includign the toolchain manager) are tested on both ARM and Intel MACs so that should not cause any problems. Can you elaborate more specifically on what you are doing and how&amp;nbsp;it is not working?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>