<?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: How can I change the vector table? in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/How-can-I-change-the-vector-table/m-p/818058#M3736</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;normally - the vector table is copied in the RAM - to be able change IRQ handler address in runtime. As you can see from startup - the vector table is defined at beginning of flash (m_text) and in startup is copied to RAM (0x40000000) and IACKR0-&amp;gt;VTBA is set to&amp;nbsp;0x40000 (aligned to 0x1000) in startup.c.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if you create another vector table (in the FLASH area) with your function (and there is still present the default vector table) - you also need to modify startup.c where vector table is copied from FLASH to RAM:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (__VECTOR_RAM != __VECTOR_TABLE)&lt;BR /&gt; {&lt;BR /&gt; /* Copy the vector table from ROM to RAM */&lt;BR /&gt; for (n = 0; n &amp;lt; (((uint32_t)__RAM_VECTOR_TABLE_SIZE)/sizeof(uint32_t)); n++)&lt;BR /&gt; {&lt;BR /&gt; __VECTOR_RAM[n] = __VECTOR_TABLE[n];&lt;BR /&gt; }&lt;BR /&gt; /* Point the VTOR to the position of vector table */&lt;BR /&gt; *vectors[coreId] = (uint32_t)__VECTOR_RAM;&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; /* Point the VTOR to the position of vector table */&lt;BR /&gt; *vectors[coreId] = (uint32_t)__VECTOR_TABLE;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jiri&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Aug 2018 10:30:47 GMT</pubDate>
    <dc:creator>jiri_kral</dc:creator>
    <dc:date>2018-08-06T10:30:47Z</dc:date>
    <item>
      <title>How can I change the vector table?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/How-can-I-change-the-vector-table/m-p/818055#M3733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I have a new problem about the interrupt.&lt;/P&gt;&lt;P&gt;First,I can entry the IRQ function by following the demo and it's correctly.&lt;/P&gt;&lt;P&gt;But now,I want to set a function like this:&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/79567i884B4B5B8D8E5CE6/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried,but I failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So,my problem is that I just set the IRQ funtion before compiling in this array:&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/79568i0930C142DB101CBC/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I want to get a function to install the IRQ funtion.How can I do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2018 01:45:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/How-can-I-change-the-vector-table/m-p/818055#M3733</guid>
      <dc:creator>578294688</dc:creator>
      <dc:date>2018-08-03T01:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the vector table?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/How-can-I-change-the-vector-table/m-p/818056#M3734</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;If I'm understand it correctly - you like to add Interrupt handler in compile time, correct?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So - just add your particular handler instead &amp;amp;dummy - that's all. Don't forget declare this handler like the dummy is and of course you need to implement it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;void dummy &lt;SPAN&gt; &lt;/SPAN&gt;&amp;nbsp; (void);&lt;/P&gt;&lt;P&gt;void MyPitHandler(void);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(uint32_t) &amp;amp;dummy, /* Vector # 223 */&lt;BR /&gt;(uint32_t) &amp;amp;dummy, /* Vector # 224 Real Time Counter (RTC) RTC */&lt;BR /&gt;(uint32_t) &amp;amp;dummy, /* Vector # 225 Autonomous Periodic Interrupt (API) API */&lt;BR /&gt;&lt;STRONG&gt;(uint32_t) &amp;amp;MyPitHandler, /* Vector # 226 Periodic Interrupt Timer (PIT0) PIT_1_TFLG0[TIF] */&lt;/STRONG&gt;&lt;BR /&gt;(uint32_t) &amp;amp;dummy, /* Vector # 227 Periodic Interrupt Timer (PIT1) PIT_1_TFLG1[TIF] */&lt;BR /&gt;(uint32_t) &amp;amp;dummy, /* Vector # 228 Periodic Interrupt Timer (PIT2) PIT_1_TFLG2[TIF] */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jiri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2018 12:30:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/How-can-I-change-the-vector-table/m-p/818056#M3734</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2018-08-03T12:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the vector table?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/How-can-I-change-the-vector-table/m-p/818057#M3735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sorry that i don't state my problem clearly.&lt;/P&gt;&lt;P&gt;Your method is a good way to solve the problem,Jiri.&lt;/P&gt;&lt;P&gt;But I want to ask you for another.&lt;/P&gt;&lt;P&gt;In fact, the array is definitioned&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/79646i8D431AC957D98925/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;the array is definitioned in text section,&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/79647i5B91535BD2ED616C/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;So I can't change the value of the definitioned vector table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to set a new arrary to store the ISRs' address,like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;uint32_t IntcIsrVectorTable[750] = {(uint32_t)(&amp;amp;dummy),(uint32_t)(&amp;amp;dummy) ...};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and then&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;INTC.IACKR[0].R = (uint32_t)&amp;amp;IntcIsrVectorTable;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;last I replace the corresponding value of the array with ISR address,like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void Pit0Ch0Isr(void)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;PIT_0.TIMER[0].TFLG.B.TIF = 1;&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;&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;//clear the flag&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;SIUL2.GPDO[30].B.PDO_4n3 = ~SIUL2.GPDO[30].B.PDO_4n3;&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;//turn&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IntcIsrVectorTable[226] = (uint32_t)(&amp;amp;Pit0Ch0Isr);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and then I enable the interrupt,I find that I can't enter the changed ISR,what happen?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 01:40:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/How-can-I-change-the-vector-table/m-p/818057#M3735</guid>
      <dc:creator>578294688</dc:creator>
      <dc:date>2018-08-06T01:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the vector table?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/How-can-I-change-the-vector-table/m-p/818058#M3736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;normally - the vector table is copied in the RAM - to be able change IRQ handler address in runtime. As you can see from startup - the vector table is defined at beginning of flash (m_text) and in startup is copied to RAM (0x40000000) and IACKR0-&amp;gt;VTBA is set to&amp;nbsp;0x40000 (aligned to 0x1000) in startup.c.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if you create another vector table (in the FLASH area) with your function (and there is still present the default vector table) - you also need to modify startup.c where vector table is copied from FLASH to RAM:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (__VECTOR_RAM != __VECTOR_TABLE)&lt;BR /&gt; {&lt;BR /&gt; /* Copy the vector table from ROM to RAM */&lt;BR /&gt; for (n = 0; n &amp;lt; (((uint32_t)__RAM_VECTOR_TABLE_SIZE)/sizeof(uint32_t)); n++)&lt;BR /&gt; {&lt;BR /&gt; __VECTOR_RAM[n] = __VECTOR_TABLE[n];&lt;BR /&gt; }&lt;BR /&gt; /* Point the VTOR to the position of vector table */&lt;BR /&gt; *vectors[coreId] = (uint32_t)__VECTOR_RAM;&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; /* Point the VTOR to the position of vector table */&lt;BR /&gt; *vectors[coreId] = (uint32_t)__VECTOR_TABLE;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jiri&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 10:30:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/How-can-I-change-the-vector-table/m-p/818058#M3736</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2018-08-06T10:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I change the vector table?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/How-can-I-change-the-vector-table/m-p/818059#M3737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you,Jiri!&lt;/P&gt;&lt;P&gt;According to your method,I find it is a problem that interrupt redirect,and I solved the problem already,thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2018 08:45:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/How-can-I-change-the-vector-table/m-p/818059#M3737</guid>
      <dc:creator>578294688</dc:creator>
      <dc:date>2018-08-14T08:45:37Z</dc:date>
    </item>
  </channel>
</rss>

