<?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 Bootloader placing at S32K148 in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1547745#M18642</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;At the moment we are trying to implement the A/B FW update/start mechanism.&lt;/P&gt;&lt;P&gt;Currently we are a litte confused about the implementation style.&lt;/P&gt;&lt;P&gt;In the Application Note AN12323 it is described in a way that the Bootloader should be located at the NVM RAM&lt;/P&gt;&lt;P&gt;Other guides, for example "FTF-AUT-N1795 S32K Architecture and Capabilities to Enable Over the Air Updates.pdf" suggest the placing on top of the P-Flash.&lt;/P&gt;&lt;P&gt;Placing the bootloader at the NVM disables it capabilities to write to an emulated EEPROM.&lt;BR /&gt;On the other hand, placing it in NVM enables us to use the whole P-Flash capacity.&lt;/P&gt;&lt;P&gt;Which one is the best way to implement this function?&lt;/P&gt;&lt;P&gt;Thx for the answer in advance&lt;/P&gt;&lt;P&gt;Christof&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Nov 2022 12:24:20 GMT</pubDate>
    <dc:creator>christofhaiding</dc:creator>
    <dc:date>2022-11-02T12:24:20Z</dc:date>
    <item>
      <title>Bootloader placing at S32K148</title>
      <link>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1547745#M18642</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;At the moment we are trying to implement the A/B FW update/start mechanism.&lt;/P&gt;&lt;P&gt;Currently we are a litte confused about the implementation style.&lt;/P&gt;&lt;P&gt;In the Application Note AN12323 it is described in a way that the Bootloader should be located at the NVM RAM&lt;/P&gt;&lt;P&gt;Other guides, for example "FTF-AUT-N1795 S32K Architecture and Capabilities to Enable Over the Air Updates.pdf" suggest the placing on top of the P-Flash.&lt;/P&gt;&lt;P&gt;Placing the bootloader at the NVM disables it capabilities to write to an emulated EEPROM.&lt;BR /&gt;On the other hand, placing it in NVM enables us to use the whole P-Flash capacity.&lt;/P&gt;&lt;P&gt;Which one is the best way to implement this function?&lt;/P&gt;&lt;P&gt;Thx for the answer in advance&lt;/P&gt;&lt;P&gt;Christof&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 12:24:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1547745#M18642</guid>
      <dc:creator>christofhaiding</dc:creator>
      <dc:date>2022-11-02T12:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Bootloader placing at S32K148</title>
      <link>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1549076#M18683</link>
      <description>&lt;P&gt;Hi Christof,&lt;/P&gt;
&lt;P&gt;"Placing the bootloader at the NVM disables it capabilities to write to an emulated EEPROM.&lt;BR /&gt;On the other hand, placing it in NVM enables us to use the whole P-Flash capacity.&lt;/P&gt;
&lt;P&gt;Which one is the best way to implement this function?"&lt;/P&gt;
&lt;P&gt;If you want to use S32K148, you can have both advantages at the same time.&lt;/P&gt;
&lt;P&gt;The application note talks about S32K146 in case of A/B swap:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_0-1667597656479.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/199242iB4BFB670D4F8CBE4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_0-1667597656479.png" alt="lukaszadrapa_0-1667597656479.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;S32K148 has even more flash.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_1-1667597723744.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/199243i5A6C2C6F51C11BF2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_1-1667597723744.png" alt="lukaszadrapa_1-1667597723744.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So, first two blocks can be used for applications and the Program part of the shared block for bootloader and FlexNVM part can be still used for EEPROM.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 21:38:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1549076#M18683</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2022-11-04T21:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Bootloader placing at S32K148</title>
      <link>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1552591#M18830</link>
      <description>&lt;P&gt;Hi Lukas!&lt;/P&gt;&lt;P&gt;Is there any application note for this?&lt;/P&gt;&lt;P&gt;Because at the moment I am a little bit confused.&lt;/P&gt;&lt;P&gt;Just for better understanding:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The P-Flash of the S32K148 is devided in 3 Parts.&lt;BR /&gt;Part 1 and Part 2 can be used for the Application, with the advantage that if the application is excecuted from , let's say Part2, part 1 can be updated with the new application.&lt;/P&gt;&lt;P&gt;Am I right?&lt;/P&gt;&lt;P&gt;If we place the Bootloader in Part 3, the bootloader can access the emulated EEPROM.&lt;BR /&gt;&lt;BR /&gt;And it is also possible to update the Bootloader during an started, let's stick with the example Part 2, application?&lt;/P&gt;&lt;P&gt;And thats the recommended way for the S32K148, am I right?&lt;/P&gt;&lt;P&gt;Still my question, just for clearance:&lt;/P&gt;&lt;P&gt;Any application which is placed in the NVRAM, is not able to make an write access to an emulated EEPROM?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Christof&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 11:27:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1552591#M18830</guid>
      <dc:creator>christofhaiding</dc:creator>
      <dc:date>2022-11-11T11:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Bootloader placing at S32K148</title>
      <link>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1553085#M18851</link>
      <description>&lt;P&gt;Hi Christof,&lt;BR /&gt;I'm afraid there's no such application note.&lt;/P&gt;
