<?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: RAM vector table? K60 and MQX 4.0 in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248196#M7127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Typically you don't put vector table directly to RAM for internal flash targets. The vector table is located physically in internal flash in non-volatile memory and the startup code makes a copy from flash to RAM. Usually this is toolchain dependent, for example in CodeWarrior the startup code takes some symbols defined in the linker command file and makes the copy from source to destination. You should study documentation for your compiler and linker and see how it makes ROM to RAM copy at startup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To start, I would recommend linking your application with the MQX delivered linker command file, for example for TWR-K60F120M debug target this one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ${MQX_ROOT_DIR}\lib\twrk60f120m.iar\debug\bsp\intflash.icf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you using this linker file to link your application ? Is this working with standard example ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 May 2013 10:31:59 GMT</pubDate>
    <dc:creator>Martin_</dc:creator>
    <dc:date>2013-05-21T10:31:59Z</dc:date>
    <item>
      <title>RAM vector table? K60 and MQX 4.0</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248193#M7124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I seem to have permanently bricked the K60 trying to get this to work, so I'm not in the happiest frame of mind right now...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I am not using a bootloader but was trying to follow the app notes AN4379 / 4368as well as other postings here in order to use a RAM vector table so I could use the kernel level ISRs.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I rebuilt the libs with the&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-family: 'courier new', courier;"&gt; #define MQX_ROM_VECTORS&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the icf I have the line:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;place at address mem:__ICFEDIT_region_RAM_start__ { readwrite section .vectors_ram };&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;However, my app fell over as soon as the scheduler started, presumably as a result of the vector table not actaully being present in RAM (looking at the map file, there was no evidence&amp;nbsp; of it being put at the start of RAM). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The porblem being that the icf examples posted bear little resemblance to the example ones&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please elaborate on how to configure MQX to use the RAM vector table ? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 May 2013 21:56:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248193#M7124</guid>
      <dc:creator>gavroche123</dc:creator>
      <dc:date>2013-05-20T21:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: RAM vector table? K60 and MQX 4.0</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248194#M7125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TWR-K60F120M&lt;/P&gt;&lt;P&gt;MQX 4.0 (also MQX 4.0.1)&lt;/P&gt;&lt;P&gt;IAR 6.50&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;user configuration of twrk60f120m user_config.h:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_13691246609035276 jive_macro_code" jivemacro_uid="_13691246609035276"&gt;
