<?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 place const data in K8x External QSPI flash in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1573302#M64489</link>
    <description>&lt;P&gt;Hi, am writing firmware for a new board, K81 and Winbond QSPI external flash. I've never used external flash. Can you suggest where I might start, so I need to learn about memory aliasing , XIP, how to place code in that flash, etc? Thanks &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Dec 2022 20:01:21 GMT</pubDate>
    <dc:creator>greycon1</dc:creator>
    <dc:date>2022-12-21T20:01:21Z</dc:date>
    <item>
      <title>How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1489767#M63569</link>
      <description>&lt;P&gt;I have a K8x and&amp;nbsp;need to place large const data on external (QSPI XiP) flash. I am using an external linker script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deniscollis_0-1657832182374.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/186705i15B73CD1A38EA962/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deniscollis_0-1657832182374.png" alt="deniscollis_0-1657832182374.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here are the relevant excerpts:&lt;/P&gt;&lt;P&gt;k81_memory.ld&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;MEMORY
{ 
  PROGRAM_FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x040000
  EXT_PGM_FLASH (rx) : ORIGIN = 0x04020000, LENGTH = 0x100000
  /*  0x04020000-0x0405FFFF is XiP alias for 0x68020000-0x6805FFFF  */
  SRAM_LOWER   (rwx) : ORIGIN = 0x1fff0000, LENGTH = 0x010000
  SRAM_UPPER   (rwx) : ORIGIN = 0x20000000, LENGTH = 0x030000
  /* First 128K infineon has 4K erase, use for Configs */
  TERM_SETTINGS (rx) : ORIGIN = 0x68000000, LENGTH = 0x018000 /* 96K */
  MODULE_CONFIG (rx) : ORIGIN = 0x68018000, LENGTH = 0x008000 /* 32K */
  XIP_RESERVED  (rx) : ORIGIN = 0x68020000, LENGTH = 0x100000 /*  1M */
  OTA_UPDATE    (rx) : ORIGIN = 0x68120000, LENGTH = 0x100000 /*  1M */
}&lt;/LI-CODE&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;k81.ld&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;INCLUDE "k81_memory.ld"
STACK_SIZE  = 0x1000;
ENTRY(ResetISR)
SECTIONS
{
  /* EXTERNAL QSPI XiP FLASH */
  .text_Flash2 : ALIGN(4)
  {
    FILL(0xff)
    *(.text_Flash2*)
    *(.text_EXT_PGM_FLASH*)
    *(.text.$Flash2*)
    *(.text.$EXT_PGM_FLASH*)
  } &amp;gt; EXT_PGM_FLASH
    
  .data_Flash2 : ALIGN(4)
  {
    FILL(0xff)
    *(.rodata_Flash2*)
    *(.rodata_EXT_PGM_FLASH*)
    *(.rodata.$Flash2*)
    *(.rodata.$EXT_PGM_FLASH*)
  }&amp;gt; EXT_PGM_FLASH&lt;/LI-CODE&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;If I place code in external flash, e.g.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void __attribute__((section (".text_Flash2"))) delay_ms(uint16_t ms)
{
    volatile uint32_t i = 0U;
    for (i = 0U; i &amp;lt; (10000U*ms); ++i)
    {
        __asm("NOP"); /* delay */
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... and build:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deniscollis_1-1657832734815.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/186708i7F931BBAADD117CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deniscollis_1-1657832734815.png" alt="deniscollis_1-1657832734815.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;...then the function is correctly placed on the external flash.&lt;/P&gt;&lt;P&gt;However, if I instead place const data in external flash&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;const TsBigBitMap __attribute__((section (".data_Flash2"))) Logo_bmp =
{
  3,     // BitMapType
  512,   // width_pixels
  384,   // height_pixels
  192,   // width_bytes
  73728, // byte_count
  {
// Line 0
0xFF, 0xFF, 0xF0, 0x0A, ... 0xFF, 0xFF 0xFF, 0xFF, 
  }
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.. and build:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deniscollis_2-1657833404391.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/186710i15E78400343045C9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deniscollis_2-1657833404391.png" alt="deniscollis_2-1657833404391.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;... then it appears to NOT be placed in external flash.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I not seeing?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 21:20:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1489767#M63569</guid>
      <dc:creator>deniscollis</dc:creator>
      <dc:date>2022-07-14T21:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1490323#M63572</link>
      <description>&lt;P&gt;The .text_flash2 section contains a .text_flash2 section.&lt;BR /&gt;&lt;BR /&gt;The .data_flash2 section does not contain a .data_flash2 section.&lt;BR /&gt;Add&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt; *(.data_Flash2*)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 12:10:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1490323#M63572</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2022-07-15T12:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1491312#M63581</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/83989"&gt;@deniscollis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope that you are doing awesome!&lt;/P&gt;
&lt;P&gt;There are several alternatives to place const data on a specific flash region.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have not tested this yet, as currently I was locked down with no boards due to covid, but here is a method I used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see that you are working with Kinetis, all the Kinetis MCUs have at structure located at 0x400 thanks to linker.&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;// Flash Configuration block : 16-byte flash configuration field that stores
// default protection settings (loaded on reset) and security information that
// allows the MCU to restrict access to the Flash Memory module.
// Placed at address 0x400 by the linker script.
//*****************************************************************************
__attribute__ ((used,section(".FlashConfig"))) const struct {
    unsigned int word1;
    unsigned int word2;
    unsigned int word3;
    unsigned int word4;
} Flash_Config = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF3DFE};&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_0-1658188723779.png" style="width: 616px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/187040iFFF9B7BCD92AAD9A/image-dimensions/616x214?v=v2" width="616" height="214" role="button" title="diego_charles_0-1658188723779.png" alt="diego_charles_0-1658188723779.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;On a similar way I created my array&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;__attribute__ ((used,section(".FlashConf"))) const uint8_t roarray[1024*6] = {0xAE}&lt;/LI-CODE&gt;
&lt;P&gt;I proceed to create a secondary flash space. In&amp;nbsp; the MCUXpresso it looks like this on the MCU settings.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_1-1658188831501.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/187041i39D0A5E6385881E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="diego_charles_1-1658188831501.png" alt="diego_charles_1-1658188831501.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then, I disabled managed linker script option&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_2-1658188905931.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/187042iF73EAC29EAE17DF7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="diego_charles_2-1658188905931.png" alt="diego_charles_2-1658188905931.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And I modified the linker to place my array at any desired offset on my secondary flash space.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_3-1658190172620.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/187043iC14DBD0FFD5EFEED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="diego_charles_3-1658190172620.png" alt="diego_charles_3-1658190172620.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then the output was the following.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_4-1658190217795.png" style="width: 742px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/187044i05207A45FE022A08/image-dimensions/742x102?v=v2" width="742" height="102" role="button" title="diego_charles_4-1658190217795.png" alt="diego_charles_4-1658190217795.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;All the best,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Diego.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2022 00:26:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1491312#M63581</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2022-07-19T00:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1493645#M63609</link>
      <description>&lt;P&gt;Hi Diego,&lt;/P&gt;&lt;P&gt;This is using internal flash, which I have no problem with.&amp;nbsp; I'm having an issue trying to achieve the same with external QSPI/XiP flash.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In any case, thanks for the useful info,&lt;/P&gt;&lt;P&gt;Denis&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 00:34:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1493645#M63609</guid>
      <dc:creator>deniscollis</dc:creator>
      <dc:date>2022-07-22T00:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1493654#M63610</link>
      <description>&lt;P&gt;Hi Bob,&lt;/P&gt;&lt;P&gt;I fixed that, but the data is still placed in internal flash.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    .data_Flash2 : ALIGN(4)
    {
       FILL(0xff)
        *(.data_Flash2*)
        *(.data_EXT_PGM_FLASH*)
        *(.data.$Flash2*)
        *(.data.$EXT_PGM_FLASH*)
    }&amp;gt; EXT_PGM_FLASH&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;const uint8_t[] __attribute__((section (".data_Flash2"))) bigdata =
{
......
};&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Building target: XXX.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -Xlinker -Map="XXX.map" -Xlinker --gc-sections -Xlinker -print-memory-usage -Xlinker --sort-section=alignment -Xlinker --cref -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -T k81.ld -L ../startup/ -o "XXX.axf" ...  
Memory region         Used Size  Region Size  %age Used
   PROGRAM_FLASH:      196340 B       256 KB     74.90%
   EXT_PGM_FLASH:          0 GB         1 MB      0.00%
      SRAM_LOWER:          0 GB        64 KB      0.00%
      SRAM_UPPER:       79688 B       192 KB     40.53%
Finished building target: XXX.axf
 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 01:03:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1493654#M63610</guid>
      <dc:creator>deniscollis</dc:creator>
      <dc:date>2022-07-22T01:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1494814#M63629</link>
      <description>&lt;P&gt;Try adding KEEP.&amp;nbsp; Example from my Linker file, below.&lt;BR /&gt;&lt;BR /&gt;The gc-sections that is in your linker will cause any section of the output to be removed if the compiler thinks it is not referenced.&lt;/P&gt;&lt;P&gt;Also what does the XXX.sym file(s) show?&amp;nbsp;&lt;BR /&gt;Is there actual reference to a symbol in the external section?&lt;BR /&gt;Check for miss-spellings.&lt;BR /&gt;&lt;BR /&gt;There are also two versions of the sym file, see blow, sorted by address and sorted by size.&lt;BR /&gt;&lt;BR /&gt;KEEP example:&lt;/P&gt;&lt;P&gt;/* The startup code goes first into INTERNAL_FLASH: */&lt;BR /&gt;.isr_vector :&lt;BR /&gt;{&lt;BR /&gt;__vector_table = ABSOLUTE(.) ; /* Address of the ISR Vector Table */&lt;BR /&gt;__isr_vectors_start = .;&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt;* When link-time garbage collection is in use (-gc-sections), it is&lt;BR /&gt;* often useful to mark sections that should not be eliminated. This is&lt;BR /&gt;* accomplished by surrounding an input section's wild-card entry with&lt;BR /&gt;* KEEP(), as in KEEP(*(.init)) or KEEP(SORT(*)(.ctors)).&lt;BR /&gt;*/&lt;BR /&gt;KEEP(*(.isr_vector))&lt;/P&gt;&lt;P&gt;__isr_vectors_end = .;&lt;BR /&gt;} &amp;gt; VECTORS =0xFF&lt;/P&gt;&lt;P&gt;# Create a symbol table from ELF output file.&lt;BR /&gt;# Order by address.&lt;BR /&gt;%.$(NEW_BUILDNUMBER).sym: %.elf&lt;BR /&gt;echo $(SYMBOL_TABLE_MSG) $@&lt;BR /&gt;echo NM="$(NM)" -n $(OBJDIR)/$&amp;lt; &amp;gt; $(OBJDIR)/$@&lt;BR /&gt;$(NM) -n $(OBJDIR)/$&amp;lt; &amp;gt; $(OBJDIR)/$@&lt;BR /&gt;cp $(OBJDIR)/$@ $(TARGET_DIR)/$(TARGET).sym&lt;/P&gt;&lt;P&gt;# Order by size.&lt;BR /&gt;%.$(NEW_BUILDNUMBER).sym2: %.elf&lt;BR /&gt;echo $(SYMBOL_TABLE_MSG) $@&lt;BR /&gt;echo NM="$(NM)" -S --size-sort -s $(OBJDIR)/$&amp;lt; &amp;gt; $(OBJDIR)/$@&lt;BR /&gt;$(NM) -S --size-sort -s $(OBJDIR)/$&amp;lt; &amp;gt; $(OBJDIR)/$@&lt;BR /&gt;cp $(OBJDIR)/$@ $(TARGET_DIR)/$(TARGET).sym2&lt;BR /&gt;&lt;BR /&gt;Also due to a really obscure linker bug the __Start/__End address need to be inside the section blocks, not outside of them.&amp;nbsp; Not really your issue here, just be aware of it.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 12:04:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1494814#M63629</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2022-07-25T12:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1498934#M63707</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/83989"&gt;@deniscollis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where you able to success on this?&lt;/P&gt;
&lt;P&gt;Best regards,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Diego&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 16:44:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1498934#M63707</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2022-08-01T16:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1498960#M63708</link>
      <description>&lt;P&gt;Hi Diego,&lt;/P&gt;&lt;P&gt;I am taking over for Denis who is on vacation. I am able to see the build map to the correct address, but it does not load in the external flash.&lt;/P&gt;&lt;P&gt;Here's snippet of the map file where I try to place the const variable ipsLogo_bmp in external flash:&lt;/P&gt;&lt;P&gt;.text_Flash2 0x04020000 0x0&lt;BR /&gt;FILL mask 0xff&lt;BR /&gt;*(SORT_BY_ALIGNMENT(.text_Flash2*))&lt;BR /&gt;*(SORT_BY_ALIGNMENT(.text_EXT_PGM_FLASH*))&lt;BR /&gt;*(SORT_BY_ALIGNMENT(.text.$Flash2*))&lt;BR /&gt;*(SORT_BY_ALIGNMENT(.text.$EXT_PGM_FLASH*))&lt;/P&gt;&lt;P&gt;.data_Flash2 0x04020000 0x1200c&lt;BR /&gt;FILL mask 0xff&lt;BR /&gt;*(SORT_BY_ALIGNMENT(.data_Flash2*))&lt;BR /&gt;.data_Flash2 0x04020000 0x1200c ./source/Display/Resources/resources.o&lt;BR /&gt;0x04020000 ipsLogo_bmp&lt;BR /&gt;*(SORT_BY_ALIGNMENT(.data_EXT_PGM_FLASH*))&lt;BR /&gt;*(SORT_BY_ALIGNMENT(.data.$Flash2*))&lt;BR /&gt;*(SORT_BY_ALIGNMENT(.data.$EXT_PGM_FLASH*))&lt;/P&gt;&lt;P&gt;Memory region Used Size Region Size %age Used&lt;BR /&gt;PROGRAM_FLASH: 199388 B 256 KB 76.06%&lt;BR /&gt;EXT_PGM_FLASH: 73740 B 1 MB 7.03%&lt;BR /&gt;SRAM_LOWER: 0 GB 64 KB 0.00%&lt;BR /&gt;SRAM_UPPER: 79728 B 192 KB 40.55%&lt;BR /&gt;TERM_SETTINGS: 0 GB 96 KB 0.00%&lt;BR /&gt;MODULE_CONFIG: 0 GB 32 KB 0.00%&lt;BR /&gt;XIP_RESERVED: 0 GB 1 MB 0.00%&lt;BR /&gt;OTA_UPDATE: 0 GB 1 MB 0.00%&lt;/P&gt;&lt;P&gt;Do I have to add any drivers to download to QuadSPI flash in the project settings:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zahidul3_0-1659375900038.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/188689i1C02E4E5E1EE5FBF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zahidul3_0-1659375900038.png" alt="zahidul3_0-1659375900038.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 18:09:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1498960#M63708</guid>
      <dc:creator>zahidul3</dc:creator>
      <dc:date>2022-08-01T18:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1508934#M63856</link>
      <description>&lt;P&gt;I was able to solve this.&amp;nbsp; It has to do with the memory aliasing that's used by the K8x.&amp;nbsp; My own comment is actually the solution staring me in the face!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* 0x04020000-0x0405FFFF is XiP alias for 0x68020000-0x6805FFFF */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;EXT_PGM_FLASH is the address region used by the K8x program counter.&amp;nbsp; XIP_RESERVED is the physical QSPI mapped address region.&amp;nbsp; The internal code always uses the EXT_PGM_FLASH, but when programming the chip the debug probe must use XIP_RESERVED.&amp;nbsp; So the region must be associated with the physical location by using the &lt;U&gt;&lt;STRONG&gt;AT&amp;gt;&lt;/STRONG&gt;&lt;/U&gt; option.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;} &amp;gt; EXT_PGM_FLASH&amp;nbsp; AT&amp;gt; XIP_RESERVED&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;MEMORY
{ 
  PROGRAM_FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x040000
  EXT_PGM_FLASH (rx) : ORIGIN = 0x04020000, LENGTH = 0x100000
  /*  0x04020000-0x0405FFFF is XiP alias for 0x68020000-0x6805FFFF  */
  SRAM_LOWER   (rwx) : ORIGIN = 0x1fff0000, LENGTH = 0x010000
  SRAM_UPPER   (rwx) : ORIGIN = 0x20000000, LENGTH = 0x030000
  /* First 128K infineon has 4K erase, use for Configs */
  TERM_SETTINGS (rx) : ORIGIN = 0x68000000, LENGTH = 0x018000 /* 96K */
  MODULE_CONFIG (rx) : ORIGIN = 0x68018000, LENGTH = 0x008000 /* 32K */
  XIP_RESERVED  (rx) : ORIGIN = 0x68020000, LENGTH = 0x100000 /*  1M */
  OTA_UPDATE    (rx) : ORIGIN = 0x68120000, LENGTH = 0x100000 /*  1M */
}

STACK_SIZE  = 0x1000;

ENTRY(ResetISR)

SECTIONS
{
  /* EXTERNAL QSPI XiP FLASH */
  .text_Flash2 : ALIGN(4)
  {
    FILL(0xff)
    *(.text_Flash2*)
    *(.text_EXT_PGM_FLASH*)
    *(.text.$Flash2*)
    *(.text.$EXT_PGM_FLASH*)
  }&amp;gt; EXT_PGM_FLASH  AT&amp;gt; XIP_RESERVED
    
  .data_Flash2 : ALIGN(4)
  {
    FILL(0xff)
    *(.rodata_Flash2*)
    *(.rodata_EXT_PGM_FLASH*)
    *(.rodata.$Flash2*)
    *(.rodata.$EXT_PGM_FLASH*)
  }&amp;gt; EXT_PGM_FLASH  AT&amp;gt; XIP_RESERVED&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deniscollis_0-1660930197833.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/190735i941ACD026CFA4E7E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="deniscollis_0-1660930197833.png" alt="deniscollis_0-1660930197833.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note that EXT_PGM_FLASH and XIP_RESERVED are the same size. These are, respectively, the Alias and Physical address regions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;Denis&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 17:37:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1508934#M63856</guid>
      <dc:creator>deniscollis</dc:creator>
      <dc:date>2022-08-19T17:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1508942#M63857</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/83989"&gt;@deniscollis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Great, thanks for sharing, Denis!&lt;/P&gt;
&lt;P&gt;Diego&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 17:43:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1508942#M63857</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2022-08-19T17:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1573302#M64489</link>
      <description>&lt;P&gt;Hi, am writing firmware for a new board, K81 and Winbond QSPI external flash. I've never used external flash. Can you suggest where I might start, so I need to learn about memory aliasing , XIP, how to place code in that flash, etc? Thanks &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 20:01:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1573302#M64489</guid>
      <dc:creator>greycon1</dc:creator>
      <dc:date>2022-12-21T20:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1573746#M64494</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've not used the K81 and access to the documentation is restricted, so I don't know that part.&lt;BR /&gt;First check that the K81 does support Execute In Place (XIP).&lt;BR /&gt;&lt;BR /&gt;The Reference Manual and the Data Sheets are always the place to start.&lt;BR /&gt;Read them thoroughly before making any schematic.&lt;BR /&gt;&lt;BR /&gt;Some programming pods such as the PEMicro Universal FX will program QSPI Flash parts.&lt;/P&gt;&lt;P&gt;Check if the native bootloader, if there is one, supports loading such a part.&lt;BR /&gt;If not create such a bootloader.&lt;BR /&gt;&lt;BR /&gt;As you are new here, I'll also mention that it is considered poor etiquette to hijack someone else's thread.&amp;nbsp; Always better to start a new one.&amp;nbsp; It will get more views and response that way too.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 13:06:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1573746#M64494</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2022-12-22T13:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1573785#M64496</link>
      <description>&lt;P&gt;Thanks for the pointers Bob. And for the word about etiquette - I wasn't aware, but now I am &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 14:16:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1573785#M64496</guid>
      <dc:creator>greycon1</dc:creator>
      <dc:date>2022-12-22T14:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to place const data in K8x External QSPI flash</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1573847#M64498</link>
      <description>&lt;P&gt;We are also using K81/K82 and we can confirm it does support XIP in external QSPI flash. Also the Segger JLINK flasher we are using also supports loading into external QSPI flash as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Feel free to start a new thread if needed.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 18:07:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-to-place-const-data-in-K8x-External-QSPI-flash/m-p/1573847#M64498</guid>
      <dc:creator>zahidul3</dc:creator>
      <dc:date>2022-12-22T18:07:06Z</dc:date>
    </item>
  </channel>
</rss>

