<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>MCUXpresso SDKのトピックnake ResetISR contains c code</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/nake-ResetISR-contains-c-code/m-p/1927261#M4873</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Using MCUXpresso IDE I can import a lot of examples for al RT microcontroller such as RT1051 or RT1175 (the ones I use)&lt;BR /&gt;In all of these examples, the startup file containing the ResetISR function is imported.&lt;BR /&gt;This function is declared &lt;STRONG&gt;naked&lt;/STRONG&gt;. (see &lt;A href="https://github.com/nxp-mcuxpresso/mcux-sdk/blob/8a4072476daecf1168c69fb288f9f02f7b91bb45/devices/MIMXRT1175/mcuxpresso/startup_mimxrt1175_cm7.c#L843" target="_self"&gt;here&lt;/A&gt; or &lt;A href="https://github.com/nxp-mcuxpresso/mcux-sdk/blob/8a4072476daecf1168c69fb288f9f02f7b91bb45/devices/MIMXRT1051/mcuxpresso/startup_mimxrt1051.c#L634" target="_self"&gt;here&lt;/A&gt;). And the function also contains c code.&lt;/P&gt;&lt;P&gt;Here's what I found on the description of 'naked' &lt;A href="https://gcc.gnu.org/onlinedocs/gcc/ARM-Function-Attributes.html#index-naked-function-attribute_002c-ARM" target="_self"&gt;here&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mastupristi_0-1723023484457.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/292361i1D80FF6910A3EE2E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mastupristi_0-1723023484457.png" alt="mastupristi_0-1723023484457.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;in fact even clang-tidy reports it:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;src/startup/startup_mimxrt1175_cm7.c:843:5: error: non-ASM statement in naked function is not supported [clang-diagnostic-error]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this approach reliable? Or was it a 'casual' decision?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;</description>
    <pubDate>Wed, 07 Aug 2024 09:49:20 GMT</pubDate>
    <dc:creator>mastupristi</dc:creator>
    <dc:date>2024-08-07T09:49:20Z</dc:date>
    <item>
      <title>nake ResetISR contains c code</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/nake-ResetISR-contains-c-code/m-p/1927261#M4873</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Using MCUXpresso IDE I can import a lot of examples for al RT microcontroller such as RT1051 or RT1175 (the ones I use)&lt;BR /&gt;In all of these examples, the startup file containing the ResetISR function is imported.&lt;BR /&gt;This function is declared &lt;STRONG&gt;naked&lt;/STRONG&gt;. (see &lt;A href="https://github.com/nxp-mcuxpresso/mcux-sdk/blob/8a4072476daecf1168c69fb288f9f02f7b91bb45/devices/MIMXRT1175/mcuxpresso/startup_mimxrt1175_cm7.c#L843" target="_self"&gt;here&lt;/A&gt; or &lt;A href="https://github.com/nxp-mcuxpresso/mcux-sdk/blob/8a4072476daecf1168c69fb288f9f02f7b91bb45/devices/MIMXRT1051/mcuxpresso/startup_mimxrt1051.c#L634" target="_self"&gt;here&lt;/A&gt;). And the function also contains c code.&lt;/P&gt;&lt;P&gt;Here's what I found on the description of 'naked' &lt;A href="https://gcc.gnu.org/onlinedocs/gcc/ARM-Function-Attributes.html#index-naked-function-attribute_002c-ARM" target="_self"&gt;here&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mastupristi_0-1723023484457.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/292361i1D80FF6910A3EE2E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mastupristi_0-1723023484457.png" alt="mastupristi_0-1723023484457.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;in fact even clang-tidy reports it:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;src/startup/startup_mimxrt1175_cm7.c:843:5: error: non-ASM statement in naked function is not supported [clang-diagnostic-error]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this approach reliable? Or was it a 'casual' decision?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 09:49:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/nake-ResetISR-contains-c-code/m-p/1927261#M4873</guid>
      <dc:creator>mastupristi</dc:creator>
      <dc:date>2024-08-07T09:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: nake ResetISR contains c code</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/nake-ResetISR-contains-c-code/m-p/1927905#M4875</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/124967"&gt;@mastupristi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are totally different 2 questions,&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. For '&lt;STRONG&gt;naked&lt;/STRONG&gt;'. Details of 'naked': '&lt;SPAN&gt;Use this attribute on the ARM or AVR ports to indicate that the specified function do not need prologue/epilogue sequences generated by the compiler. It is up to the programmer to provide these sequences.'&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;A href="https://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Function-Attributes.html" target="_blank"&gt;https://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Function-Attributes.html&lt;/A&gt;&amp;nbsp;'Hybrid Programming C and asm' depens on&amp;nbsp;the toolchian can support optimize or not,&amp;nbsp;&amp;nbsp;&lt;A href="https://developer.arm.com/documentation/101754/0622/armclang-Reference/Compiler-specific-Function--Variable--and-Type-Attributes/--attribute----naked---function-attribute" target="_blank"&gt;https://developer.arm.com/documentation/101754/0622/armclang-Reference/Compiler-specific-Function--Variable--and-Type-Attributes/--attribute----naked---function-attribute&lt;/A&gt;&amp;nbsp;&lt;SPAN&gt;&lt;CODE class="hljs"&gt;armclang&lt;/CODE&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;cannot optimize&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;CODE class="hljs"&gt;__attribute__((naked))&lt;/CODE&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;functions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. &lt;/SPAN&gt;Please see key explaination about the reason:&amp;nbsp;&lt;A href="https://www.freertos.org/Documentation/02-Kernel/05-RTOS-implementation-tutorial/02-Building-blocks/06-GCC-naked-attributes" target="_blank"&gt;https://www.freertos.org/Documentation/02-Kernel/05-RTOS-implementation-tutorial/02-Building-blocks/06-GCC-naked-attributes&lt;/A&gt;&amp;nbsp;When the '&lt;STRONG&gt;naked&lt;/STRONG&gt;' attribute is used the compiler(gcc for NXP) does not generate&amp;nbsp;&lt;EM&gt;any&lt;/EM&gt;&amp;nbsp;function entry or exit code so this must now be added explicitly. It is reasonable for ISR reset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;B.R,&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 03:53:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/nake-ResetISR-contains-c-code/m-p/1927905#M4875</guid>
      <dc:creator>Sam_Gao</dc:creator>
      <dc:date>2024-08-08T03:53:11Z</dc:date>
    </item>
  </channel>
</rss>

