<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/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/"><channel><title>RTX166Tiny &amp;amp; EC++ have problem!</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/21721/rtx166tiny-ec-have-problem</link><description> 
Good day! 

 
I have a problem with using RTX166 Tiny OS with EC++. 
If I try to define tasks in .cpp file, I dont see JUMP to
_main() function. 

 
In technical support: 
 &amp;quot;RTX166 TINY: CAN&amp;#39;T DEFINE TASKS IN EC++&amp;quot; 
 http://www.keil.com/support/docs</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: RTX166Tiny &amp; EC++ have problem!</title><link>https://community.arm.com/thread/123821?ContentTypeID=1</link><pubDate>Mon, 21 May 2007 08:55:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d0c76915-4ae5-41c0-b500-0fadda3ada88</guid><dc:creator>Georget Stephane</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hello Reinhard,&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;This example seems to be broken&lt;/b&gt; (at least for me), that&amp;#39;s
the problem.&lt;/p&gt;

&lt;p&gt;
_main() is never called, which is an issue because then EC++
classes are not initialized, neither is the memory pool...&lt;/p&gt;

&lt;p&gt;
This example is so simple (no constructors, not even a single data
member) that it &lt;i&gt;appears&lt;/i&gt; to be working, whereas in fact the
EC++ initialization is not done at all.&lt;/p&gt;

&lt;p&gt;
-Stephane&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTX166Tiny &amp; EC++ have problem!</title><link>https://community.arm.com/thread/112866?ContentTypeID=1</link><pubDate>Mon, 21 May 2007 07:04:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:86db5793-cd27-4df3-b6c2-aad5cd9b0586</guid><dc:creator>Reinhard Keil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Take a look here: C:\Keil\C166\Examples\EC++\RtxTiny&lt;br /&gt;
This example shows you how to create an RtxTiny Application with
EC++.&lt;/p&gt;

&lt;p&gt;
Reinhard&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTX166Tiny &amp; EC++ have problem!</title><link>https://community.arm.com/thread/99203?ContentTypeID=1</link><pubDate>Fri, 18 May 2007 20:05:31 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:de74efae-5607-49b5-8b69-d9a53c7d0c7b</guid><dc:creator>Georget Stephane</dc:creator><description>&lt;p&gt;&lt;p&gt;
Oleg,&lt;/p&gt;

&lt;p&gt;
Ignore my previous post, as it is confusing.&lt;/p&gt;

&lt;p&gt;
Short answer: define a &lt;b&gt;main()&lt;/b&gt; anyway, and see what
happens.&lt;/p&gt;

&lt;p&gt;
Long answer:&lt;/p&gt;

&lt;p&gt;
There is an example in Keil\C166\Rtx_Tiny which is supposed to
show how to use EC++ and RTX Tiny. It doesn&amp;#39;t work on my machine!
&lt;b&gt;_main()&lt;/b&gt; is never called, I believe there is a problem with
this example.&lt;/p&gt;

&lt;p&gt;
It seems that RTX Tiny defines a symbol called main, which in turn
calls &lt;b&gt;os_start()&lt;/b&gt; (look at the source code for RTX Tiny)&lt;/p&gt;

&lt;p&gt;
One workaround is to define, and it can by anywhere in your cpp
code really:&lt;/p&gt;

&lt;pre&gt;
int main() {}
&lt;/pre&gt;

&lt;p&gt;
This symbol will override the one in RTX Tiny&amp;#39;s library, which
means that this function will be called, rather than the one inside
the real time library. Then, the EC++ parser will recognize this
special function and call &lt;b&gt;_main()&lt;/b&gt; automatically, as soon as
&lt;b&gt;main()&lt;/b&gt; is executed (look at how &lt;b&gt;main()&lt;/b&gt; is modified
inside the .ic. file)&lt;/p&gt;

