<?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 remap FlexRAM into a single data RAM area in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-to-remap-FlexRAM-into-a-single-data-RAM-area/m-p/1086413#M9393</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But wait, there's more: if you're using FreeRTOS, you will need to adapt it as well. Specifically, when starting the scheduler, the stack discards the rest of the stack, and sets the MSP back to the initial value. In the remapped case this isn't good, so you'll need to change that to the desired top of the stack:&lt;/P&gt;&lt;PRE class="language-c"&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;extern&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;_vStackTop&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;prvPortStartFirstTask&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;/* Start the first task.  This also clears the bit that indicates the FPU is
    in use in case the FPU was used before the scheduler was started - which
    would otherwise result in the unnecessary leaving of space in the SVC stack
    for lazy saving of FPU registers. */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#if !INCLUDE_vTaskEndScheduler&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;/* The start of the stack doesn't match the initial stack! */&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;stackTop &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;_vStackTop&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    __asm &lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"MSR msp, %0"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"r"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;stackTop&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* Set the msp back to the start of the stack. */&lt;/SPAN&gt;
    __asm &lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" mov r0, #0            \n"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* Clear the bit that indicates the FPU is in use, see comment above. */&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" msr control, r0       \n"&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#else&lt;/SPAN&gt;
    __asm &lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#endif&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" cpsie i               \n"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* Globally enable interrupts. */&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" cpsie f               \n"&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" dsb                   \n"&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" isb                   \n"&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" svc 0                 \n"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* System call to start first task. */&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" nop                   \n"&lt;/SPAN&gt;
                &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jul 2020 07:36:38 GMT</pubDate>
    <dc:creator>benedek_kupper</dc:creator>
    <dc:date>2020-07-24T07:36:38Z</dc:date>
    <item>
      <title>How to remap FlexRAM into a single data RAM area</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-to-remap-FlexRAM-into-a-single-data-RAM-area/m-p/1086410#M9390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd like to share my struggles and eventual success on putting the fragmented default FlexRAM layout of the i.MX RT1010 together on to a single block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for doing this is that there's large third party libraries which require large chunks of RAM, so we need to utilize all available amount as data RAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I went about reading the FlexRAM application notes, and tried to set the registers based on that description. That didn't work, so I checked the FlexRAM driver, and there's actually the &lt;EM&gt;FLEXRAM_AllocateRam()&lt;/EM&gt; function in fsl_flexram.c, which does exactly what I need. What needs to be determined is, when to call this function. Since the application data already extended beyond the default DTCM size, the RAM needs to be remapped before the RAM variables are initialized at startup (otherwise the initial values would be written to nonexistent addresses). Therefore this call should be added to the strong &lt;EM&gt;SystemInitHook()&lt;/EM&gt; definition, which is called through &lt;EM&gt;SystemInit()&lt;/EM&gt;, from &lt;EM&gt;ResetISR()&lt;/EM&gt;, right before the RAM data is initialized.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I've added the &lt;EM&gt;FLEXRAM_AllocateRam()&lt;/EM&gt; call to remap all 4 RAM banks to DTCM, and I've modified the linker memory layout to have all of the 128K RAM at SRAM_DTCM. At this point the project builds, but I'm unable to even step into the &lt;EM&gt;ResetISR()&lt;/EM&gt;. It took me a while to realize the only reason that could lead to this: the first thing the CPU does before executing the &lt;EM&gt;ResetISR()&lt;/EM&gt; is that it uses the previous word in memory (the first word of the interrupt vector table) to set the stack pointer to. Well, as the stack is placed at the very end of the RAM, it doesn't exist at reset, since the FlexRAM isn't remapped yet. The best thing I could do is to introduce a separate stack for startup only, and then copy and relocate the stack after the FlexRAM is remapped:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These are my changes in startup_&amp;lt;chipname&amp;gt;.c :&lt;/P&gt;&lt;PRE&gt;// TODO: make sure this is sized properly (no overflow until __set_MSP() call)
__attribute__((used, section(".StartupStack")))
void* startupStack[64];
void* const startupStackEnd = &amp;amp;startupStack[(sizeof(startupStack)/sizeof(startupStack[0]))];

