<?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: How to boot S32G2 - M7 cores from external Flash ? in S32G</title>
    <link>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1599677#M2233</link>
    <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Please, let us know.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Feb 2023 15:32:11 GMT</pubDate>
    <dc:creator>Daniel-Aguirre</dc:creator>
    <dc:date>2023-02-15T15:32:11Z</dc:date>
    <item>
      <title>How to boot S32G2 - M7 cores from external Flash ?</title>
      <link>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1598702#M2214</link>
      <description>&lt;P&gt;Dear all,&lt;BR /&gt;I am working with an S32G274A Board (the RDB2), my scope is currently the&lt;BR /&gt;M7-cores 0 and 1 only. I come from a more traditional Microcontroller world (my customers also),&lt;BR /&gt;we intend to let the target (i.e. the M7_0 and M7_1) boot from the external Macronix Flash.&lt;BR /&gt;And we would like to keep things simple for the moment (and ignore the A53s if possible)&lt;BR /&gt;The application is a classic AUTOSAR target application stack (including RTD MCAL and OS), it works fine when loading froma Lauterbacj debugger.&lt;/P&gt;&lt;P&gt;I have been reading the chapters on the poot process and Reset system in the reference manual, and some application notes&lt;BR /&gt;(AN12422, AN13185).&lt;BR /&gt;Maybe I am lost in details, what I am still missing is the big picture:&lt;/P&gt;&lt;P&gt;What is the easiest way to boot the M7_0 and M7_1 from the external Macronix QSPI flash ?&lt;BR /&gt;i.e.&lt;BR /&gt;- Can this be done without an extra boot loader ? (I would prefer to not use one for the moment)&lt;BR /&gt;- can I link the .text segment to the flash and execute from there (what is the address area in that case: the AHB buffer ?)&lt;BR /&gt;- or is it easier to link everything to the SRAM ? in that case: who will copy the .text segment to the SRAM ? the S32G2 BootROM ? or the application startup code has to take care of this ?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In case a Bootloader like UBOOT is unavoidable (I have not worked with it yes):&lt;BR /&gt;- does the Bootloadert run on the M7 or the A53 ?&lt;BR /&gt;- how does the boot configuration come into play ? I do not have a file system in the external QSPI flash.&lt;/P&gt;&lt;P&gt;any hints welcome &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;BR /&gt;Stefan&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 08:08:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1598702#M2214</guid>
      <dc:creator>SSyb</dc:creator>
      <dc:date>2023-02-14T08:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to boot S32G2 - M7 cores from external Flash ?</title>
      <link>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1598739#M2216</link>
      <description>B.t.w. I am using the Greenhills ARM compiler and a customer build environment (Cmake)</description>
      <pubDate>Tue, 14 Feb 2023 08:48:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1598739#M2216</guid>
      <dc:creator>SSyb</dc:creator>
      <dc:date>2023-02-14T08:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to boot S32G2 - M7 cores from external Flash ?</title>
      <link>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1599117#M2227</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;We may recommend looking into the following community thread, were something similar is being talked about:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32G/The-Boot-Flow-for-S32G/m-p/1578263#M1914" target="_blank"&gt;The Boot Flow for S32G - NXP Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;As for your questions, below will be some comments on this:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- Can this be done without an extra boot loader ? (I would prefer to not use one for the moment)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The multicore boot from an external interface (NOR Flash in this case) is not possible without an application bootloader that fetches the related code and starts the needed cores. We can recommend looking into AN13750 available on the S32G2 product page (link:&amp;nbsp;&lt;A href="https://www.nxp.com/products/processors-and-microcontrollers/s32-automotive-platform/s32g-vehicle-network-processors/s32g2-processors-for-vehicle-networking:S32G2" target="_blank"&gt;S32G2 Safe and Secure Vehicle Network Processor | NXP Semiconductors&lt;/A&gt;). This application note talks about a multicore application and the steps needed to replicate the application.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- can I link the .text segment to the flash and execute from there (what is the address area in that case: the AHB buffer ?)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;At this moment, there is no XIP integration/example for S32G2. The Reference Manual talks about this feature, but not much information is given.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- or is it easier to link everything to the SRAM ? in that case: who will copy the .text segment to the SRAM ? the S32G2 BootROM ? or the application startup code has to take care of this ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It depends on what code you are trying to fetch. The code that is fetched by S32G2 BootROM (which is executed on the M7_0 core, this cannot be changed) is the one we referred to as "Application Bootloader" which is the one addressed on the IVT itself. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;After the "Application Bootloader" is fetched, S32G2 BootROM passes the control over to the respective Boot Target (which can be either M7_0 or A53_0) and then the Boot Target executes the "Application Bootloader" and will do as the developer described in the code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As a summary:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- For a multicore application, a bootloader is needed. NXP provides one, as described in the AN13750.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- S32G BootROM fetches the code (named "Application Bootloader") addressed on the IVT itself. This is done with M7_0&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- This "Application Bootloader" will be executed on the Boot Target (M7_0 or A53_0) and will be the one responsible for fetching the remaining code and configuring/starting the other available cores on the platform.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For the last questions, u-boot is not specifically needed for M7's multicore application.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please, let us know.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 22:33:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1599117#M2227</guid>
      <dc:creator>Daniel-Aguirre</dc:creator>
      <dc:date>2023-02-14T22:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to boot S32G2 - M7 cores from external Flash ?</title>
      <link>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1599396#M2231</link>
      <description>Hi Daniel-Aguirre,&lt;BR /&gt;&lt;BR /&gt;thanks for the information and the hints to the material. I will read through this and digest. Will come back when I have more questions to this.&lt;BR /&gt;best regards,&lt;BR /&gt;Stefan</description>
      <pubDate>Wed, 15 Feb 2023 07:56:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1599396#M2231</guid>
      <dc:creator>SSyb</dc:creator>
      <dc:date>2023-02-15T07:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to boot S32G2 - M7 cores from external Flash ?</title>
      <link>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1599677#M2233</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Please, let us know.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 15:32:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1599677#M2233</guid>
      <dc:creator>Daniel-Aguirre</dc:creator>
      <dc:date>2023-02-15T15:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to boot S32G2 - M7 cores from external Flash ?</title>
      <link>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1599691#M2234</link>
      <description>&lt;P&gt;Hi Daniel-Aguirre,&lt;/P&gt;&lt;P&gt;As you suggested, I am looking into the NXP Bootloader now, and see whether I can adapt the configuration for my needs (from: Integration_Reference_Examples_S32G2_2022_06)&lt;/P&gt;&lt;P&gt;I can build the Bootloader already. When looking into AN13750 and in the Tresos configuration, I have the following questions to sharpen my understanding&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Can I assume the Integration_Reference_Examples_S32G2_2022_06 MCAL configuration of the Bootloader is fit for the RDB2 board ?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The bootloader project contains configuration for flash sectors in the MCAL Fls module:&lt;/LI&gt;&lt;UL&gt;&lt;LI&gt;Are they relevant for the bootloader ? (see screenshot) Background: in my user application, I am using a different area of the Flash for non-volatile data. this requires different flash&amp;nbsp; sectors (in a different address area of the flash). But my application code falls Fls_Init again later, so I think these two phases are different worlds, the bootloader has its Flash blocks (and the flash regions where the images are stored), the user application uses another flash region, both don't interfere.&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;in General: When switching to the Application image (from the bootloader), I assume that all MCAL configuration can be done from scratch - correct ?&amp;nbsp; Can the application image MCAL use a different clock configuration Port configuration,&amp;nbsp; Fls config and&amp;nbsp;&amp;nbsp; QSPI configuration than the bootloader ? Or do the needs of the final App image have to be considered/anticipated in the bootloader MCAL already ? Background: in my user application (which is a proper AUTOSAR stack), I am calling all the MCAL init functions again (Fls_Init, Mcu_Init, Port_Init etc...), with an MCAL configuration that is part of my user application project.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;what requirements to the startup code of the user application are then left ? initialize the RAM ?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks a lot and best regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 15:53:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1599691#M2234</guid>
      <dc:creator>SSyb</dc:creator>
      <dc:date>2023-02-15T15:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to boot S32G2 - M7 cores from external Flash ?</title>
      <link>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1599969#M2237</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;We have the following comments regarding your questions:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Can I assume the Integration_Reference_Examples_S32G2_2022_06 MCAL configuration of the Bootloader is fit for the RDB2 board?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;This should be true, given that RDB2 is a development platform that integrates S32G274A in it. It has both the external NOR Flash from Macronix and the SD slot required for Linux.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The bootloader project contains configuration for flash sectors in the MCAL Fls module:&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Are they relevant for the bootloader?&lt;/LI&gt;
