<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to start RTX application built by gcc successfully?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22545/how-to-start-rtx-application-built-by-gcc-successfully</link><description>Hi. I’m developing software on nRF51822 with SoftDevice s130-v2.0.1 and SDK v12.3. 
 I want to apply RTX to the software. In the case of building it using arm-gcc, the software stops before reaching main().
I set macro &amp;quot;__START=pre_main&amp;quot; to asm/C compiler</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Jun 2017 12:47:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22545/how-to-start-rtx-application-built-by-gcc-successfully" /><item><title>RE: How to start RTX application built by gcc successfully?</title><link>https://devzone.nordicsemi.com/thread/88703?ContentTypeID=1</link><pubDate>Fri, 16 Jun 2017 12:47:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:271250da-28b5-4393-85dd-f09fbe6b2e3f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Sorry, I looked in the wrong place. You are correct, there is no RTX GCC projects in SDK 12.3.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to start RTX application built by gcc successfully?</title><link>https://devzone.nordicsemi.com/thread/88702?ContentTypeID=1</link><pubDate>Fri, 16 Jun 2017 12:40:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fafeed68-a6a2-4666-b574-65410f2ff4fc</guid><dc:creator>tk</dc:creator><description>&lt;p&gt;I cannot find any example of rtx with GCC project in SDK 12.3.0 examples (no armgcc/ directory in blinky_rtx). Anyway, I&amp;#39;ll upload my Makefile in MyPage.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to start RTX application built by gcc successfully?</title><link>https://devzone.nordicsemi.com/thread/88705?ContentTypeID=1</link><pubDate>Fri, 16 Jun 2017 12:24:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f7164e5-626b-4674-afa3-e55e35c87e13</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I&amp;#39;m not aware of any recent examples of RTX with GCC that include a softdevice, this is why I asked you to upload the Makefile. In the blinky_rtx example in SDK 12.3.0, there is a GCC project. There is also a GCC project for ble_app_hrs_rtx in SDK 10. Could you upload the Makefile in MyPage? Then the information within will be keept confidential.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to start RTX application built by gcc successfully?</title><link>https://devzone.nordicsemi.com/thread/88701?ContentTypeID=1</link><pubDate>Fri, 16 Jun 2017 11:58:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:588480e3-cb5e-41c4-8690-b57858381339</guid><dc:creator>tk</dc:creator><description>&lt;p&gt;Sorry, it&amp;#39;s a private project, so I cannot upload it.
I cannot find an example of RTX with armgcc. Is there any example?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to start RTX application built by gcc successfully?</title><link>https://devzone.nordicsemi.com/thread/88704?ContentTypeID=1</link><pubDate>Fri, 16 Jun 2017 11:09:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5010748e-9516-4fb6-ae79-6c4fa2886f04</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Which example are you basing this on? Could you upload the Makefile you use?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to start RTX application built by gcc successfully?</title><link>https://devzone.nordicsemi.com/thread/88707?ContentTypeID=1</link><pubDate>Wed, 07 Jun 2017 06:53:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc46d32b-e03e-4a68-93a3-e3e88b7f80cc</guid><dc:creator>tk</dc:creator><description>&lt;p&gt;Thanks for your comment. I don&amp;#39;t really understand the startup mechanism. I don&amp;#39;t have to call software_init_hook() manually, right? I remove pre_main() and -D__START macro.&lt;/p&gt;
&lt;p&gt;Then, I go forward a bit... This time, I reach the final step of osKernelStart() in rt_CMSIS.c. It seems that error occurs when calling __svcKernelStart(). I found that the program is in SVC_Handler().&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Resetting target
(gdb) c
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
0x0002625c in SVC_Handler ()
(gdb) bt
#0  0x0002625c in SVC_Handler ()
#1  &amp;lt;signal handler called&amp;gt;
#2  0x00027498 in __svcKernelStart () at ../SDK/external/rtx/source/rt_CMSIS.c:485
#3  osKernelStart () at ../SDK/external/rtx/source/rt_CMSIS.c:612
#4  0xd7f001d0 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;By using Keil, the program starts normally.
What should I do in the case of using gcc?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to start RTX application built by gcc successfully?</title><link>https://devzone.nordicsemi.com/thread/88706?ContentTypeID=1</link><pubDate>Mon, 05 Jun 2017 09:49:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deacd972-bf35-4473-8465-efa0b6d23943</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;well you&amp;#39;re in the hardfault handler so you have a hardfault. You&amp;#39;ll need to figure out what caused it. Looks like register_exitproc() executed the code which caused the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>