&lt;p&gt;
Other workaround: modify the .a66 initialization file so it calls
&lt;b&gt;_main&lt;/b&gt; instead of &lt;b&gt;main&lt;/b&gt;. Look for the lines of code that
say:&lt;/p&gt;

&lt;pre&gt;

...
EXTRN   main:Model
...

$IF TINY
                JMP     main
$ELSE
                JMP     FAR main
$ENDIF
&lt;/pre&gt;

&lt;p&gt;
and replace all &lt;b&gt;main&lt;/b&gt; with &lt;b&gt;_main&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;
Not sure if this makes sense, but I hope this helps...&lt;/p&gt;

&lt;p&gt;
-St&amp;eacute;phane&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTX166Tiny &amp; EC++ have problem!</title><link>https://community.arm.com/thread/75094?ContentTypeID=1</link><pubDate>Fri, 18 May 2007 07:17:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:afe9b4e9-5670-4dc3-a0a3-50e3900485ca</guid><dc:creator>Oleg Tren</dc:creator><description>&lt;p&gt;&lt;p&gt;
Stephane,&lt;/p&gt;

&lt;p&gt;
You said:&lt;/p&gt;

&lt;pre&gt;
&amp;quot;Therefore you should put os_init() in your main() function, not in _main()&amp;quot;
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
but where is the &lt;b&gt;main()&lt;/b&gt; function situated?&lt;/p&gt;

&lt;p&gt;
There is no main function in OS projects, only tasks!&lt;/p&gt;

&lt;p&gt;
Now, I&amp;#39;ve placed _main() CALL explicitly in task 0.&lt;br /&gt;
But I&amp;#39;m sure that it is not correct way, isn&amp;#39;t it?&lt;/p&gt;

&lt;p&gt;
the problem remains.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTX166Tiny &amp; EC++ have problem!</title><link>https://community.arm.com/thread/75095?ContentTypeID=1</link><pubDate>Mon, 14 May 2007 12:53:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a15aee13-1b52-4cf7-a349-4025d2038522</guid><dc:creator>Georget Stephane</dc:creator><description>&lt;p&gt;&lt;p&gt;
Ah, scratch that, &lt;b&gt;__sti_init__()&lt;/b&gt; &lt;i&gt;DOES&lt;/i&gt; return...&lt;/p&gt;

&lt;p&gt;
Steph-&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTX166Tiny &amp; EC++ have problem!</title><link>https://community.arm.com/thread/48124?ContentTypeID=1</link><pubDate>Mon, 14 May 2007 12:41:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3e3db789-c7f9-4184-b82d-9356e1dbaed2</guid><dc:creator>Georget Stephane</dc:creator><description>&lt;p&gt;&lt;p&gt;
Oleg,&lt;/p&gt;

&lt;p&gt;
I don&amp;#39;t quite understand your problem, however there is one thing
that strikes me in the code you posted: &lt;b&gt;__sti_init__()&lt;/b&gt; does
not return. Therefore your OS won&amp;#39;t be initialized when you start
using it (and I don&amp;#39;t want to imagine what&amp;#39;s going to happen
then...)&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;__sti_init__()&lt;/b&gt; initializes all your objects, virtual tables
or what-have-you, and then it calls &lt;b&gt;main()&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;
Therefore you should put &lt;b&gt;os_init()&lt;/b&gt; in your &lt;b&gt;main()&lt;/b&gt;
function, not in &lt;b&gt;_main()&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;
After the OS is initialized, then you can start creating
tasks.&lt;/p&gt;

&lt;p&gt;
You need to use the keyword &lt;b&gt;__task&lt;/b&gt; instead of &lt;b&gt;_task_&lt;/b&gt;
for tasks definitions in C++ files.&lt;/p&gt;

&lt;p&gt;
I&amp;#39;ve been using EC++ and RTX Tiny and ARTX for quite a while and
it works pretty well.&lt;/p&gt;

&lt;p&gt;
$0.02&lt;/p&gt;

&lt;p&gt;
Steph-&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>