<?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: MCXA156 FLASH remapping through ROM Bootloader in MCX Microcontrollers</title>
    <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXA156-FLASH-remapping-through-ROM-Bootloader/m-p/2338949#M5092</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/256858"&gt;@AlexRu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;About the&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;ROM Bootloader document, i think you can refer to the MCXA156 reference manual MCXAP100M96FS6RM Chapter 20 and AN14525&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://docs.nxp.com/bundle/AN14525/page/topics/mcx_a14x_a15x_secure_boot_based_on_mcuboot.html" target="_blank"&gt;AN14525: MCXA14x/15x Secure Boot Based on MCUBoot | NXP Semiconductors.&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;MCXA's ROM Flash API does not include Margin Read.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The following are the supported functions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;typedef struct _flash_driver_interface
{
    /* Flash driver */
    status_t (*flash_init)(flash_config_t *config);
    status_t (*flash_erase_sector)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key);
    status_t (*flash_program_phrase)(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes);
    status_t (*flash_program_page)(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes);
    status_t (*flash_verify_program)(flash_config_t *config,
                                     uint32_t start,
                                     uint32_t lengthInBytes,
                                     const uint8_t *expectedData,
                                     uint32_t *failedAddress,
                                     uint32_t *failedData);
    status_t (*flash_verify_erase_phrase)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
    status_t (*flash_verify_erase_page)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
    status_t (*flash_verify_erase_sector)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
    status_t (*flash_get_property)(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value);
    /* IFR driver */
#if !(defined(FSL_FEATURE_ROMAPI_IFR) &amp;amp;&amp;amp; (FSL_FEATURE_ROMAPI_IFR == 0U))
    status_t (*ifr_verify_erase_phrase)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
    status_t (*ifr_verify_erase_page)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
    status_t (*ifr_verify_erase_sector)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