&lt;/UL&gt;
&lt;/UL&gt;
&lt;P&gt;Given that the AN13750 does not talk about the possibility of disabling them and that the Fls module should be the one used to fetch the code from the external NOR Flash, we assume this is necessary.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;In General: When switching to the Application image (from the bootloader), I assume that all MCAL configuration can be done from scratch - correct ?&amp;nbsp; Can the application image MCAL use a different clock configuration Port configuration,&amp;nbsp; Fls config and&amp;nbsp;&amp;nbsp; QSPI configuration than the bootloader ? Or do the needs of the final App image have to be considered/anticipated in the bootloader MCAL already ?&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;The applications that are loaded into the M7 cores do their initialization as if there was none done before. We can assume that you can configure your application as needed not worrying about the bootloader, following the AN13750 steps.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;On this topic, even BootROM has its own routine implemented, meaning that the bootloader may be re-initializing something that was already initialized.&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;what requirements to the startup code of the user application are then left ? initialize the RAM ?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If the initialization that the bootloader has do complies with what the customer is doing, the customer could jump directly to the application. Still, this may cause difficulties trying to debug a problem if there is no configuration code on the application or even can cause non-defined behavior.&lt;/P&gt;
&lt;P&gt;For myself, the user application should be configured as if nothing was done prior to it, just beware of the shared modules between cores.&lt;/P&gt;
&lt;P&gt;Please, let us know if this information was helpful or not.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 22:26:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1599969#M2237</guid>
      <dc:creator>Daniel-Aguirre</dc:creator>
      <dc:date>2023-02-15T22:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to boot S32G2 - M7 cores from external Flash ?</title>
      <link>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1602793#M2272</link>
      <description>&lt;P&gt;Ok, so I can now boot my classic AUTOSAR image from external Flash on cores M7_0 and M7_1, with the help of the NXP example Bootloader from the &lt;EM&gt;Integration_Reference_Examples_S32G2_2022_06&lt;/EM&gt; bundle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a questions / request for confirmation though that the AN13750 and the user guide did not address, as far as I could see:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;S&lt;STRONG&gt;ame image on both cores&lt;/STRONG&gt;: it is common to an AUTOSAR classic stack that it can handle multiple cores (i.e. OS works in multicore-style, core 0 is master, core 1 slave etc.). but there is only one image. some parts of the code use the core identity register (through the Os_GetCoreId() API) to decide whether or not to run. I feel such use case is not addressed in the Bootloader. What I had to do now is to&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;create a boot configurations (OK)&lt;/LI&gt;&lt;LI&gt;create 2 boot sources&lt;/LI&gt;&lt;LI&gt;every boot source has its own image container, but in both cases the image is the same (starts at the same address in Flash, loaded to the same address in SRAM)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I had to do this because&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;when trying with the same boot source I get a compilation error later&lt;/LI&gt;&lt;LI&gt;I found out that I have to given different addresses in the "Reset_Handler" address field, otherwise it does not work. the slave core is started at the address of it's int_vec_table (that seems to be written in to the MC_ME address register), the master core gets only the instruction poiner moved by the boot loader -&amp;gt; to the real Reset_Handler function.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Consequence: I think the DMA transfer is done twice for the same data, which increases the boot time I guess.&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Is it correct that the two boot sources are supposed to have different start addresses even though it is the same image (i.e. the master core M7_0, which is also the core where the Bootloader runs, needs to jump to the Reset_Handler, whereas the the slave core M7_1 start address is used to put into the MC_ME core 1 ADDR register and (so it seems) only works when giving it the interrupt vector table address ?&lt;/LI&gt;&lt;LI&gt;Is there a way to avoid that the same Flash mage is loaded to the same SRAM area twice ?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think after the confirmation we can close this thread.&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 10:04:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32G/How-to-boot-S32G2-M7-cores-from-external-Flash/m-p/1602793#M2272</guid>
      <dc:creator>SSyb</dc:creator>
      <dc:date>2023-02-21T10:04:18Z</dc:date>
    </item>
  </channel>
</rss>