&lt;P&gt;"The P-Flash of the S32K148 is devided in 3 Parts.&lt;BR /&gt;Part 1 and Part 2 can be used for the Application, with the advantage that if the application is excecuted from , let's say Part2, part 1 can be updated with the new application. Am I right?"&lt;/P&gt;
&lt;P&gt;- Yes, that's correct.&lt;/P&gt;
&lt;P&gt;"If we place the Bootloader in Part 3, the bootloader can access the emulated EEPROM."&lt;/P&gt;
&lt;P&gt;- The reference manual says:&lt;BR /&gt;"The last partition (448KB Program Flash and 64KB Data&lt;BR /&gt;Flash/FlexMEM), being a single read partition which is&lt;BR /&gt;shared, needs consideration as code may not execute from&lt;BR /&gt;the 448KB Program Flash area at the same time as the&lt;BR /&gt;64KB Data Flash/FlexNVM area is being accessed."&lt;/P&gt;
&lt;P&gt;But there's simple workaround - execute the code from RAM memory (like functions which read/write the EEE). You can use these macros to force a function to RAM:&lt;BR /&gt;START_FUNCTION_DEFINITION_RAMSECTION&lt;BR /&gt;END_FUNCTION_DEFINITION_RAMSECTION&lt;/P&gt;
&lt;P&gt;Notice that interrupts should be either disabled or all the resources related to interrupts need to be moved to RAM too.&lt;/P&gt;
&lt;P&gt;"And it is also possible to update the Bootloader during an started, let's stick with the example Part 2, application?"&lt;/P&gt;
&lt;P&gt;- Yes. If the code runs from Part 1 or Part 2, you can update Part 3.&lt;/P&gt;
&lt;P&gt;"And thats the recommended way for the S32K148, am I right?"&lt;/P&gt;
&lt;P&gt;- Yes.&lt;/P&gt;
&lt;P&gt;"Any application which is placed in the NVRAM, is not able to make an write access to an emulated EEPROM?"&lt;/P&gt;
&lt;P&gt;- NVRAM - do you mean FlexRAM? There's no such option at all because if Emulated EEPROM is enabled, whole FlexRAM is used for EEE. If you want to use FlexRAM as a system RAM, the emulation needs to be disabled.&lt;/P&gt;
&lt;P&gt;Regards&lt;BR /&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 08:04:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1553085#M18851</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2022-11-14T08:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Bootloader placing at S32K148</title>
      <link>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1553170#M18859</link>
      <description>&lt;P&gt;Hi Lukas!&lt;/P&gt;&lt;P&gt;Thx for the answer&lt;/P&gt;&lt;P&gt;Am sry for asking again.&lt;BR /&gt;If you mean the sectioning of 1+2+3 you don't mean it this way:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="christofhaiding_0-1668417120658.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/200198i6116F7EA522F4EDA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="christofhaiding_0-1668417120658.png" alt="christofhaiding_0-1668417120658.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That was exactly the problem we encountered, because we set the Bootloader to the FlexNVM (0x1000 0000) and could not have an writting access to the emulated EEPROM.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You suggest that the partitioning should be this way?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="christofhaiding_1-1668417369781.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/200200i5A914563C8220360/image-size/medium?v=v2&amp;amp;px=400" role="button" title="christofhaiding_1-1668417369781.png" alt="christofhaiding_1-1668417369781.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;With part 1+2 as holder for the application and part 3 as holder for the bootloader?&lt;/P&gt;&lt;P&gt;Thanks for the tip with locating the source to the RAM section.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Wie will try this.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Christof&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 09:24:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1553170#M18859</guid>
      <dc:creator>christofhaiding</dc:creator>
      <dc:date>2022-11-14T09:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Bootloader placing at S32K148</title>
      <link>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1553230#M18863</link>
      <description>&lt;P&gt;That's a good question. I'm sorry, I can see that my previous answer is inaccurate. I was talking about mix of S32K146 and S32K148. &lt;BR /&gt;In case of S32K148, it makes sense to to have 3 partitions in program flash (bootloader + app1 + app2) as on your second screenshot and last 512KB block can be used for Emulated EEPROM + normal data flash storage if needed. &lt;BR /&gt;This is the most straightforward solution, I think. The only disadvatange is that you will have one 512KB block dedicated only for bootloader which is usually small. &lt;BR /&gt;If you need more memory for applications, it would be necessary to use also block with the bootloader and 448KB block. It's doable too, but more complicated. &lt;BR /&gt;Regards,&lt;BR /&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 10:23:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1553230#M18863</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2022-11-14T10:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Bootloader placing at S32K148</title>
      <link>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1553247#M18864</link>
      <description>&lt;P&gt;Hi Lukas!&lt;/P&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;We will try it as you said.&lt;/P&gt;&lt;P&gt;But one more question for the Option "&lt;SPAN&gt;START_FUNCTION_DEFINITION_RAMSECTION".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In my understanding, it means that althought the rest of the bootloader is located/excecuted from the FlexNVRAM.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Functions which have this options, are located at the FlexRAM am I right?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So theoretically, I am placing the bootloader into the FlexNVRAM, but the function which writes the EEPROM data is compiled with this option should be able to write into the EEPROM.&lt;/P&gt;&lt;P&gt;Right?&lt;/P&gt;&lt;P&gt;Regards Christof&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 10:44:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1553247#M18864</guid>
      <dc:creator>christofhaiding</dc:creator>
      <dc:date>2022-11-14T10:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Bootloader placing at S32K148</title>
      <link>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1553272#M18866</link>
      <description>&lt;P&gt;It does not force the code to FlexRAM but to normal RAM by default. Now I found that there are actually two kind of macros - for declaration and for definition.&lt;/P&gt;