&lt;P&gt; #define MQX_ROM_VECTORS 0&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt; #define BSPCFG_ENABLE_ITTYF 1 &lt;/P&gt;
&lt;P&gt; #define BSP_DEFAULT_IO_CHANNEL "ittyf:"&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Build MQX libraries. Then build /mqx/examples/hello2 application for internal flash Debug target. Load hello2 executable to MCU and run.&lt;/P&gt;&lt;P&gt;I break in idle task, in debugger I can see Cortex-M4 VTOR = 0x1FFF0000. At address 0x1FFF0000 I can see vector table, most of vectors point to _int_kernel_isr().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general with the supported toolchain, all need is to build BSP and PSP with #define MQX_ROM_VECTORS 0. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 08:26:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248194#M7125</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-05-21T08:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: RAM vector table? K60 and MQX 4.0</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248195#M7126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At &lt;SPAN style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: #333333;"&gt;0x1FFF0000&lt;/SPAN&gt; I get my variables (as per my map file), no vectors. My VTOR is pointing there!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question is - how do i get the linker to put the table at 0x1fff000? I tried another icf file and it basically bricked the board.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From following some postings I've found here the icf files do not bear much resemblance to&amp;nbsp;&amp;nbsp; the demo ones. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 10:10:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248195#M7126</guid>
      <dc:creator>gavroche123</dc:creator>
      <dc:date>2013-05-21T10:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: RAM vector table? K60 and MQX 4.0</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248196#M7127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Typically you don't put vector table directly to RAM for internal flash targets. The vector table is located physically in internal flash in non-volatile memory and the startup code makes a copy from flash to RAM. Usually this is toolchain dependent, for example in CodeWarrior the startup code takes some symbols defined in the linker command file and makes the copy from source to destination. You should study documentation for your compiler and linker and see how it makes ROM to RAM copy at startup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To start, I would recommend linking your application with the MQX delivered linker command file, for example for TWR-K60F120M debug target this one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ${MQX_ROOT_DIR}\lib\twrk60f120m.iar\debug\bsp\intflash.icf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you using this linker file to link your application ? Is this working with standard example ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2013 10:31:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248196#M7127</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-05-21T10:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: RAM vector table? K60 and MQX 4.0</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248197#M7128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I am using the linker file you mention, with the web hvac app. It all works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that i need to use kernel ints. So I recompiled MQX with the #define to use RAM vectors. &lt;/P&gt;&lt;P&gt;My understanding is that this still places the vector table in Flash at 0x0, but also sets the VTOR pointer to the start of RAM, where it expects to find a copy of said table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in my case there is no copy there. So there first int that gets called when the scheduler starts blasts off into hyperspace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So - what is responsible for making that copy ? There is a line in the icf file :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;place at address mem:__ICFEDIT_region_RAM_start__ { readwrite section .vectors_ram };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But is this it? Or is there some other setting I'm missing? An example would be useful, thanks.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 09:16:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248197#M7128</guid>
      <dc:creator>gavroche123</dc:creator>
      <dc:date>2013-05-23T09:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: RAM vector table? K60 and MQX 4.0</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248198#M7129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After build with IAR 6.50, hello2 example, MQX 4.0.1 libs build with MQX_ROM_VECTORS 0 I can see in my .map file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;"A2":&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;&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;&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; 0x400&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; rw section .vectors_ram-1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x1fff0000&amp;nbsp;&amp;nbsp; 0x400&amp;nbsp; &amp;lt;Init block&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .vectors_ram&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inited&amp;nbsp;&amp;nbsp; 0x1fff0000&amp;nbsp;&amp;nbsp; 0x400&amp;nbsp; vectors.o [3]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 0x1fff0400&amp;nbsp;&amp;nbsp; 0x400&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ram_vector&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; 0x1fff0000&amp;nbsp; 0x400&amp;nbsp; Data&amp;nbsp; Gb&amp;nbsp; vectors.o [3]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I was a bit wrong with IAR, I double check on hardware the startup process. The IAR library makes a copy of vectors to fill 0x1FFF0000--0x1FFF003F. Only 16 vectors from the vector table in ROM. The rest is left untouched by IAR startup code. Then, I can see the actual writes to vector table in RAM is done in _psp_int_install() MQX function. The callstack looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="psp_int_install_callstack.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119392i770E8D499BC64A8A/image-size/large?v=v2&amp;amp;px=999" role="button" title="psp_int_install_callstack.JPG" alt="psp_int_install_callstack.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and after _psp_int_install() executes, the vector table at 0x1FFF0040 is filled with addresses of _int_kernel_isr(). So, in conclusion, it seems that with IAR, only 16 vectors are actually copied from ROM to RAM. Remaining vectors are just filled with _int_kernel_isr(). Thus, you need to call _int_install_kernel_isr() for all your custom kernel interrupt routines with vector numbers &amp;gt;= 16. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 10:59:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248198#M7129</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-05-23T10:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: RAM vector table? K60 and MQX 4.0</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248199#M7130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. Looking at the difference between your map file and mine, I could see that I had no A2 section. This led me to think that something had gone wrong with my library build. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Indeed it had - I had not built all of the components (Build All is not what it appears) so there was a stale component. Batch building has fixed it and I'm now running my kernel ISR!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 19:22:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/RAM-vector-table-K60-and-MQX-4-0/m-p/248199#M7130</guid>
      <dc:creator>gavroche123</dc:creator>
      <dc:date>2013-05-23T19:22:18Z</dc:date>
    </item>
  </channel>
</rss>

