<?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>LPC MicrocontrollersのトピックRe: How does linker know the entry point into the program?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-does-linker-know-the-entry-point-into-the-program/m-p/920544#M36701</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On ARM Cortex-M, the first entry in the vector table is the initial SP (Stack Pointer), followed by the initial PC (Program Counter) or the reset vector (see as well &lt;A class="link-titled" href="https://mcuoneclipse.com/2016/08/14/arm-cortex-m-interrupts-and-freertos-part-1/" title="https://mcuoneclipse.com/2016/08/14/arm-cortex-m-interrupts-and-freertos-part-1/"&gt;ARM Cortex-M, Interrupts and FreeRTOS: Part 1 | MCU on Eclipse&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;I'm not sure why you think in your case &amp;amp;&lt;SPAN style="font-size: small;"&gt;_vStackTop&lt;/SPAN&gt; is zero: check your linker file (.ld) as the linker usually is placing a symbol for the _vStackTop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Jun 2019 06:12:25 GMT</pubDate>
    <dc:creator>BlackNight</dc:creator>
    <dc:date>2019-06-14T06:12:25Z</dc:date>
    <item>
      <title>How does linker know the entry point into the program?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-does-linker-know-the-entry-point-into-the-program/m-p/920543#M36700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My embedded system is based on LPC11E68JBD48E.&amp;nbsp; I'm using MCUXpresso IDE.&amp;nbsp; Linker script is auto generated.&amp;nbsp; The entry point is specified&amp;nbsp;in the beginning of linker script, ENTRY(ResetISR)&lt;/P&gt;&lt;P&gt;How does linker know this is the first instruction to execute?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ResetISR is declared, defined, and is entry in vector table in my .cpp file as follows:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small; "&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; &lt;STRONG&gt;ResetISR&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt;&lt;STRONG&gt;ResetISR&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;) &lt;SPAN style="font-size: small;"&gt;{&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp; /* some reset initialization code here */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//*****************************************************************************&lt;/P&gt;&lt;P&gt;//&lt;/P&gt;&lt;P&gt;// The vector table. Note that the proper constructs must be placed on this to&lt;/P&gt;&lt;P&gt;// ensure that it ends up at physical address 0x0000.0000.&lt;/P&gt;&lt;P&gt;//&lt;/P&gt;&lt;P&gt;//*****************************************************************************&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small; "&gt;&lt;STRONG&gt;extern&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; (* &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;const&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; g_pfnVectors[])(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small; "&gt;&lt;STRONG&gt;__attribute__&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; ((used,section(&lt;/SPAN&gt;&lt;SPAN style="color: #2a00ff; font-size: small; "&gt;".isr_vector"&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #7f0055; font-size: small; "&gt;&lt;STRONG&gt;void&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; (* &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;const&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; g_pfnVectors[])(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;) = {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &amp;amp;_vStackTop, &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;// The initial stack pointer&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; ResetISR, &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;// The reset handler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; NMI_Handler, &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;// The NMI handler&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;….&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;….&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When reset is released this microcontroller executes at address 0x0000 0000.&amp;nbsp; Looking at the vector table&amp;nbsp; &amp;amp;_vStackTop is at address 0x0000 0000.&amp;nbsp; What is the result of executing code at address 0x0000 0000?&lt;/P&gt;&lt;P&gt;When I reset microcontroller from the debugger, breakpoint in the function ResetISR is hit.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How does linker know program entry point is ResetISR?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would expect ResetISR to be the first entry in the vector table but it is second entry?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2019 22:02:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-does-linker-know-the-entry-point-into-the-program/m-p/920543#M36700</guid>
      <dc:creator>anaseem</dc:creator>
      <dc:date>2019-06-13T22:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: How does linker know the entry point into the program?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-does-linker-know-the-entry-point-into-the-program/m-p/920544#M36701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;On ARM Cortex-M, the first entry in the vector table is the initial SP (Stack Pointer), followed by the initial PC (Program Counter) or the reset vector (see as well &lt;A class="link-titled" href="https://mcuoneclipse.com/2016/08/14/arm-cortex-m-interrupts-and-freertos-part-1/" title="https://mcuoneclipse.com/2016/08/14/arm-cortex-m-interrupts-and-freertos-part-1/"&gt;ARM Cortex-M, Interrupts and FreeRTOS: Part 1 | MCU on Eclipse&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;I'm not sure why you think in your case &amp;amp;&lt;SPAN style="font-size: small;"&gt;_vStackTop&lt;/SPAN&gt; is zero: check your linker file (.ld) as the linker usually is placing a symbol for the _vStackTop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2019 06:12:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-does-linker-know-the-entry-point-into-the-program/m-p/920544#M36701</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2019-06-14T06:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: How does linker know the entry point into the program?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/How-does-linker-know-the-entry-point-into-the-program/m-p/920545#M36702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;nbsp; &amp;nbsp;why you think in your case &amp;amp;&lt;SPAN style="font-size: small;"&gt;_vStackTop&lt;/SPAN&gt; is zero&lt;/P&gt;&lt;P&gt;I meant &amp;amp;_vStackTop is at internal flash memory address 0x0.&amp;nbsp; The address of stack Top isn't 0x0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2019 17:49:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/How-does-linker-know-the-entry-point-into-the-program/m-p/920545#M36702</guid>
      <dc:creator>anaseem</dc:creator>
      <dc:date>2019-06-14T17:49:46Z</dc:date>
    </item>
  </channel>
</rss>

