<?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 do I offset vector table jump addresses? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295721#M12170</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;Thank you for your post, however please consider moving it to the right community place (e.g. &lt;A _jive_internal="true" class="jivecontainerTT-hover-container jive-link-community-small" data-containerid="1" data-containertype="14" data-objectid="2019" data-objecttype="14" href="https://community.nxp.com/community/kinetis"&gt; Kinetis Microcontrollers&lt;/A&gt; ) to get it visible for active members.&lt;/P&gt;&lt;P&gt;For details please see general advice &lt;A _jive_internal="true" data-containerid="2001" data-containertype="14" data-objectid="99909" data-objecttype="102" href="https://community.nxp.com/docs/DOC-99909"&gt;Where to post a Discussion?&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for using Freescale Community. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 May 2014 08:14:54 GMT</pubDate>
    <dc:creator>Wlodek_D_</dc:creator>
    <dc:date>2014-05-12T08:14:54Z</dc:date>
    <item>
      <title>How do I offset vector table jump addresses?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295720#M12169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am integrating the new Kinetis bootloader into my MK10DX128VMP5 project.&amp;nbsp; I have my main application included in the bootloader project as a binary file which is placed at 0x00008000, with lower addresses reserved for the bootloader.&amp;nbsp; The bootloader works fine, but when the main app is built, its vector table doesn't know that the application will ultimately start at at 0x00008000 instead of 0x00000000. So, a jump location within the table might be 0x0000&lt;STRONG&gt;0123&lt;/STRONG&gt;, but the actual target code is at 0x000&lt;STRONG&gt;8123&lt;/STRONG&gt;.&amp;nbsp; The end result is that the bootloader jumps to the wrong place and none of my interrupts work.&amp;nbsp; &lt;SPAN style="text-decoration: underline;"&gt;How do I compensate for this offset when my main app is built?&lt;/SPAN&gt;&amp;nbsp; Changing linker addresses just seems to offset everything in parallel, maintaining the offset.&amp;nbsp; There seems to be a lot of info about vector reallocation (which I'm not sure that I need), but not so much about vector redirection / offsetting.&amp;nbsp; The table location is ok, it's just the entries that need to be offset.&amp;nbsp; It's strange, because I had done something similar months ago with CW and didn't have this problem.&amp;nbsp; Now I'm using IAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to assume the solution is in the linker.&amp;nbsp; My linker looks like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define symbol m_interrupts_start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00008000; &lt;BR /&gt;define symbol m_interrupts_end&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x000083FF;&lt;/P&gt;&lt;P&gt;define symbol m_text_start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x00008400;&lt;BR /&gt;define symbol m_text_end&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; = 0x0001FFFF;&lt;/P&gt;&lt;P&gt;define symbol m_data_start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x1FFFE000;&lt;BR /&gt;define symbol m_data_end&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; = 0x1FFFFFFF;&lt;/P&gt;&lt;P&gt;define symbol m_data_2_start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x20000000;&lt;BR /&gt;define symbol m_data_2_end&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x20001FFF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*-Sizes-*/&lt;BR /&gt;define symbol __size_cstack__&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x0800;&lt;BR /&gt;define symbol __size_heap__&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x0000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define memory mem with size = 4G;&lt;/P&gt;&lt;P&gt;define region ROM_region&amp;nbsp;&amp;nbsp; = mem:[from m_interrupts_start to m_interrupts_end] | mem:[from m_text_start to m_text_end];&lt;/P&gt;&lt;P&gt;define region RAM_region&amp;nbsp;&amp;nbsp; = mem:[from m_data_start to m_data_end];&lt;/P&gt;&lt;P&gt;define region m_data_2_region = mem:[from m_data_2_start to m_data_2_end];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define block CSTACK&amp;nbsp;&amp;nbsp;&amp;nbsp; with alignment = 8, size = __size_cstack__&amp;nbsp;&amp;nbsp; { };&lt;BR /&gt;define block HEAP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with alignment = 8, size = __size_heap__&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { };&lt;/P&gt;&lt;P&gt;define exported symbol __VECTOR_TABLE_START = m_interrupts_start;&lt;BR /&gt;define exported symbol __vect_table = m_interrupts_start;&lt;/P&gt;&lt;P&gt;define exported symbol __VECTOR_TABLE = 0x1fffe000;&lt;BR /&gt;define exported symbol __VECTOR_RAM = 0x1fffe000;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;initialize by copy { readwrite };&lt;BR /&gt;do not initialize&amp;nbsp; { section .noinit };&lt;BR /&gt;place at address mem: m_interrupts_start { readonly section .intvec };&lt;BR /&gt;place in ROM_region&amp;nbsp;&amp;nbsp; { readonly };&lt;BR /&gt;place in RAM_region { readwrite, block CSTACK, block HEAP };&lt;BR /&gt;place in m_data_2_region {section m_data_2};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 19:55:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295720#M12169</guid>
      <dc:creator>jonathanscott</dc:creator>
      <dc:date>2014-05-09T19:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I offset vector table jump addresses?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295721#M12170</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;Thank you for your post, however please consider moving it to the right community place (e.g. &lt;A _jive_internal="true" class="jivecontainerTT-hover-container jive-link-community-small" data-containerid="1" data-containertype="14" data-objectid="2019" data-objecttype="14" href="https://community.nxp.com/community/kinetis"&gt; Kinetis Microcontrollers&lt;/A&gt; ) to get it visible for active members.&lt;/P&gt;&lt;P&gt;For details please see general advice &lt;A _jive_internal="true" data-containerid="2001" data-containertype="14" data-objectid="99909" data-objecttype="102" href="https://community.nxp.com/docs/DOC-99909"&gt;Where to post a Discussion?&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for using Freescale Community. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 08:14:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295721#M12170</guid>
      <dc:creator>Wlodek_D_</dc:creator>
      <dc:date>2014-05-12T08:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I offset vector table jump addresses?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295722#M12171</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 would recommend customer to refer AN4368 chapter 5 Developing new user applications about how to modify linker file and redirect vector table.&lt;/P&gt;&lt;P&gt;More detailed info, please check below link:&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4368.pdf"&gt;http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4368.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Wish it help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;BR /&gt;Ma Hui&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2014 07:28:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295722#M12171</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2014-05-13T07:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How do I offset vector table jump addresses?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295723#M12172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Ma, although the examples in that AN weren't very useful using IAR.&amp;nbsp; Regardless, I now have the bootloader jumping to the correct location.&amp;nbsp; The problem, though, is that my application interrupts don't seem to work.&amp;nbsp; To demonstrate, I generated a test application project using the same bootloader project (both attached).&amp;nbsp; The application contains a timer "TIMER1", which expires after 250ms, setting the FTM0_TOF bit.&amp;nbsp; Despite TOIE and TOF being set, though, the code never jumps to the ISR, which is properly listed in the vector table.&amp;nbsp; Can you figure out why?&amp;nbsp; It's driving me crazy!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IAR_TEST is the top-level workspace and application project.&lt;/P&gt;&lt;P&gt;K10_Bootloader is the bootloader project.&lt;/P&gt;&lt;P&gt;The extra "src" file is located where it is because the compiler couldn't find the files after I copied the project and changing the include paths didn't fix it(sorry). &lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 May 2014 17:04:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295723#M12172</guid>
      <dc:creator>jonathanscott</dc:creator>
      <dc:date>2014-05-14T17:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: How do I offset vector table jump addresses?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295724#M12173</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;Please check attached project, which is using TimerInt_LDD component based on FRDM-K20D50M board with CodeWarrior for MCU V10.6. It will generate timer interrupt every 250ms.&lt;BR /&gt;Wish it help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;BR /&gt;Ma Hui&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 08:35:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295724#M12173</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2014-05-15T08:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I offset vector table jump addresses?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295725#M12174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved.&amp;nbsp; PRIMASK was set in the bootloader and never cleared.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 16:58:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-offset-vector-table-jump-addresses/m-p/295725#M12174</guid>
      <dc:creator>jonathanscott</dc:creator>
      <dc:date>2014-05-15T16:58:05Z</dc:date>
    </item>
  </channel>
</rss>