__attribute__ ((used, section(".isr_vector")))
void (* const g_pfnVectors[])(void) = {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Core Level - CM7
&amp;nbsp;&amp;nbsp; &amp;nbsp;startupStackEnd,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // The initial stack pointer
[...]&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&amp;nbsp; [inside ResetISR()]
&amp;nbsp;&amp;nbsp;&amp;nbsp; SystemInit();
&amp;nbsp;&amp;nbsp;&amp;nbsp; // relocate stack to official position as it's now mapped
&amp;nbsp;&amp;nbsp; &amp;nbsp;{
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned int msp;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned int* currentStack = startupStackEnd, *newStack = &amp;amp;_vStackTop;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;__asm volatile ("MRS %0, msp" : "=r" (msp) );
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;while (currentStack &amp;gt; (unsigned int*)msp)
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;newStack--;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;currentStack--;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*newStack = *currentStack;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;__asm volatile ("MSR msp, %0" : : "r" (newStack) : );
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Copy the data sections from flash to SRAM.
&amp;nbsp;&amp;nbsp;&amp;nbsp; [...]&lt;/PRE&gt;&lt;P&gt;By adding the ".StartupStack" section to .data in the managed linker script, the startup stack ends up at the very beginning of the DTCM (assuming there's no other custom sections preceding it), which exists at startup as DTCM has 1 bank allocated by default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At this point, the project would run. Sometimes. It definitely didn't run if optimizations are disabled, and with maximum optimizations it would stop working if recompiled for some trivial reason. Otherwise it would end up in HardFault due to memory access exception(s). When I tried to debug through &lt;EM&gt;FLEXRAM_AllocateRam()&lt;/EM&gt;, the strangest thing happened: the same image wouldn't throw fault when stepping through it. With no optimizations, it would always fault, so I stepped though the disassembly, and realized the error in this code:&lt;/P&gt;&lt;PRE&gt;IOMUXC_GPR-&amp;gt;GPR14 &amp;amp;= ~IOMUXC_GPR_GPR14_CM7_CFGDTCMSZ_MASK;
IOMUXC_GPR-&amp;gt;GPR14 |= IOMUXC_GPR_GPR14_CM7_CFGDTCMSZ(FLEXRAM_MapTcmSizeToRegister(dtcmBankNum));&lt;/PRE&gt;&lt;P&gt;The register is first cleared, then there's a function call, the result of which is then written to the register. The method of clearing these registers, and then writing them as a separate access, leaves an execution window open, where the RAM is in undefined state. By changing this and similar lines to perform the clear and write in a single register access, the faults no longer occur:&lt;/P&gt;&lt;PRE&gt;IOMUXC_GPR-&amp;gt;GPR14 = (IOMUXC_GPR-&amp;gt;GPR14 &amp;amp; (~IOMUXC_GPR_GPR14_CM7_CFGDTCMSZ_MASK)) | IOMUXC_GPR_GPR14_CM7_CFGDTCMSZ(FLEXRAM_MapTcmSizeToRegister(dtcmBankNum));&lt;/PRE&gt;&lt;P&gt;I've attached the entire fsl_flexram patch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: One more thing, the MPU configuration has to be adjusted to the new RAM space as well to allow unaligned accesses through the whole RAM region.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is all it takes to achieve something that really should be made simpler: map all onboard RAM for data use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would have greatly appreciated it if such example was already available in the NXP SDK, as this was a long and painful process. We have also contacted NXP FAE but got no follow-up on my initial questions. So my conclusion is: don't expect more than what you pay for with this chip.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2020 09:43:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-to-remap-FlexRAM-into-a-single-data-RAM-area/m-p/1086410#M9390</guid>
      <dc:creator>benedek_kupper</dc:creator>
      <dc:date>2020-07-10T09:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to remap FlexRAM into a single data RAM area</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-to-remap-FlexRAM-into-a-single-data-RAM-area/m-p/1086411#M9391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Benedek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See &lt;A _jive_internal="true" class="link-titled" href="https://community.nxp.com/thread/536967#comment-1338266" title="https://community.nxp.com/thread/536967#comment-1338266"&gt;https://community.nxp.com/thread/536967#comment-1338266&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The uTasker project covers such needs out-of.the box and is compatible with 1010..1064.&lt;/P&gt;&lt;P&gt;It retains stack content across memory partition swaps (as illustrated in the document attached to the other thread).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[uTasker project developer for Kinetis and i.MX RT]&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2020 20:03:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-to-remap-FlexRAM-into-a-single-data-RAM-area/m-p/1086411#M9391</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-07-13T20:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to remap FlexRAM into a single data RAM area</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-to-remap-FlexRAM-into-a-single-data-RAM-area/m-p/1086412#M9392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;Benedek,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for sharing this! I will pass your feedback to the SDK team so they can consider adding something like this in future releases of the SDK.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Victor&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2020 17:33:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-to-remap-FlexRAM-into-a-single-data-RAM-area/m-p/1086412#M9392</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2020-07-17T17:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to remap FlexRAM into a single data RAM area</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-to-remap-FlexRAM-into-a-single-data-RAM-area/m-p/1086413#M9393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But wait, there's more: if you're using FreeRTOS, you will need to adapt it as well. Specifically, when starting the scheduler, the stack discards the rest of the stack, and sets the MSP back to the initial value. In the remapped case this isn't good, so you'll need to change that to the desired top of the stack:&lt;/P&gt;&lt;PRE class="language-c"&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;extern&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;_vStackTop&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;prvPortStartFirstTask&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;/* Start the first task.  This also clears the bit that indicates the FPU is
    in use in case the FPU was used before the scheduler was started - which
    would otherwise result in the unnecessary leaving of space in the SVC stack
    for lazy saving of FPU registers. */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#if !INCLUDE_vTaskEndScheduler&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;/* The start of the stack doesn't match the initial stack! */&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;stackTop &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;_vStackTop&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    __asm &lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"MSR msp, %0"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"r"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;stackTop&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* Set the msp back to the start of the stack. */&lt;/SPAN&gt;
    __asm &lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" mov r0, #0            \n"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* Clear the bit that indicates the FPU is in use, see comment above. */&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" msr control, r0       \n"&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#else&lt;/SPAN&gt;
    __asm &lt;SPAN class="keyword token"&gt;volatile&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#endif&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" cpsie i               \n"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* Globally enable interrupts. */&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" cpsie f               \n"&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" dsb                   \n"&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" isb                   \n"&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" svc 0                 \n"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* System call to start first task. */&lt;/SPAN&gt;
                    &lt;SPAN class="string token"&gt;" nop                   \n"&lt;/SPAN&gt;
                &lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 07:36:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-to-remap-FlexRAM-into-a-single-data-RAM-area/m-p/1086413#M9393</guid>
      <dc:creator>benedek_kupper</dc:creator>
      <dc:date>2020-07-24T07:36:38Z</dc:date>
    </item>
  </channel>
</rss>

