<?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: Jumping from one image to another (5282). in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162185#M5237</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I do that very thing with this line:&lt;BR /&gt;&lt;BR /&gt;((void(*)(void))(_B_ImageInitialPC_))();&lt;BR /&gt;&lt;BR /&gt;where _B_ImageInitialPC_) is the address of the initial PC of the second image, after the vectors.&lt;BR /&gt;&lt;BR /&gt;Depending on your context you might need to disable interrupts before making the jump.&lt;BR /&gt;&lt;BR /&gt;-Josh&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jun 2008 05:51:33 GMT</pubDate>
    <dc:creator>jfint</dc:creator>
    <dc:date>2008-06-06T05:51:33Z</dc:date>
    <item>
      <title>Jumping from one image to another (5282).</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162184#M5236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have an image (BL) running in SRAM or Internal Flash from address (0 to 0x4000).&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;From this BL, I would like to jump to another application burned in&lt;BR /&gt;Internal Flash address 0x8000. Note that from 0x8000 to 0x8438, I have&lt;BR /&gt;the vector table as well as some data, so the actual code starts at 0x8438.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;What are the steps (in assembly I presume) to achieve this?&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;I tried the following without success:&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt; uint32 APP_START = 0x8438; asm ( move.w&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #0x2700,sr); // Disable interrupts asm ( MOVE.L&amp;nbsp;&amp;nbsp; (APP_START), A0); asm ( jmp&amp;nbsp;&amp;nbsp; (a0));&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;Simon&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:07:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162184#M5236</guid>
      <dc:creator>SVC1</dc:creator>
      <dc:date>2020-10-29T09:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from one image to another (5282).</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162185#M5237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I do that very thing with this line:&lt;BR /&gt;&lt;BR /&gt;((void(*)(void))(_B_ImageInitialPC_))();&lt;BR /&gt;&lt;BR /&gt;where _B_ImageInitialPC_) is the address of the initial PC of the second image, after the vectors.&lt;BR /&gt;&lt;BR /&gt;Depending on your context you might need to disable interrupts before making the jump.&lt;BR /&gt;&lt;BR /&gt;-Josh&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2008 05:51:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162185#M5237</guid>
      <dc:creator>jfint</dc:creator>
      <dc:date>2008-06-06T05:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from one image to another (5282).</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162186#M5238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;I think you're doing one memory read too many. You want to jump to 0x8438, not read the contents of 0x8438 and jump to whatever address you read from there. Try:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;uint32 APP_START = 0x8438;
 asm ( move.w   #0x2700,sr); // Disable interrupts
 asm ( MOVE.L   #APP_START, A0);
 asm ( jmp      (a0));&lt;/PRE&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Simon&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:07:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162186#M5238</guid>
      <dc:creator>SimonMarsden_de</dc:creator>
      <dc:date>2020-10-29T09:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from one image to another (5282).</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162187#M5239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I tried&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;asm ( move.w   #0x2700,sr); // Disable interrupts asm ( MOVE.L   #0x8438, A0); asm ( jmp      (a0));  &lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Still does not work. I get exceptions continiously:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp; Error on instruction fetch&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp; Access Error -- PC = 0x008438&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;which corresponds to:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;void mcf_exception_handler(void *framepointer) {   volatile unsigned long  stackFrameVector   = (unsigned long)MCF5XXX_RD_SF_VECTOR(&amp;amp;stackFrameWord);   switch (stackFrameVector)   { case 3:        VECTORDISPLAY3(MCF5XXX_EXCEPTFMT, "Address Error", stackFramePC);        switch (stackFrameFS)        {           case 4:              VECTORDISPLAY("Error on instruction fetch\n");               break;                ... ... ...&lt;/PRE&gt;&lt;PRE&gt;               }&lt;/PRE&gt;&lt;PRE&gt;         ....&lt;/PRE&gt;&lt;PRE&gt;   }&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;Simon&lt;BR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:08:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162187#M5239</guid>
      <dc:creator>SVC1</dc:creator>
      <dc:date>2020-10-29T09:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from one image to another (5282).</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162188#M5240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Actually, I can see that the first image (BL) is jumping to the right address and code. Nevertheless, the second I step through the first instruction, the exception is generated.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;S&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2008 23:17:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162188#M5240</guid>
      <dc:creator>SVC1</dc:creator>
      <dc:date>2008-06-06T23:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from one image to another (5282).</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162189#M5241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;You need to jump to the address after the vector table, I hve this setup in my .lcf file to be 0x400 ofter the image start.&amp;nbsp; you can view the correct target address with codewarrior by starting the run in flash emulator and looking at the PC registerr before hitting 'Go'&lt;BR /&gt;&lt;BR /&gt;I hope I'm on track here&lt;BR /&gt;&lt;BR /&gt;-josh&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jun 2008 00:05:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162189#M5241</guid>
      <dc:creator>jfint</dc:creator>
      <dc:date>2008-06-07T00:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from one image to another (5282).</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162190#M5242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi&lt;BR /&gt;&lt;BR /&gt;It's not this old favourite, is it???&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=1807&amp;amp;query.id=12299#M1807" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=1807&amp;amp;query.id=12299#M1807&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Simon&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jun 2008 00:10:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162190#M5242</guid>
      <dc:creator>SimonMarsden_de</dc:creator>
      <dc:date>2008-06-07T00:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from one image to another (5282).</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162191#M5243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I do have the protective words. Here is my vector table:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;VECTOR_TABLE:_VECTOR_TABLE:INITSP:  .long ___SP_AFTER_RESET /* 0 (0x000) Initial SP */INITPC:  .long _start   /* 1 (0x004) Initial PC */// ... ... ...vectorFF: .long _asm_isr_handler /* 255  Reserved    */  //  CFM Flash Configuration Field KEY_UPPER:  .long   0xAAAAAAAA  // 4 bytesKEY_LOWER:  .long   0xBBBBBBBB // 4 bytesCFMPROT:    .int    0xCCCC  // 2 bytesCFMSACC:    .int    0xDDDD  // 2 bytesCFMDACC:    .int    0xEEEE  // 2 bytesCFMSEC:     .int    0xFFFF  // 2 bytes     // total 16 bytes = 0x10/********************************************************************/// HeaderHEAD_SIGNATURE: .long   0x12351236   // 4 bytesVERSION:  .long   _DEF_SW_VERSION // 4 bytesN_WORDS:     .long   0xAAAAAAAA  // 4 bytesCHECKSUM:  .long   0xBBBBBBBB  // 4 bytesSPARE1:      .int    0x1111   // 2 bytesSPARE2:      .int    0x2222   // 2 bytesSPARE3:      .int    0x3333   // 2 bytesSPARE4:      .int    0x5555   // 2 bytes      // total 24 bytes = 0x18/********************************************************************/_start: move.w #0x2700,SR jmp _startup .end&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;I also see with CW than after the jump, it really goes to "move #9984, sr" at address 0x8438 and yet the next step results in generating the exception continuously.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Besides, the destination image starts at address 0x8000 so we are way passed the CFM protected area.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Simon&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:08:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162191#M5243</guid>
      <dc:creator>SVC1</dc:creator>
      <dc:date>2020-10-29T09:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Jumping from one image to another (5282).</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162192#M5244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I got it working.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It was the values of CFMPROT, which wasn't set to 0.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;Simon&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jun 2008 02:13:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Jumping-from-one-image-to-another-5282/m-p/162192#M5244</guid>
      <dc:creator>SVC1</dc:creator>
      <dc:date>2008-06-07T02:13:41Z</dc:date>
    </item>
  </channel>
</rss>

