<?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: Error in PSP undefined reference to main in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Error-in-PSP-undefined-reference-to-main/m-p/640595#M17087</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Olivia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That means your main() is not there or is not reachable and your start-up file is looking for main(). It looks you are building an MQX app with a bare metal configuration.&amp;nbsp; In fact, in MQX, main is defined in bsp library (mqx_main.c).&lt;/P&gt;&lt;P&gt;I would suggest you take a look at the below document.&lt;/P&gt;&lt;P&gt;Freescale_MQX_4_2\doc\tools\iar\MQX_IAR_Getting_Started.pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #555555; font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Apr 2017 12:44:54 GMT</pubDate>
    <dc:creator>danielchen</dc:creator>
    <dc:date>2017-04-25T12:44:54Z</dc:date>
    <item>
      <title>Error in PSP undefined reference to main</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Error-in-PSP-undefined-reference-to-main/m-p/640594#M17086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with MQX 4.2 . in IAR and i created a project with 3 tasks and was working fine. Then i changed the bsp for my LCD code &amp;nbsp;and then i found my code with 3 task is showing some linker error in IAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error[Li005]: no definition for "main" [referenced from cmain.o(rt7M_tl.a)] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code doesn't have a function as main.&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are the tasks.&lt;/P&gt;&lt;P&gt;{DAC_TASK, DAC_Task, 1500, 8, "Dac_Task", MQX_AUTO_START_TASK, 0, 0 },&lt;BR /&gt; {ADC_TASK, ADC_Task, 2500, 9, "ADC_Task", 0, 0, 0 },&lt;BR /&gt; { KEYPAD_TASK, Keypad_Task, 5000, 8, "Keypad_Task", 0, 0, 0 },&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then i tried with the same bsp and psp in kds and found that it is giving same kind of error in PSP of that code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\Freescale\Freescale_MQX_4_2\mqx\build\kds\psp_frdmk64f\debug/..\..\..\..\source\psp\cortex_m\compiler\gcc_arm/comp.c:201: undefined reference to `main'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;error is shown at this function&lt;/P&gt;&lt;P&gt;void toolchain_startup(void)&lt;BR /&gt;{&lt;BR /&gt;// initialize necessary hardware (clocks, ddr, ...)&lt;BR /&gt; init_hardware();&lt;BR /&gt;// initialize data - copy and zero sections&lt;BR /&gt;// static variables can be used on return&lt;BR /&gt; data_startup();&lt;BR /&gt;// register destructor calls of static objects&lt;BR /&gt; atexit(__libc_fini_array);&lt;BR /&gt;// run constructor calls of static objects&lt;BR /&gt; __libc_init_array();&lt;BR /&gt;// run main, if return go to exit&lt;BR /&gt; exit(main()); &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;// here is the error undefined reference to main.&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does anybody have any idea about what is this error and how to solve it&lt;/P&gt;&lt;P&gt;please help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards,&lt;/P&gt;&lt;P&gt;Olivia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 09:37:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Error-in-PSP-undefined-reference-to-main/m-p/640594#M17086</guid>
      <dc:creator>oliviachristyva</dc:creator>
      <dc:date>2017-04-25T09:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Error in PSP undefined reference to main</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Error-in-PSP-undefined-reference-to-main/m-p/640595#M17087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Olivia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That means your main() is not there or is not reachable and your start-up file is looking for main(). It looks you are building an MQX app with a bare metal configuration.&amp;nbsp; In fact, in MQX, main is defined in bsp library (mqx_main.c).&lt;/P&gt;&lt;P&gt;I would suggest you take a look at the below document.&lt;/P&gt;&lt;P&gt;Freescale_MQX_4_2\doc\tools\iar\MQX_IAR_Getting_Started.pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #555555; font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 12:44:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Error-in-PSP-undefined-reference-to-main/m-p/640595#M17087</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2017-04-25T12:44:54Z</dc:date>
    </item>
  </channel>
</rss>

