<?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>i.MX Processors中的主题 FlexRAM reconfiguration without ITCM</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/FlexRAM-reconfiguration-without-ITCM/m-p/1458098#M190357</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm working on a board with an RT1010.&lt;/P&gt;&lt;P&gt;I'm trying to configure FlexRAM to use 64 kB of DTCM and 64 kB of OCRAM, with 0 for ITCM. I followed the instructions in&amp;nbsp;&lt;A href="https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/Reallocating-the-FlexRAM/ta-p/1117649" target="_self"&gt;this post.&lt;/A&gt;&amp;nbsp;My code starts running but it hardfaults shortly after starting, but it does run a bit. I can't seem to be able to debug it beyond that point.&lt;/P&gt;&lt;P&gt;My project is set up using the SDK from&amp;nbsp;&lt;A href="https://github.com/NXPmicro/mcux-sdk" target="_self"&gt;Github&lt;/A&gt;. It seems that there are some difference in the source files, but I think I managed to do everything the right way (I hope).&lt;/P&gt;&lt;P&gt;I made the following modifications:&lt;/P&gt;&lt;P&gt;To `startup_MIMXRT1011.S`:&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;    /* Customized FlexRAM bank configuration at runtime */
    ldr     r0, =0x400ac044     /* Address of register IOMUXC_GPR_GPR17 */
    ldr     r1, =0x000000a5     /* FlexRAM configuration: OCRAM 64 kB (bank 0 and 1), DTCM 64 kB (bank 2 and 3) */
    str     r1, [r0]

    /* Tell the MCU to configure the FlexRAM banks from the register, not from fuses */
    ldr     r0, =0x400ac040     /* Address of register IOMUXC_GPR_GPR16 */
    ldr     r1, [r0]
    orr     r1, r1, #4          /* The 4 corresponds to setting the FLEXRAM_BANK_CFG_SEL bit in register IOMUXC_GPR_GPR16 */
    str     r1, [r0]

    /* Disable ITCM, we are not using it */
    ldr     r0, =0x400ac040     /* Address of register IOMUXC_GPR_GPR16 */
    ldr     r1, [r0]
    and     r1, r1, #0xfffffffe /* Clear INIT_ITCM_EN bit in register IOMUXC_GPR_GPR16: We have configured the ITCM with size 0 */
    str     r1, [r0]

    /* Adjust the DTCM/ITCM sizes */
    ldr     r0, =0x400ac038     /* Address of register IOMUXC_GPR_GPR14 */
    ldr     r1, [r0]
    and     r1, r1, #0xff00ffff /* Clear the ITCM/DTCM size bits in register IOMUXC_GPR_GPR14 */
    orr     r1, r1, #0x00700000 /* Set the bits for DTCM to have size 64 KB */
    str     r1, [r0]&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;In the function that configures the MPU:&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;    /* Region 5 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(5, 0x00000000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_32B);

    /* Region 6 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(6, 0x20000000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_64KB);

    /* Region 7 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(7, 0x20200000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_64KB);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached my linker script as a text file.&lt;/P&gt;&lt;P&gt;I have seen something about a flash driver file (&lt;A href="https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/How-to-create-a-new-Flash-driver-of-the-MCUXPresso-IDE/ta-p/1274718" target="_self"&gt;source&lt;/A&gt;), but I have no idea what that is or whether that is relevant in my case. I'm not using such a file AFAIK, I am flashing and debugging my device using a JLink.&lt;/P&gt;&lt;P&gt;I'd appreciate any help with this issue.&lt;/P&gt;</description>
    <pubDate>Fri, 13 May 2022 16:01:59 GMT</pubDate>
    <dc:creator>andyteufel</dc:creator>
    <dc:date>2022-05-13T16:01:59Z</dc:date>
    <item>
      <title>FlexRAM reconfiguration without ITCM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/FlexRAM-reconfiguration-without-ITCM/m-p/1458098#M190357</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm working on a board with an RT1010.&lt;/P&gt;&lt;P&gt;I'm trying to configure FlexRAM to use 64 kB of DTCM and 64 kB of OCRAM, with 0 for ITCM. I followed the instructions in&amp;nbsp;&lt;A href="https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/Reallocating-the-FlexRAM/ta-p/1117649" target="_self"&gt;this post.&lt;/A&gt;&amp;nbsp;My code starts running but it hardfaults shortly after starting, but it does run a bit. I can't seem to be able to debug it beyond that point.&lt;/P&gt;&lt;P&gt;My project is set up using the SDK from&amp;nbsp;&lt;A href="https://github.com/NXPmicro/mcux-sdk" target="_self"&gt;Github&lt;/A&gt;. It seems that there are some difference in the source files, but I think I managed to do everything the right way (I hope).&lt;/P&gt;&lt;P&gt;I made the following modifications:&lt;/P&gt;&lt;P&gt;To `startup_MIMXRT1011.S`:&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;    /* Customized FlexRAM bank configuration at runtime */
    ldr     r0, =0x400ac044     /* Address of register IOMUXC_GPR_GPR17 */
    ldr     r1, =0x000000a5     /* FlexRAM configuration: OCRAM 64 kB (bank 0 and 1), DTCM 64 kB (bank 2 and 3) */
    str     r1, [r0]

    /* Tell the MCU to configure the FlexRAM banks from the register, not from fuses */
    ldr     r0, =0x400ac040     /* Address of register IOMUXC_GPR_GPR16 */
    ldr     r1, [r0]
    orr     r1, r1, #4          /* The 4 corresponds to setting the FLEXRAM_BANK_CFG_SEL bit in register IOMUXC_GPR_GPR16 */
    str     r1, [r0]

    /* Disable ITCM, we are not using it */
    ldr     r0, =0x400ac040     /* Address of register IOMUXC_GPR_GPR16 */
    ldr     r1, [r0]
    and     r1, r1, #0xfffffffe /* Clear INIT_ITCM_EN bit in register IOMUXC_GPR_GPR16: We have configured the ITCM with size 0 */
    str     r1, [r0]

    /* Adjust the DTCM/ITCM sizes */
    ldr     r0, =0x400ac038     /* Address of register IOMUXC_GPR_GPR14 */
    ldr     r1, [r0]
    and     r1, r1, #0xff00ffff /* Clear the ITCM/DTCM size bits in register IOMUXC_GPR_GPR14 */
    orr     r1, r1, #0x00700000 /* Set the bits for DTCM to have size 64 KB */
    str     r1, [r0]&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;In the function that configures the MPU:&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;    /* Region 5 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(5, 0x00000000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_32B);

    /* Region 6 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(6, 0x20000000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_64KB);

    /* Region 7 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(7, 0x20200000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_64KB);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached my linker script as a text file.&lt;/P&gt;&lt;P&gt;I have seen something about a flash driver file (&lt;A href="https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/How-to-create-a-new-Flash-driver-of-the-MCUXPresso-IDE/ta-p/1274718" target="_self"&gt;source&lt;/A&gt;), but I have no idea what that is or whether that is relevant in my case. I'm not using such a file AFAIK, I am flashing and debugging my device using a JLink.&lt;/P&gt;&lt;P&gt;I'd appreciate any help with this issue.&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 16:01:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/FlexRAM-reconfiguration-without-ITCM/m-p/1458098#M190357</guid>
      <dc:creator>andyteufel</dc:creator>
      <dc:date>2022-05-13T16:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: FlexRAM reconfiguration without ITCM</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/FlexRAM-reconfiguration-without-ITCM/m-p/1473915#M191483</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;Hope you are well. I will gladly help you with this.&lt;/P&gt;
&lt;P&gt;I suggest you using the most recent SDK version from the SDK builder: &lt;A href="https://mcuxpresso.nxp.com/en/welcome" target="_blank"&gt;https://mcuxpresso.nxp.com/en/welcome&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If there is a request to have 0 kB of any TCM memory, disable the corresponding TCM before setting the size to 0 kB. Use the INT_xTCM_EN fields in the IOMUXC_GPR_GPR16 register to disable the corresponding xTCM memory before configuring it to 0 kB.&lt;/P&gt;
&lt;P&gt;If you have more questions do not hesitate to ask me.&lt;BR /&gt;Best regards,&lt;BR /&gt;Omar&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 23:36:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/FlexRAM-reconfiguration-without-ITCM/m-p/1473915#M191483</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2022-06-14T23:36:39Z</dc:date>
    </item>
  </channel>
</rss>

