<?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 VTOR setting in startup code in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/VTOR-setting-in-startup-code/m-p/762935#M650</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use MCUXpresso SDK: I noticed that in the startup code for all the compilers other than MCUXpresso, there is the code for setting&amp;nbsp;VTOR register before the call of the SystemInit function, but there isn't such code for MCUXpresso compiler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For ARM:&lt;/P&gt;&lt;P&gt;LDR R0, =0xE000ED08&lt;BR /&gt; LDR R1, =__Vectors&lt;BR /&gt; STR R1, [R0]&lt;BR /&gt; LDR R2, [R1]&lt;BR /&gt; MSR MSP, R2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For GCC:&lt;/P&gt;&lt;P&gt;.equ VTOR, 0xE000ED08&lt;BR /&gt; ldr r0, =VTOR&lt;BR /&gt; ldr r1, =__isr_vector&lt;BR /&gt; str r1, [r0]&lt;BR /&gt; ldr r2, [r1]&lt;BR /&gt; msr msp, r2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For IAR:&lt;/P&gt;&lt;P&gt;LDR R0, =0xE000ED08&lt;BR /&gt; LDR R1, =__vector_table&lt;BR /&gt; STR R1, [R0]&lt;BR /&gt; LDR R2, [R1]&lt;BR /&gt; MSR MSP, R2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the reason for this choice?&lt;/P&gt;&lt;P&gt;How can I set the VTOR register?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Biafra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Jan 2018 09:35:31 GMT</pubDate>
    <dc:creator>biafra</dc:creator>
    <dc:date>2018-01-04T09:35:31Z</dc:date>
    <item>
      <title>VTOR setting in startup code</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/VTOR-setting-in-startup-code/m-p/762935#M650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use MCUXpresso SDK: I noticed that in the startup code for all the compilers other than MCUXpresso, there is the code for setting&amp;nbsp;VTOR register before the call of the SystemInit function, but there isn't such code for MCUXpresso compiler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For ARM:&lt;/P&gt;&lt;P&gt;LDR R0, =0xE000ED08&lt;BR /&gt; LDR R1, =__Vectors&lt;BR /&gt; STR R1, [R0]&lt;BR /&gt; LDR R2, [R1]&lt;BR /&gt; MSR MSP, R2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For GCC:&lt;/P&gt;&lt;P&gt;.equ VTOR, 0xE000ED08&lt;BR /&gt; ldr r0, =VTOR&lt;BR /&gt; ldr r1, =__isr_vector&lt;BR /&gt; str r1, [r0]&lt;BR /&gt; ldr r2, [r1]&lt;BR /&gt; msr msp, r2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For IAR:&lt;/P&gt;&lt;P&gt;LDR R0, =0xE000ED08&lt;BR /&gt; LDR R1, =__vector_table&lt;BR /&gt; STR R1, [R0]&lt;BR /&gt; LDR R2, [R1]&lt;BR /&gt; MSR MSP, R2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the reason for this choice?&lt;/P&gt;&lt;P&gt;How can I set the VTOR register?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Biafra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2018 09:35:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/VTOR-setting-in-startup-code/m-p/762935#M650</guid>
      <dc:creator>biafra</dc:creator>
      <dc:date>2018-01-04T09:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: VTOR setting in startup code</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/VTOR-setting-in-startup-code/m-p/762936#M651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Francesco Bianchini&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As long as MCUXpresso IDE uses a GCC compiler, if you want to set VTOR register you could use the same code that you mentioned, you will only have to specify that you going to uses assembly code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Jorge Alcala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jan 2018 03:02:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/VTOR-setting-in-startup-code/m-p/762936#M651</guid>
      <dc:creator>jorge_a_vazquez</dc:creator>
      <dc:date>2018-01-09T03:02:27Z</dc:date>
    </item>
  </channel>
</rss>

