<?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: Relocating Interrupt Vector Table When Using MQX in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899700#M18173</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Daniel.&amp;nbsp; Your boot.S and my boot.S are the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I tell the debugger to pause at the entry point (top of boot.S), my MSP/SP_MAIN/$SP_MAIN is set to 0xfffffffc.&amp;nbsp; I believe this is incorrect because it then gets used/copied here (within boot.S):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mrs r0, MSP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the debugger at the entry point to force SP_MAIN to be 0x20000000 (the start of RAM), then my code works fine.&amp;nbsp; Can you tell me where/how SP_MAIN is supposed to be set up?&amp;nbsp; I suspect the linker file is involved; if so, please attach your *.ld file so I can compare them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 May 2019 16:08:50 GMT</pubDate>
    <dc:creator>kackle123</dc:creator>
    <dc:date>2019-05-30T16:08:50Z</dc:date>
    <item>
      <title>Relocating Interrupt Vector Table When Using MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899696#M18169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can import an example Kinetis K64F Freedom board (FRDM-K64F) bareboard project, modify its linker file to something like the following (that is, relocate its interrupt vector table), and it still works fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;MEMORY&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vectorrom&amp;nbsp;&amp;nbsp; (RX): ORIGIN = 0x00001000, LENGTH = 0x00000400&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cfmprotrom&amp;nbsp; (R):&amp;nbsp; ORIGIN = 0x00001400, LENGTH = 0x00000020&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rom&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX): ORIGIN = 0x00001420, LENGTH = 0x000FeBE0&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ram&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x1FFF0000, LENGTH = 0x00040000&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I cannot do the same with an example MQX project; it crashes near __thumb_startup().&amp;nbsp; Upon loading the code, I&amp;nbsp;see with the debugger that the table has moved to 0x1000, which is correct.&amp;nbsp; But I suspect MQX or CodeWarrior (Kinetis Design Studio/KDS fails too) is not properly setting something else up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone please try loading the MQX 4 "hello world" project, confirm it executes, and then try using my linker file's MEMORY section above to see whether it still works?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2019 14:57:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899696#M18169</guid>
      <dc:creator>kackle123</dc:creator>
      <dc:date>2019-05-17T14:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Relocating Interrupt Vector Table When Using MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899697#M18170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kackle123:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed the linker file as your suggested in MQX hello world project&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MEMORY&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vectorrom&amp;nbsp;&amp;nbsp; (RX): ORIGIN = 0x00001000, LENGTH = 0x00000400&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cfmprotrom&amp;nbsp; (R): ORIGIN = 0x00001400, LENGTH = 0x00000020&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rom&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX): ORIGIN = 0x00001420, LENGTH = 0x000FeBE0&amp;nbsp; /* Code + Const data */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ram&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x1FFF0000, LENGTH = 0x00040000&amp;nbsp; /* SRAM - RW data */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* kernel space starts after RAM variables (Location of MQX Kernel data + MQX heap) */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end_of_kd&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x2002FFF0, LENGTH = 0x00000000&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Boot stack reused by MQX Kernel data */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bstack&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x2002FA00, LENGTH = 0x00000200&amp;nbsp; /* Boot stack */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end_bstack&amp;nbsp; (RW): ORIGIN = 0x2002FC00, LENGTH = 0x00000000&amp;nbsp; /* Boot stack end address requires 4B alignment */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It can work on my side.&lt;/P&gt;&lt;P&gt;Please note that should be a kernel space after RAM variables, which is MQX needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2019 07:00:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899697#M18170</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2019-05-22T07:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Relocating Interrupt Vector Table When Using MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899698#M18171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Daniel for trying that project.&amp;nbsp; My linker file's MEMORY portion looks like yours; I only showed part of it above to save space.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attached screen shot; it looks like the code is trying to push bytes onto the stack when the stack hasn't been set up yet.&amp;nbsp;&amp;nbsp; The code comment on the left says that __boot() (in boot.S) is supposed to set up the registers (and stack pointer) but it doesn't.&amp;nbsp; Can you attach your C:\Freescale\Freescale_MQX_4_2\mqx\source\psp\cortex_m\core\M4\boot.S so I can compare them?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2019 21:01:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899698#M18171</guid>
      <dc:creator>kackle123</dc:creator>
      <dc:date>2019-05-22T21:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Relocating Interrupt Vector Table When Using MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899699#M18172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Kackle123:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The boot.S I used is from MQX&amp;nbsp; package. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2019 08:07:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899699#M18172</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2019-05-29T08:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Relocating Interrupt Vector Table When Using MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899700#M18173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Daniel.&amp;nbsp; Your boot.S and my boot.S are the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I tell the debugger to pause at the entry point (top of boot.S), my MSP/SP_MAIN/$SP_MAIN is set to 0xfffffffc.&amp;nbsp; I believe this is incorrect because it then gets used/copied here (within boot.S):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mrs r0, MSP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use the debugger at the entry point to force SP_MAIN to be 0x20000000 (the start of RAM), then my code works fine.&amp;nbsp; Can you tell me where/how SP_MAIN is supposed to be set up?&amp;nbsp; I suspect the linker file is involved; if so, please attach your *.ld file so I can compare them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2019 16:08:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899700#M18173</guid>
      <dc:creator>kackle123</dc:creator>
      <dc:date>2019-05-30T16:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Relocating Interrupt Vector Table When Using MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899701#M18174</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;Please also see my attached link file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note there is a macro MQX_ROM_VECTORS in user_config.h&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/84295iE4E69CA911E66509/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can set MQX_ROM_VECTORS macro = 0 in user_config.h and rebuild bsp and psp. This will relocate vectors in RAM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2019 09:14:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899701#M18174</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2019-05-31T09:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Relocating Interrupt Vector Table When Using MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899702#M18175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;I don't want to locate my vector table in RAM.&amp;nbsp; I want to move it from 0x0 to another place in ROM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried changing MQX_ROM_VECTORS to 0 anyway, but it didn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After these lines (in boot.S), the stack should be initialized, but my stack is not:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Prepare process stack pointer */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mrs r0, MSP&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msr PSP, r0&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Switch to proccess stack (PSP) */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mrs r0, CONTROL&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know where MSP (in boot.S) is initialized?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2019 19:29:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899702#M18175</guid>
      <dc:creator>kackle123</dc:creator>
      <dc:date>2019-05-31T19:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Relocating Interrupt Vector Table When Using MQX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899703#M18176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I figured out a workaround to the MQX register-setup bug.&amp;nbsp; It seems to have something to do with a cold boot versus a warm boot, as described here: &lt;A _jive_internal="true" href="https://community.nxp.com/thread/323899"&gt;Problem of initialization of MQX...&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My fix was similar to what is described here: &lt;A _jive_internal="true" href="https://community.nxp.com/thread/358693"&gt;Bootloader mqx k64f&lt;/A&gt;.&amp;nbsp; But I used a variable from the linker script file to pass the stack pointer address(es) into my modified boot.S code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update: I later learned that the K64/ARM must have its vector table located at 0x0000 to know where to find the executable code.&amp;nbsp; The only reason that my table relocation works (without a bootloader's table located at 0x0000) is that the debugger initializes the MCU's program counter for me.&amp;nbsp; My code does not work without the debugger/programmer attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2019 19:25:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Relocating-Interrupt-Vector-Table-When-Using-MQX/m-p/899703#M18176</guid>
      <dc:creator>kackle123</dc:creator>
      <dc:date>2019-06-07T19:25:03Z</dc:date>
    </item>
  </channel>
</rss>

