<?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>MPC5xxxのトピックRe: Programming to RAM through BAM</title>
    <link>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1218069#M17152</link>
    <description>&lt;P&gt;OK, this seems to be correct.&lt;/P&gt;
&lt;P&gt;Then I mentioned in the procedure (&lt;A title="https://community.nxp.com/thread/320166#comment-384300" href="https://community.nxp.com/thread/320166#comment-384300" target="_blank" rel="noopener"&gt;https://community.nxp.com/thread/320166#comment-384300&lt;/A&gt;&lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;
&lt;P&gt;"Notice that downloading of code also initializes ECC. Area that is not written by BAM will contain ECC errors. If your application wants to use uninitialized RAM, it must be explicitly initialized by your SW. "&lt;/P&gt;
&lt;P&gt;In the linker file, stack is usually placed at the end of RAM memory. Do you load the image up to end of RAM / stack? If not, the RAM is not initialized. Second option is to initialize the rest of RAM by your startup files. This option is better, it's much faster than loading via BAM. See INIT_Derivative function. This can be used. It's not called in case of RAM project but you can reuse the code.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jan 2021 16:17:12 GMT</pubDate>
    <dc:creator>lukaszadrapa</dc:creator>
    <dc:date>2021-01-20T16:17:12Z</dc:date>
    <item>
      <title>Programming to RAM through BAM</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1216779#M17133</link>
      <description>&lt;P&gt;Hello everyone, the microcontroller I use is mpc5634m. Now I want to write the test program to RAM by using esci in BAM mode. The test program sends out a few characters, but the program is not executed in RAM. As a test comparison, I use OSBDM to brush the RAM program to the microcontroller. The program can be executed. I don't know why. Can someone help me? The following is the source program, and I use my own upper computer program to write RAM.mot data of the whole process.&lt;/P&gt;&lt;P&gt;I follow this step, modify the start address, and use 0xff to fill the discontinuous memory address in the upper computer program, but the result is still unsuccessful.&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="wordTrans2101568611"&gt;&lt;DIV class="wordTransIcon2101568611"&gt;&lt;A title="https://community.nxp.com/thread/320166#comment-384300" href="https://community.nxp.com/thread/320166#comment-384300" target="_blank" rel="noopener"&gt;https://community.nxp.com/thread/320166#comment-384300&lt;/A&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="wordTrans2101746372"&gt;&lt;DIV class="wordTransIcon2101746372"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="wordTrans2101169041"&gt;&lt;DIV class="wordTransIcon2101169041"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="wordTrans2101906609"&gt;&lt;DIV class="wordTransIcon2101906609"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 19 Jan 2021 10:00:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1216779#M17133</guid>
      <dc:creator>jasonhd</dc:creator>
      <dc:date>2021-01-19T10:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Programming to RAM through BAM</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1216967#M17139</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;typical issues are:&lt;/P&gt;
&lt;P&gt;- did you double check if the __start function is at 0x4000_0000?&lt;/P&gt;
&lt;P&gt;- are you waiting for echo bytes before sending next byte? Are all echo bytes correct?&lt;/P&gt;
&lt;P&gt;- are you sure the image is continuous?&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 14:53:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1216967#M17139</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2021-01-19T14:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Programming to RAM through BAM</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1217499#M17144</link>
      <description>&lt;P&gt;Thank you Lukas&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; I set the address to 0x40000100.&lt;/P&gt;&lt;P&gt;RAM.map is shown in the table below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jasonhd_0-1611104791670.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135256iC8F73BEBB88579DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jasonhd_0-1611104791670.png" alt="jasonhd_0-1611104791670.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;jasonhd_0-1611104791670.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When using OSBDM to debug ram target, the program counter (PC) points to:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jasonhd_1-1611104979513.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135257i7B73859D39095545/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jasonhd_1-1611104979513.png" alt="jasonhd_1-1611104979513.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;jasonhd_1-1611104979513.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When the host computer sends, the address is the same：&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jasonhd_2-1611105214642.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135258i2ACDFB6101ABA7D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jasonhd_2-1611105214642.png" alt="jasonhd_2-1611105214642.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;jasonhd_2-1611105214642.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. Yes, I check each echo byte in the host computer, and continue to send the next byte after confirming the consistency.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jasonhd_3-1611105512925.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135259iCEB0D9DEBBBE407C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jasonhd_3-1611105512925.png" alt="jasonhd_3-1611105512925.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;jasonhd_3-1611105512925.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3. RAM.mot is not continuous, but I set it to be filled with 0xff in the sending program of upper computer.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jasonhd_4-1611105648086.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135260iABDFEB98DD8DAC38/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jasonhd_4-1611105648086.png" alt="jasonhd_4-1611105648086.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;jasonhd_4-1611105648086.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jasonhd_5-1611105747576.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135262i84F7B071FCAF30EF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jasonhd_5-1611105747576.png" alt="jasonhd_5-1611105747576.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;jasonhd_5-1611105747576.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="wordTrans2101812511"&gt;&lt;DIV class="wordTransIcon2101812511"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="wordTrans2101560393"&gt;&lt;DIV class="wordTransIcon2101560393"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Jan 2021 01:26:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1217499#M17144</guid>
      <dc:creator>jasonhd</dc:creator>
      <dc:date>2021-01-20T01:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Programming to RAM through BAM</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1218069#M17152</link>
      <description>&lt;P&gt;OK, this seems to be correct.&lt;/P&gt;
&lt;P&gt;Then I mentioned in the procedure (&lt;A title="https://community.nxp.com/thread/320166#comment-384300" href="https://community.nxp.com/thread/320166#comment-384300" target="_blank" rel="noopener"&gt;https://community.nxp.com/thread/320166#comment-384300&lt;/A&gt;&lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;
&lt;P&gt;"Notice that downloading of code also initializes ECC. Area that is not written by BAM will contain ECC errors. If your application wants to use uninitialized RAM, it must be explicitly initialized by your SW. "&lt;/P&gt;
&lt;P&gt;In the linker file, stack is usually placed at the end of RAM memory. Do you load the image up to end of RAM / stack? If not, the RAM is not initialized. Second option is to initialize the rest of RAM by your startup files. This option is better, it's much faster than loading via BAM. See INIT_Derivative function. This can be used. It's not called in case of RAM project but you can reuse the code.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 16:17:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1218069#M17152</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2021-01-20T16:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Programming to RAM through BAM</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1219518#M17173</link>
      <description>&lt;P&gt;Sorry, I don't know how to use that function to initialize RAM? Call in __start or in main function? Initialize all ram or unused ram of my image, because the image is divided into several areas intermittently. By the way, in today's experiment, it happened that the program could work several times after using BAM to swipe into RAM, but it stopped automatically after a few minutes, and it didn't work every time without any change, but sometimes it didn't work. I don't know if it was the reason of ECC.&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="wordTrans2101229482"&gt;&lt;DIV class="wordTransIcon2101229482"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="wordTrans2101295694"&gt;&lt;DIV class="wordTransIcon2101295694"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="wordTrans2101441457"&gt;&lt;DIV class="wordTransIcon2101441457"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Jan 2021 09:42:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1219518#M17173</guid>
      <dc:creator>jasonhd</dc:creator>
      <dc:date>2021-01-22T09:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Programming to RAM through BAM</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1219680#M17178</link>
      <description>&lt;P&gt;Here you can find the reason why it is necessary to initialize the SRAM:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_0-1611326686145.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135588i42ECA1AE73D187EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_0-1611326686145.png" alt="lukaszadrapa_0-1611326686145.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;lukaszadrapa_0-1611326686145.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It's necessary to initialize SRAM in startup files before you read or write the SRAM. Easiest way: search for MPC55xx_init_debug.c file and change&lt;/P&gt;
&lt;P&gt;#define INIT_DERIVATIVE_INTERNAL_SETUP 0&lt;/P&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;P&gt;#define INIT_DERIVATIVE_INTERNAL_SETUP 1&lt;/P&gt;
&lt;P&gt;Then function INIT_Derivative will be called in startup files.&lt;/P&gt;
&lt;P&gt;It is necessary to change the base address and size. In the original code, base address is 0x4000_0000. You need to change it to end of your RAM image. Align the address to 128 bytes. And then change also the size.&lt;/P&gt;
&lt;P&gt;stmw instruction is used for initialization - it writes all 32 general purpose core registers to SRAM.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When reading the description, I guess that it's really caused by the ECC.&lt;/P&gt;
&lt;P&gt;And also be aware that core watchdog is enabled:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lukaszadrapa_1-1611327085854.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/135589iAFC83D0C51FEBA42/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lukaszadrapa_1-1611327085854.png" alt="lukaszadrapa_1-1611327085854.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;lukaszadrapa_1-1611327085854.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It's necessary to refresh it or disable it.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 14:52:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1219680#M17178</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2021-01-22T14:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: Programming to RAM through BAM</title>
      <link>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1220888#M17194</link>
      <description>&lt;P&gt;Thanks. When I initialized ram and disabled the core watchdog, it worked.&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="wordTrans2101318737"&gt;&lt;DIV class="wordTransIcon2101318737"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="wordTrans2101978026"&gt;&lt;DIV class="wordTransIcon2101978026"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 26 Jan 2021 01:08:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/Programming-to-RAM-through-BAM/m-p/1220888#M17194</guid>
      <dc:creator>jasonhd</dc:creator>
      <dc:date>2021-01-26T01:08:22Z</dc:date>
    </item>
  </channel>
</rss>

