<?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>LPC Microcontrollers中的主题 Re: Re-map vector table to SRAM - LPC51U68</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Re-map-vector-table-to-SRAM-LPC51U68/m-p/870840#M34730</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp; Carlos,&lt;/P&gt;&lt;P&gt;Yes, you need to change the content of the VTOR , also need to configure SP before jump, the code like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;typedef&amp;nbsp; void (*pFunction)(void);&lt;BR /&gt;pFunction Jump_To_Application;&lt;BR /&gt;static uint32_t JumpAddress;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;void run_to_app(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Jump to user application */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jump_To_Application = (pFunction) JumpAddress;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Initialize user application's S4tack Pointer */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __set_MSP(*(__IO uint32_t*) ApplicationAddress); &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; // the contents of the first address of the image, not the address itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB-&amp;gt;VTOR&amp;nbsp; = ApplicationAddress &amp;amp; 0x1FFFFF80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jump_To_Application();&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Feb 2019 07:16:35 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2019-02-20T07:16:35Z</dc:date>
    <item>
      <title>Re-map vector table to SRAM - LPC51U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Re-map-vector-table-to-SRAM-LPC51U68/m-p/870837#M34727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working with LPC51u68, and I want to&amp;nbsp;copy the vector table from flash to SRAM0.&lt;/P&gt;&lt;P&gt;Vector table is at 0x00000000 at flash and need to go to 0x20000000, from what I understand from the user manual.&lt;/P&gt;&lt;P&gt;I used the VTOR register, and developed the following function:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/72372i9E6C7BD232AE9C29/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What do you think of my approach is it correct? I am having doubts on using g_pfnVectors defined in the srtatrup file, is this really my vector table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Carlos Medeiros&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Feb 2019 14:49:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Re-map-vector-table-to-SRAM-LPC51U68/m-p/870837#M34727</guid>
      <dc:creator>carlosmedeiros</dc:creator>
      <dc:date>2019-02-18T14:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Re-map vector table to SRAM - LPC51U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Re-map-vector-table-to-SRAM-LPC51U68/m-p/870838#M34728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" data-content-finding="Community" data-userid="332183" data-username="carlosmedeiros" href="https://community.nxp.com/people/carlosmedeiros"&gt;Carlos Medeiros&lt;/A&gt; ,&lt;/P&gt;&lt;P&gt;You can directly define the Destination address to 0x20000000, Source address is 0x00000000,&lt;/P&gt;&lt;P&gt;like this:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;void CopyInterruptToSRAM(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned int * flashPtr, * ramPtr;&lt;BR /&gt;&amp;nbsp; unsigned int * uLimit = (unsigned int *) 0x100;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ramPtr = (unsigned int *)0x20000000;&amp;nbsp;&amp;nbsp; &amp;nbsp;//load RAM starting at 0x20000000,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;flashPtr = (unsigned int *)0x0000;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//start of interrupt vector table&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; while(flashPtr &amp;lt; uLimit)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*ramPtr = *flashPtr;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ramPtr++;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;flashPtr++;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;BTW, do you development Secondary bootloader ? If yes, are you sure remap data from 0x000 to SRAM？&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2019 08:50:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Re-map-vector-table-to-SRAM-LPC51U68/m-p/870838#M34728</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2019-02-19T08:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Re-map vector table to SRAM - LPC51U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Re-map-vector-table-to-SRAM-LPC51U68/m-p/870839#M34729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alice!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's me Carlos, I had to change my email.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the reply it was very helpful.&lt;/P&gt;&lt;P&gt;One more question, I understand the CopyInterruptToSRAM(), but after this I need to change the content of the VTOR right?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;------------------------------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Quote:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;BTW, do you development Secondary bootloader ? If yes, are you sure remap data from 0x000 to SRAM？&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;---------------------------------------------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I have my bootloader in flash and my APP on SRAM, so I need the remap function when I want to do a jump to APP or jump to boot.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Thank you,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Carlos Medeiros&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2019 09:19:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Re-map-vector-table-to-SRAM-LPC51U68/m-p/870839#M34729</guid>
      <dc:creator>chc_medeiros</dc:creator>
      <dc:date>2019-02-19T09:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Re-map vector table to SRAM - LPC51U68</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Re-map-vector-table-to-SRAM-LPC51U68/m-p/870840#M34730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp; Carlos,&lt;/P&gt;&lt;P&gt;Yes, you need to change the content of the VTOR , also need to configure SP before jump, the code like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;typedef&amp;nbsp; void (*pFunction)(void);&lt;BR /&gt;pFunction Jump_To_Application;&lt;BR /&gt;static uint32_t JumpAddress;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;void run_to_app(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Jump to user application */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jump_To_Application = (pFunction) JumpAddress;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Initialize user application's S4tack Pointer */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __set_MSP(*(__IO uint32_t*) ApplicationAddress); &lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; // the contents of the first address of the image, not the address itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCB-&amp;gt;VTOR&amp;nbsp; = ApplicationAddress &amp;amp; 0x1FFFFF80;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jump_To_Application();&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2019 07:16:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Re-map-vector-table-to-SRAM-LPC51U68/m-p/870840#M34730</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2019-02-20T07:16:35Z</dc:date>
    </item>
  </channel>
</rss>

