<?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>Kinetis Microcontrollers中的主题 Re: Vector Table Offset - is this exected behaviour??</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366672#M18902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read the manual.&lt;/P&gt;&lt;P&gt;&lt;A href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/Ciheijba.html" title="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/Ciheijba.html"&gt;ARM Information Center&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to use the correct alignment as described in the document.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Dec 2014 15:49:20 GMT</pubDate>
    <dc:creator>frankbösing</dc:creator>
    <dc:date>2014-12-21T15:49:20Z</dc:date>
    <item>
      <title>Vector Table Offset - is this exected behaviour??</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366668#M18898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually I work with interrupt vectors in SRAM but recently I have had the need to have then fixed in Flash and during some work with this the following effect was observed:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. &lt;STRONG&gt;K20DX256(72MHz)&lt;/STRONG&gt; with a few interrupt operating but two of them are used to explain. One is the USB interrupt at vector 89 (counting from 0 being the stack pointer vector) and the other is the UART0 status interrupt at vector 61.&lt;/P&gt;&lt;P&gt;If the vectors are fixed in Flash at the start (0x00000000) these vector locations are physicaly at:&lt;/P&gt;&lt;P&gt;- USB - 4 x 89 = &lt;STRONG&gt;0x164&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- UART0 - 4 x 61 = &lt;STRONG&gt;0xf4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is standard and works as expected.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Now I link the vectors to &lt;STRONG&gt;0x8000&lt;/STRONG&gt; instead and set the vector table offset (VTOR) in the Cortex to &lt;STRONG&gt;0x8000&lt;/STRONG&gt; and the vectors are now physically at&lt;/P&gt;&lt;P&gt;- USB &lt;STRONG&gt;0x8164&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- UART0 &lt;STRONG&gt;0x80f4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Again all works as expected.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Now I link to &lt;STRONG&gt;0x80&lt;SPAN style="text-decoration: underline;"&gt;8&lt;/SPAN&gt;0&lt;/STRONG&gt; (noting that the vector table offset register has its lower 7 bits unimplemented, so this is the next highest location possible) and the vectors are physically at&lt;/P&gt;&lt;P&gt;- USB &lt;STRONG&gt;0x81e4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- UART0 &lt;STRONG&gt;0x8174&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In this case the USB operates normally but as soon as there is a UART0 interrupt there is an &lt;EM&gt;undefined interrupt&lt;/EM&gt; exception and it turns out that it is vector 29 (DMA channel 13) that unexpectedly interrupts, although there is no DMA operatung and its interrupts are all disabled. This vector would be physially at &lt;STRONG&gt;0x80f4&lt;/STRONG&gt;,&lt;EM&gt; which matches the UART0 vector if the vector table were still at 0x8000.....&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, for fun, the UART0 vector is set to the DMA channel 13 vector location and all starts working completely again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This suggests therefore that some interrupt vectors are moved by the vector table offset value of &lt;STRONG&gt;0x8080&lt;/STRONG&gt; by &lt;STRONG&gt;0x8080&lt;/STRONG&gt; (eg, the USB vector which is at &lt;STRONG&gt;0x00000164&lt;/STRONG&gt; is shifted by &lt;STRONG&gt;0x8080&lt;/STRONG&gt; to &lt;STRONG&gt;0x000081e4&lt;/STRONG&gt; (as expected) but some are not - eg. UART0, which is at &lt;STRONG&gt;0x000000f4&lt;/STRONG&gt; is not shifted by &lt;STRONG&gt;0x8080&lt;/STRONG&gt; to &lt;STRONG&gt;0x00008174&lt;/STRONG&gt; (as expected) but instead only shfted by &lt;STRONG&gt;0x8000&lt;/STRONG&gt; to &lt;STRONG&gt;0x000080f4&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expresed in a different way, the vector table offset is not behaving as the same offset for all vectors.&lt;/P&gt;&lt;P&gt;For the USB vector it is &lt;STRONG&gt;+ 0x8080&lt;/STRONG&gt; but for the UAR0 vector it is only &lt;STRONG&gt;+ 0x8000&lt;/STRONG&gt;. [or it is implemented as&lt;STRONG&gt; | 0x8080&lt;/STRONG&gt; and not &lt;STRONG&gt;+ 0x8080&lt;/STRONG&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore the question - i&lt;SPAN style="text-decoration: underline;"&gt;s this expected or is something wrong??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2014 00:46:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366668#M18898</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-12-20T00:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Vector Table Offset - is this exected behaviour??</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366669#M18899</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;Curiosity got the better of me and I tried locating the vectors at 0x8100. The result was that the USB interrupt now stopped working correcty - and fired as dma chnanel 9 vector - while the UART0 worked normally.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This adds the following set of results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Now I link to &lt;STRONG&gt;0x8&lt;SPAN style="text-decoration: underline;"&gt;100&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- USB &lt;STRONG&gt;0x8264&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- UART0 &lt;STRONG&gt;0x81f4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In this case the UART0operates normally but as soon as there is a USB interrupt there is an &lt;EM&gt;undefined interrupt&lt;/EM&gt; exception and it turns out that it is vector 25 (DMA channel 9) that unexpectedly interrupts, although there is no DMA operatung and its interrupts are all disabled. This vector would be physically at &lt;STRONG&gt;0x8164&lt;/STRONG&gt;,&lt;EM&gt; which matches the USB vector if the vector table were still at 0x8000.....&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;With these two cases the conclusion is now becoming quite clear:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For VTOR 0x8080&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For the USB vector it is &lt;STRONG&gt;+ 0x8080&lt;/STRONG&gt; but for the UAR0 vector it is only &lt;STRONG&gt;+ 0x8000&lt;/STRONG&gt;. [or it is implemented as&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt; | 0x8080&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="text-decoration: underline;"&gt; and not &lt;/SPAN&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;+ 0x8080&lt;/STRONG&gt;&lt;/SPAN&gt;]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For VTOR 0x8100&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For the UART vector it is &lt;STRONG&gt;+ 0x8100&lt;/STRONG&gt; but for the USD vector it is only &lt;STRONG&gt;+ 0x8000&lt;/STRONG&gt;. [or it is implemented as&lt;/EM&gt;&lt;STRONG&gt;&lt;EM&gt; &lt;SPAN style="text-decoration: underline;"&gt;| 0x8100&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&lt;SPAN style="text-decoration: underline;"&gt; and not &lt;/SPAN&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;+ 0x8100&lt;/STRONG&gt;&lt;/SPAN&gt;]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This suggests that the VTOR is not operating as an address &lt;STRONG&gt;&lt;EM&gt;offset&lt;/EM&gt;&lt;/STRONG&gt; but as an address &lt;STRONG&gt;&lt;EM&gt;OR&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;For the K20 in question, with 111 vector entries, it means that the next vector offset that can be used after &lt;STRONG&gt;0x8000&lt;/STRONG&gt; is &lt;STRONG&gt;0x8200&lt;/STRONG&gt;, or generally it has a resolution of &lt;STRONG&gt;0x200&lt;/STRONG&gt; and not &lt;STRONG&gt;0x80&lt;/STRONG&gt; as the VTOR does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading ARM's description of VTOR it looks as though this should operate as an offset and ARM recommends writing 0xffffffff to the register and reading back to see how many bits are actually implemented. Doing this return 0xffffff80 as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone say whether this behaviour is in fact normal or whether the implementation is unusual?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2014 19:03:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366669#M18899</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-12-20T19:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Vector Table Offset - is this exected behaviour??</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366670#M18900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it's a very interesting experiment. It is new information that the vector is calculated by ORed with VTOR. However, I don't know whether it would be normal.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Yasuhiko Koumoto.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2014 20:01:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366670#M18900</guid>
      <dc:creator>yasuhikokoumoto</dc:creator>
      <dc:date>2014-12-20T20:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Vector Table Offset - is this exected behaviour??</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366671#M18901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I investigated the V850E2, SuperH2 and ColdFire implementations and found an interrupt vector was calculated by adding (not or-ing) vector offset to the Vector Base Address in all three CPU cases. I think the lower bits of VTOR must be fixed to '0' properly according to the number of interrupts by Kinetis implementation as that all vector addresses become equivalent whether they are made by adding or or-ing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Yasuhiko Koumoto.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2014 20:48:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366671#M18901</guid>
      <dc:creator>yasuhikokoumoto</dc:creator>
      <dc:date>2014-12-20T20:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Vector Table Offset - is this exected behaviour??</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366672#M18902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read the manual.&lt;/P&gt;&lt;P&gt;&lt;A href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/Ciheijba.html" title="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0553a/Ciheijba.html"&gt;ARM Information Center&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to use the correct alignment as described in the document.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 15:49:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366672#M18902</guid>
      <dc:creator>frankbösing</dc:creator>
      <dc:date>2014-12-21T15:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Vector Table Offset - is this exected behaviour??</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366673#M18903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the clarification. I have been using the "ARM®v7-M Architecture Reference Manual" where this detail is not mentioned.&lt;/P&gt;&lt;P&gt;Now it is clear that the 0x200 boundary, as found from experimentation, is the expected limitation for this device (due to its number of interrupts) and that it changes depending on the number of interrupts available.&lt;/P&gt;&lt;P&gt;Also the reference states "&lt;EM&gt;See your vendor documentation for the alignment details of your device&lt;/EM&gt;", but this detail was not found there either.&lt;/P&gt;&lt;P&gt;In future I will use the on-line reference which looks to be superior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Dec 2014 17:19:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Vector-Table-Offset-is-this-exected-behaviour/m-p/366673#M18903</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-12-21T17:19:44Z</dc:date>
    </item>
  </channel>
</rss>

