<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックRe: Is it possible to change the interrupt vector table dynamically?</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Is-it-possible-to-change-the-interrupt-vector-table-dynamically/m-p/207429#M9943</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I assume syntactically means with code so in C you would:&lt;BR /&gt;&lt;BR /&gt;#include &amp;lt;stdint.h&amp;gt;&lt;BR /&gt;extern uint32_t VECTOR_TABLE[256];&lt;BR /&gt;void _uart0_isr ();&lt;BR /&gt;void foo ()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; VECTOR_TABLE[0x4d] = _uart0_isr;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;For an assembler version I compiled the code with:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; /opt/rtems-4.10/bin/m68k-rtems4.10-gcc -save-temps -c -o2 vector.c&lt;BR /&gt;&lt;BR /&gt;and looked at the assembler output in vector.s:&lt;BR /&gt;&lt;BR /&gt;foo:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; link.w %fp,#0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l #_uart0_isr,%d0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l %d0,VECTOR_TABLE+308&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unlk %fp&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rts&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Dec 2008 08:23:53 GMT</pubDate>
    <dc:creator>ChrisJohns</dc:creator>
    <dc:date>2008-12-08T08:23:53Z</dc:date>
    <item>
      <title>Is it possible to change the interrupt vector table dynamically?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Is-it-possible-to-change-the-interrupt-vector-table-dynamically/m-p/207426#M9940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Is it possible to change the interrupt vector table dynamically?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;For example, say I have a file Vector.s with the vector table (5282 processor):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&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:&amp;nbsp;&amp;nbsp; .long&amp;nbsp; ___SP_AFTER_RESET&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INITPC:&amp;nbsp;&amp;nbsp; .long&amp;nbsp; _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;&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; //… etc etc...vector4D: .long&amp;nbsp; _asm_isr_handler&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //… etc etc...&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;I would like to call a function &lt;STRONG&gt;&lt;EM&gt;InitialiseUART0()&lt;/EM&gt;&lt;/STRONG&gt;. Within this function, I would like to replace the vector entry with my ISR.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vector4D:&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;.long&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;_asm_isr_handle&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3;"&gt;&lt;SPAN style="font-family: 'Times New Roman';"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Times New Roman';"&gt;&lt;SPAN&gt;to&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;vector4D:&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;.long&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;_uart0_isr&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Is it possible? How?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;SVC&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 02:44:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Is-it-possible-to-change-the-interrupt-vector-table-dynamically/m-p/207426#M9940</guid>
      <dc:creator>SVC2</dc:creator>
      <dc:date>2008-12-05T02:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to change the interrupt vector table dynamically?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Is-it-possible-to-change-the-interrupt-vector-table-dynamically/m-p/207427#M9941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Yes you can but you need to move the vector table to RAM. There are a couple of approaches that can be used.&lt;BR /&gt;&lt;BR /&gt;If you have the RAM and can spare 4K the best solution is to copy the vector to RAM and update the VBR register to point to it. Typically RAM is at address 0 and this is the best place to locate the vector table in RAM (alignment issues with the VBR). Once located in RAM you can change entries as you like. Most operating systems such as the RTEMS kernel do this.&lt;BR /&gt;&lt;BR /&gt;A second way if you do not have enough RAM for the whole table is have a second small table in RAM and to set the ROM based vector to point to a redirector piece of code. This code jumps to the address in the smaller RAM table for the specific interrupt.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2008 07:14:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Is-it-possible-to-change-the-interrupt-vector-table-dynamically/m-p/207427#M9941</guid>
      <dc:creator>ChrisJohns</dc:creator>
      <dc:date>2008-12-05T07:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to change the interrupt vector table dynamically?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Is-it-possible-to-change-the-interrupt-vector-table-dynamically/m-p/207428#M9942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;My vector table is in RAM!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;But how do I change it's entry (syntactically)?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&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>Sat, 06 Dec 2008 03:30:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Is-it-possible-to-change-the-interrupt-vector-table-dynamically/m-p/207428#M9942</guid>
      <dc:creator>SVC2</dc:creator>
      <dc:date>2008-12-06T03:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to change the interrupt vector table dynamically?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Is-it-possible-to-change-the-interrupt-vector-table-dynamically/m-p/207429#M9943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I assume syntactically means with code so in C you would:&lt;BR /&gt;&lt;BR /&gt;#include &amp;lt;stdint.h&amp;gt;&lt;BR /&gt;extern uint32_t VECTOR_TABLE[256];&lt;BR /&gt;void _uart0_isr ();&lt;BR /&gt;void foo ()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; VECTOR_TABLE[0x4d] = _uart0_isr;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;For an assembler version I compiled the code with:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; /opt/rtems-4.10/bin/m68k-rtems4.10-gcc -save-temps -c -o2 vector.c&lt;BR /&gt;&lt;BR /&gt;and looked at the assembler output in vector.s:&lt;BR /&gt;&lt;BR /&gt;foo:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; link.w %fp,#0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l #_uart0_isr,%d0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l %d0,VECTOR_TABLE+308&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unlk %fp&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rts&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Dec 2008 08:23:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Is-it-possible-to-change-the-interrupt-vector-table-dynamically/m-p/207429#M9943</guid>
      <dc:creator>ChrisJohns</dc:creator>
      <dc:date>2008-12-08T08:23:53Z</dc:date>
    </item>
  </channel>
</rss>

