<?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>topic Re: Function inlining in S32K RTD drivers in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2155487#M52008</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229151"&gt;@strofald&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Let me ask the SW team about this issue. But it seems like the snippets you are referring are based on the non-AUTOSAR (IP) layer, which I believe is not constraint by SWS and often uses static inline for performance and portability across compilers.&lt;/P&gt;
&lt;P&gt;I will get back with you as soon as I get an answer.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Julián&lt;/P&gt;</description>
    <pubDate>Wed, 20 Aug 2025 19:37:48 GMT</pubDate>
    <dc:creator>Julián_AragónM</dc:creator>
    <dc:date>2025-08-20T19:37:48Z</dc:date>
    <item>
      <title>Function inlining in S32K RTD drivers</title>
      <link>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2154325#M51951</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using RTD drivers v5.0.0.&lt;/P&gt;&lt;P&gt;I noticed that in several points of the source code, there are function declared as 'static inline'.&lt;/P&gt;&lt;P&gt;However, I am using the IAR compiler with forced compiler options that by default disable the native inlining, so a declaration like this:&lt;BR /&gt;&lt;BR /&gt;static inline foo (void)&lt;BR /&gt;&lt;BR /&gt;will not be treated as inline by the compiler.&lt;BR /&gt;To overcome this, in my AUTOSAR BSW code I have set some compiler abstractions, so that every module of the AUTOSAR BSW stack uses inlining only by using the define LOCAL_INLINE.&amp;nbsp;&lt;BR /&gt;This define LOCAL_INLINE is then resolved as:&lt;BR /&gt;&lt;BR /&gt;define LOCAL_INLINE&amp;nbsp;&lt;SPAN class=""&gt;static&lt;/SPAN&gt; &lt;SPAN class=""&gt;inline&lt;/SPAN&gt; &lt;SPAN class=""&gt;__attribute__&lt;/SPAN&gt;&lt;SPAN class=""&gt;((&lt;/SPAN&gt;&lt;SPAN class=""&gt;always_inline&lt;/SPAN&gt;&lt;SPAN class=""&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and in this way the modules of the AUTOSAR BSW stack can successfully use the inlining as foreseen by the compiler.&lt;BR /&gt;Anyway, I saw that the S32k3 RTD drivers that I am using do not seem to be using the Compiler abstraction keywords (LOCAL_INLINE, FUNC, etc) and therefore I am not be able to use the inlining correctly.&lt;/P&gt;&lt;P&gt;Is this an issue in those drivers or am I missing something?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Aldo&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 10:02:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2154325#M51951</guid>
      <dc:creator>strofald</dc:creator>
      <dc:date>2025-08-19T10:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Function inlining in S32K RTD drivers</title>
      <link>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2154652#M51962</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229151"&gt;@strofald&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The same MCAL functions as delivered to customer with the corresponding INLINE or LOCAL_INLINE macros were tested with Green Hills, IAR, Diab and GCC. If you want to replicate NXP compiler settings, these are mentioned in the release notes (&lt;STRONG&gt;2.7.4 IAR Compiler/Linker/Assembler Options&lt;/STRONG&gt;).&lt;/P&gt;
&lt;P&gt;The behavior is compiler specific. The INLINE and LOCAL_INLINE macros translate into compiler specific commands, which are found in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Compiler.h&lt;/STRONG&gt;. For example, for GCC, these macros translate as next:&lt;/P&gt;
&lt;PRE class="line-numbers  language-c"&gt;&lt;CODE&gt;#define INLINE             inline __attribute__((always_inline))
#define LOCAL_INLINE       static inline __attribute__((always_inline))‍‍&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And GCC compiler manual describes "always_inline" attribute as next:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Julin_AragnM_1-1755627438715.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/353102i0517BB83340FEA59/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Julin_AragnM_1-1755627438715.png" alt="Julin_AragnM_1-1755627438715.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So basically, refer to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Compiler.h&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and from there; compiler specific documentation and compiler settings.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Julián&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 18:21:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2154652#M51962</guid>
      <dc:creator>Julián_AragónM</dc:creator>
      <dc:date>2025-08-19T18:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Function inlining in S32K RTD drivers</title>
      <link>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2154993#M51980</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;sorry but your response is not very clear to me.&lt;BR /&gt;I understand that I can replicate the compiler options used by NXP, but that it not a solution for us since we cannot change them, and also this is not what AUTOSAR states in the Specification of Compiler Abstraction: I should not be 'forced' to use specific compiler options to make inlining work, but instead through the use of the Compiler Abstraction I can tune the behavior specifying the needed attributes based on the compiler I am using, of course given that the functions are actually __using__ the macros at all.&lt;BR /&gt;As I stated above, from what I can see from the source code of the MCALs, there are functions that are not declared by using the compiler abstraction macros like INLINE or LOCAL_INLINE, for example:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="strofald_0-1755671824971.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/353211i11F0678ACB1B2C45/image-size/medium?v=v2&amp;amp;px=400" role="button" title="strofald_0-1755671824971.png" alt="strofald_0-1755671824971.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;since they don't use the INLINE or LOCAL_INLINE macros, I cannot use my Compiler.h abstractions.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This seems like an issue in the MCAL drivers, I can tell you that I saw other MCAL module from other silicon vendors and they actually use those macros as stated by AUTOSAR standard.&lt;BR /&gt;Is there the possibility of reporting this issue so that it can be fixed in the upcoming releases?&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 06:47:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2154993#M51980</guid>
      <dc:creator>strofald</dc:creator>
      <dc:date>2025-08-20T06:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Function inlining in S32K RTD drivers</title>
      <link>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2155487#M52008</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229151"&gt;@strofald&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Let me ask the SW team about this issue. But it seems like the snippets you are referring are based on the non-AUTOSAR (IP) layer, which I believe is not constraint by SWS and often uses static inline for performance and portability across compilers.&lt;/P&gt;
&lt;P&gt;I will get back with you as soon as I get an answer.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Julián&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 19:37:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2155487#M52008</guid>
      <dc:creator>Julián_AragónM</dc:creator>
      <dc:date>2025-08-20T19:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Function inlining in S32K RTD drivers</title>
      <link>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2155977#M52042</link>
      <description>&lt;P&gt;I understand that, but you can also find snippets of code that are missing the usage of AUTOSAR keywords in the main module sources; here is just an example for the Adc.c file:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="strofald_0-1755768933351.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/353497i90FAA5706A9047D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="strofald_0-1755768933351.png" alt="strofald_0-1755768933351.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I understand your point, but please consider also our point of view: in the case you described we would not be able to use the benefits of the inlining and this could cause potential performance issues.&lt;BR /&gt;&lt;BR /&gt;Aldo&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 09:51:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2155977#M52042</guid>
      <dc:creator>strofald</dc:creator>
      <dc:date>2025-08-21T09:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Function inlining in S32K RTD drivers</title>
      <link>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2156210#M52058</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/229151"&gt;@strofald&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I understand your point. Let me submit a ticket with the dedicated RTD team to see what their response is.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Julián&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 15:53:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Function-inlining-in-S32K-RTD-drivers/m-p/2156210#M52058</guid>
      <dc:creator>Julián_AragónM</dc:creator>
      <dc:date>2025-08-21T15:53:24Z</dc:date>
    </item>
  </channel>
</rss>