#endif
    status_t (*flash_read)(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes);
    /* version */
    uint32_t version;
} flash_driver_interface_t;&lt;/LI-CODE&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Mar 2026 03:49:26 GMT</pubDate>
    <dc:creator>Harry_Zhang</dc:creator>
    <dc:date>2026-03-25T03:49:26Z</dc:date>
    <item>
      <title>MCXA156 FLASH remapping through ROM Bootloader</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXA156-FLASH-remapping-through-ROM-Bootloader/m-p/2337778#M5063</link>
      <description>&lt;P&gt;Hello NXP-Community,&lt;/P&gt;&lt;P&gt;I am currently experimenting with the REMAP functionality of the MCXA Family (MCXA156) as it is seems to be an ideal method swapping 2 flash spaces when doing FW updating in field.&lt;/P&gt;&lt;P&gt;I am facing a problem now that I am not able to REMAP half of the available 1MB Flash of MCXA156 chip.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the CMPA description in the reference manual attachments the tooltip hints that FLASH_REMAP_SZ represents 32KB increments for remapping range (see attached Screenshot:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-03-23 175449.png" style="width: 986px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/380089i4E51C986C0AC6A9D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-03-23 175449.png" alt="Screenshot 2026-03-23 175449.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In contrast the REMAP registers of FMC0 state an increment of 8KB (Chapter 7 Flash Memory Controller (FMC)):&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;When LIM = LIMDP = 0, FMC disables the remap function. When LIM = LIMDP = a nonzero value, the remapping address range is (LIM + 1) × 8 KB. For example:&lt;BR /&gt;•&lt;BR /&gt;When LIM = LIMDP = 1, the range is ≤ 16 KB.&lt;BR /&gt;•&lt;BR /&gt;When LIM = LIMDP = 2, the range is ≤ 32 KB.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The value of FLASH_REMAP_SZ is copied into LIM and LIMDP field of the REMAP register. (by ROM Bootloader?) Unfortunatelly the maximum value that can be set according to CMPA description is 0x1E. With this value I confirmed that 30 * 8KB range is mapped from lower half to upper half flash.&lt;/P&gt;&lt;P&gt;For further context: I am able to map the desired 512KB by directly writing 0x3F into LIM and LIMDP fields within my experimental SW. I am unsure whether this is a clean way of doing flash remapping or is there a better way executing it?&lt;/P&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;Is it correct that the value of FLASH_REMAP_SZ from CMPA is "copied" by the ROM Bootloader?&lt;/P&gt;&lt;P&gt;Is it possible to trick or workaround the limitiation of FLASH_REMAP_SZ size and be able to increase the range for remapping? (&amp;gt; 0x1E)&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2026 17:43:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXA156-FLASH-remapping-through-ROM-Bootloader/m-p/2337778#M5063</guid>
      <dc:creator>AlexRu</dc:creator>
      <dc:date>2026-03-23T17:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: MCXA156 FLASH remapping through ROM Bootloader</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXA156-FLASH-remapping-through-ROM-Bootloader/m-p/2338184#M5075</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/256858"&gt;@AlexRu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;Based on the information from sections 20.5.4, 7.3.6, and 7.6.1.2 of the user manual, the following conclusions can be made:&lt;/DIV&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snipaste_2026-03-24_15-05-52.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/380156iA0367B784116A7FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snipaste_2026-03-24_15-05-52.png" alt="Snipaste_2026-03-24_15-05-52.png" /&gt;&lt;/span&gt;
&lt;P&gt; &lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snipaste_2026-03-24_15-06-23.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/380157i16CF4703578521AB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snipaste_2026-03-24_15-06-23.png" alt="Snipaste_2026-03-24_15-06-23.png" /&gt;&lt;/span&gt;
&lt;P&gt;1. The actual flash remapping range is determined by the FMC.REMAP register (LIM/LIMDP) with an 8 KB granularity.&lt;BR /&gt;The REMAP register defines remap_address[19:13], meaning the remap size is (LIM + 1) × 8 KB.&lt;BR /&gt;For a 1 MB flash device, the lower half is 512 KB, so the maximum valid LIM value is 0x3F, allowing a full 512 KB swap.&lt;/P&gt;
&lt;P&gt;2. The CMPA field FLASH_REMAP_SZ is only a boot-time default value loaded by the ROM Bootloader.&lt;BR /&gt;Its maximum allowable value is a limitation of the CMPA structure/ROM—not a hardware limitation.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;3. Configuring FMC.REMAP at runtime is an officially supported mechanism.&lt;BR /&gt;The REMAP register uses a key-write scheme (A5A5/5A5A), and writes are allowed unless REMAPLK is set.&lt;BR /&gt;This clearly indicates that user software is allowed to update LIM/LIMDP to any value permitted by hardware.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Mar 2026 07:09:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXA156-FLASH-remapping-through-ROM-Bootloader/m-p/2338184#M5075</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2026-03-24T07:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: MCXA156 FLASH remapping through ROM Bootloader</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXA156-FLASH-remapping-through-ROM-Bootloader/m-p/2338230#M5077</link>
      <description>Hello Harry, thank you for the quick response and confirmation.&lt;BR /&gt;Do you have any further documents or details on the functionallity of the ROM Bootloader (+ Extended Bootloader)?&lt;BR /&gt;To my understanding it is intended by NXP to use the ROM API for a defined write procedure into the FLASH.&lt;BR /&gt;Does NXP recommend to use special "margin read" commands after programming to verify the quality of FLASH programming gate charge?&lt;BR /&gt;Or is it enough to readback over the FLASH_VerifyProgram() command?&lt;BR /&gt;We are planing field updates for our application and want to maximize the durability of our System.&lt;BR /&gt;Appreciating your support!&lt;BR /&gt;Best regards&lt;BR /&gt;Alex</description>
      <pubDate>Tue, 24 Mar 2026 08:09:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXA156-FLASH-remapping-through-ROM-Bootloader/m-p/2338230#M5077</guid>
      <dc:creator>AlexRu</dc:creator>
      <dc:date>2026-03-24T08:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: MCXA156 FLASH remapping through ROM Bootloader</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXA156-FLASH-remapping-through-ROM-Bootloader/m-p/2338949#M5092</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/256858"&gt;@AlexRu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;About the&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;ROM Bootloader document, i think you can refer to the MCXA156 reference manual MCXAP100M96FS6RM Chapter 20 and AN14525&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://docs.nxp.com/bundle/AN14525/page/topics/mcx_a14x_a15x_secure_boot_based_on_mcuboot.html" target="_blank"&gt;AN14525: MCXA14x/15x Secure Boot Based on MCUBoot | NXP Semiconductors.&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;MCXA's ROM Flash API does not include Margin Read.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The following are the supported functions.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;typedef struct _flash_driver_interface
{
    /* Flash driver */
    status_t (*flash_init)(flash_config_t *config);
    status_t (*flash_erase_sector)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes, uint32_t key);
    status_t (*flash_program_phrase)(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes);
    status_t (*flash_program_page)(flash_config_t *config, uint32_t start, uint8_t *src, uint32_t lengthInBytes);
    status_t (*flash_verify_program)(flash_config_t *config,
                                     uint32_t start,
                                     uint32_t lengthInBytes,
                                     const uint8_t *expectedData,
                                     uint32_t *failedAddress,
                                     uint32_t *failedData);
    status_t (*flash_verify_erase_phrase)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
    status_t (*flash_verify_erase_page)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
    status_t (*flash_verify_erase_sector)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
    status_t (*flash_get_property)(flash_config_t *config, flash_property_tag_t whichProperty, uint32_t *value);
    /* IFR driver */
#if !(defined(FSL_FEATURE_ROMAPI_IFR) &amp;amp;&amp;amp; (FSL_FEATURE_ROMAPI_IFR == 0U))
    status_t (*ifr_verify_erase_phrase)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
    status_t (*ifr_verify_erase_page)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
    status_t (*ifr_verify_erase_sector)(flash_config_t *config, uint32_t start, uint32_t lengthInBytes);
#endif
    status_t (*flash_read)(flash_config_t *config, uint32_t start, uint8_t *dest, uint32_t lengthInBytes);
    /* version */
    uint32_t version;
} flash_driver_interface_t;&lt;/LI-CODE&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Harry&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2026 03:49:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXA156-FLASH-remapping-through-ROM-Bootloader/m-p/2338949#M5092</guid>
      <dc:creator>Harry_Zhang</dc:creator>
      <dc:date>2026-03-25T03:49:26Z</dc:date>
    </item>
  </channel>
</rss>

