<?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>CodeWarrior Development ToolsのトピックRe: jump to new application code</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/jump-to-new-application-code/m-p/337494#M1356</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mehdi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your application (not the bootloader) are you sure you have set the vector table to be in RAM and set the proper address for it.&amp;nbsp; Also are you copying your applications vectors to that location in ram when it starts up?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Sep 2014 19:36:35 GMT</pubDate>
    <dc:creator>travis_l</dc:creator>
    <dc:date>2014-09-18T19:36:35Z</dc:date>
    <item>
      <title>jump to new application code</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/jump-to-new-application-code/m-p/337492#M1354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a new application and I have created a new srec file based on the linker below:&lt;/P&gt;&lt;P&gt;MEMORY {&lt;/P&gt;&lt;P&gt;&amp;nbsp; m_interrupts (RX) : ORIGIN = 0x00040000, LENGTH = 0x000001E0&lt;/P&gt;&lt;P&gt;&amp;nbsp; m_text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX) : ORIGIN = 0x00040410, LENGTH = 0x00019410&lt;/P&gt;&lt;P&gt;&amp;nbsp; m_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000&lt;/P&gt;&lt;P&gt;&amp;nbsp; m_factory_param (R) : ORIGIN = 0x0007C000, LENGTH = 0x00000400&lt;/P&gt;&lt;P&gt;&amp;nbsp; m_data_20000000 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00010000&lt;/P&gt;&lt;P&gt;&amp;nbsp; m_cfmprotrom&amp;nbsp;&amp;nbsp; (RX) : ORIGIN = 0x00040400, LENGTH = 0x00000010&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe that I have to jump to the start address of the vector table which is 0x40000 here.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My jump function is looking like this:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void switch_mode(UINT32 IMAGE_ADDR)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; static uint_32 New_sp,New_pc; /* stack pointer and program counter */&lt;/P&gt;&lt;P&gt;&amp;nbsp; volatile uint_32 temp = 1; /* default the button is not pressed */&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Get PC and SP of application region */&lt;/P&gt;&lt;P&gt;&amp;nbsp; New_sp = ((uint_32 *) IMAGE_ADDR)[0];&lt;/P&gt;&lt;P&gt;&amp;nbsp; New_pc = ((uint_32 *) IMAGE_ADDR)[1];&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (temp) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; if ((New_sp != 0xffffffff) &amp;amp;&amp;amp; (New_pc != 0xffffffff)) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Run the application */&lt;/P&gt;&lt;P&gt;&amp;nbsp; asm {&lt;/P&gt;&lt;P&gt;&amp;nbsp; ldr r4,=New_sp&lt;/P&gt;&lt;P&gt;&amp;nbsp; ldr sp, [r4]&lt;/P&gt;&lt;P&gt;&amp;nbsp; ldr r4,=New_pc&lt;/P&gt;&lt;P&gt;&amp;nbsp; ldr r5, [r4]&lt;/P&gt;&lt;P&gt;&amp;nbsp; blx r5&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; } /* EndIf */&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;} /* EndBody */&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I use this function by calling it and pass-in the starting address of my application (0x40000), it resets my core and starts my old application (which is at address zero).&lt;/P&gt;&lt;P&gt;I pass in switch_mode(0x00040000)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you tell me if my function is correct? and if so, why it is not jumping to the start of my new application and instead it is jumping back to the start of my old application which is located at address zero. How can this be possible?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ps. BTW, and FYI, My chip is MK60DN512VLL10, and I am using CodeWarrior 10.5 - bare board with Processor expert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 20:03:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/jump-to-new-application-code/m-p/337492#M1354</guid>
      <dc:creator>mehdikarimibiuk</dc:creator>
      <dc:date>2014-09-03T20:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: jump to new application code</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/jump-to-new-application-code/m-p/337493#M1355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot build your code. Can you attach a simple project?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Sep 2014 21:39:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/jump-to-new-application-code/m-p/337493#M1355</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2014-09-08T21:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: jump to new application code</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/jump-to-new-application-code/m-p/337494#M1356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mehdi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your application (not the bootloader) are you sure you have set the vector table to be in RAM and set the proper address for it.&amp;nbsp; Also are you copying your applications vectors to that location in ram when it starts up?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 19:36:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/jump-to-new-application-code/m-p/337494#M1356</guid>
      <dc:creator>travis_l</dc:creator>
      <dc:date>2014-09-18T19:36:35Z</dc:date>
    </item>
  </channel>
</rss>