&lt;P&gt;It's important to use declaration like this (example taken from source files):&lt;/P&gt;
&lt;P&gt;START_FUNCTION_DECLARATION_RAMSECTION&lt;BR /&gt;static status_t FLASH_DRV_CommandSequence(const flash_ssd_config_t * pSSDConfig)&lt;BR /&gt;END_FUNCTION_DECLARATION_RAMSECTION&lt;/P&gt;
&lt;P&gt;This is using:&lt;/P&gt;
&lt;P&gt;__attribute__((section (".code_ram")));&lt;/P&gt;
&lt;P&gt;Macros:&lt;/P&gt;
&lt;P&gt;START_FUNCTION_DEFINITION_RAMSECTION&lt;BR /&gt;END_FUNCTION_DEFINITION_RAMSECTION&lt;/P&gt;
&lt;P&gt;... will do nothing because (note from the source files):&lt;/P&gt;
&lt;P&gt;/* For GCC, IAR, GHS, Diab and ARMC there is no need to specify the section when&lt;BR /&gt;defining a function, it is enough to specify it at the declaration. This&lt;BR /&gt;also enables compatibility with software analysis tools. */&lt;/P&gt;
&lt;P&gt;So, yes, when doing this, you can execute the code from shared 448KB block and you can still access EEE. Just be careful about the interrupts as already mentioned.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 11:29:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Bootloader-placing-at-S32K148/m-p/1553272#M18866</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2022-11-14T11:29:09Z</dc:date>
    </item>
  </channel>
</rss>

