<?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>Please help me!</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/24346/please-help-me</link><description> 
Hello everybody! 

 
I have a problem by using Hmote2430 and Keil compiler for my
sensor network project. When I use Keil compiler to compile my NesC
code, I have some error as follow: 

 
vu_anh_dung@anhdung /opt/tinyos-2.x/apps/Battery3 
$ ./AUTOMAKE</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Please help me!</title><link>https://community.arm.com/thread/130505?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2009 23:58:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3dffeca7-a76a-4d8c-b139-2bcf9ae641a5</guid><dc:creator>Vu Anh Dzung</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks, I think my problem was not in NesC code, because when I
compiled NesC code, there is no error and have some warning, and if I
have something wrong in NesC, the compiler will give me the error
message. But when I generated to Hex file by app.c file, I have had
some errors what I don&amp;#39;t know. So how to solve this problem, could
you give me some advise? I really feel worried now.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please help me!</title><link>https://community.arm.com/thread/125569?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2009 23:46:34 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:60376009-a7c0-4a07-88b3-f974da195323</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
You did notice that the C51 compiler did complain about the
contents of APP.C?&lt;/p&gt;

&lt;p&gt;
That means that the _C_ code must be examined. The nesC code will
not contain the relevant constants - they are generated by the nesC
to C converter.&lt;/p&gt;

&lt;p&gt;
Your problems _may_ be because you have a problem with the nesC
code.&lt;/p&gt;

&lt;p&gt;
Your problems _may_ be because the nesC to C converter does not
produce code that is compatible with the C51 compiler.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please help me!</title><link>https://community.arm.com/thread/115063?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2009 23:46:00 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:56bf10fb-fff5-44ea-a7bd-4f8aee960111</guid><dc:creator>Vu Anh Dzung</dc:creator><description>&lt;p&gt;&lt;p&gt;
Because my app.c file has more than 4000 line, I upload on
internet, please check it for me.&lt;br /&gt;
this is a app.c file.&lt;br /&gt;
&lt;b&gt;&lt;a href="http://www.box.net/shared/ylq4gbjzdt"&gt;www.box.net/.../ylq4gbjzdt&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please help me!</title><link>https://community.arm.com/thread/115059?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2009 23:38:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1bf2a6a8-63f0-4225-a82c-064967a97f6a</guid><dc:creator>Vu Anh Dzung</dc:creator><description>&lt;p&gt;&lt;p&gt;
- Sorry for my limited because I don&amp;#39;t know C language.&lt;/p&gt;

&lt;p&gt;
My NesC code below:&lt;/p&gt;

&lt;pre&gt;
configuration TestSensorC {

}
implementation {
    components MainC, TestSensorP;

    MainC.SoftwareInit -&amp;gt; TestSensorP.Init;
    MainC.Boot &amp;lt;- TestSensorP;

    components LedsC;
    TestSensorP.Leds -&amp;gt; LedsC;

    components new TimerMilliC() as TimerC;
    TestSensorP.Timer -&amp;gt; TimerC;

    components StdOutC;
    TestSensorP.StdOut -&amp;gt; StdOutC;

    components BattC;
    TestSensorP.BattControl -&amp;gt; BattC.StdControl;
    TestSensorP.Batt -&amp;gt; BattC.SimpleADC;
}
&lt;/pre&gt;
&lt;pre&gt;
module TestSensorP {
    provides interface Init;
    uses interface Boot;
    uses interface Timer&amp;lt;TMilli&amp;gt;;
    uses interface Leds;
    uses interface StdOut;
    uses interface StdControl as BattControl;
    uses interface SimpleADC as Batt;
}

&lt;br /&gt;

implementation {
  float value;

&lt;br /&gt;

  command error_t Init.init() {
    return SUCCESS;
  }

&lt;br /&gt;

  event void Boot.booted() {
    call Leds.led1On();
    call Leds.led0On();

&lt;br /&gt;

    call StdOut.print(&amp;quot;*************************\n\r&amp;quot;);
    call StdOut.print(&amp;quot;*  Program initialized  *\n\r&amp;quot;);
    call StdOut.print(&amp;quot;*  Exercise 7 : Voltage *\n\r&amp;quot;);
    call StdOut.print(&amp;quot;*************************\n\r&amp;quot;);

&lt;br /&gt;

    call BattControl.start();
    call Timer.startPeriodic(300);
  }
   event error_t Batt.dataReady(uint16_t data, uint8_t status)
   {
        call StdOut.printBase10uint16(data);
        call StdOut.print(&amp;quot; : &amp;quot;);
        value = data*0.0183195;
        call StdOut.printBase10uint16(value);
        call StdOut.print(&amp;quot;mV&amp;quot;);
        call StdOut.print(&amp;quot;\n\r&amp;quot;);
   }
  event void Timer.fired()
  {
        call Leds.led1Toggle();
        call Batt.getData();
  }
  async event void StdOut.get(uint8_t data) {
      return;
  }
}
&lt;/pre&gt;

&lt;p&gt;
***My process below***&lt;/p&gt;

&lt;p&gt;
Compile NesC code:&lt;/p&gt;

&lt;pre&gt;
vu_anh_dung@anhdung /opt/tinyos-2.x/apps/Battery3
$ make hmote2430
mkdir -p build/hmote2430
ncc -S -Os -I/opt/tinyos-2.x/tos/platform/hmote2430 -D__hmote2430__=1 -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all
-conly -target=hmote2430 -fnesc-cfile=build/hmote2430/app.c -board=hy2430  TestSensorC.nc 2&amp;gt;&amp;amp;1 | \ 
        grep -v &amp;quot;attribute directive ignored&amp;quot;
/opt/tinyos-2.x/tos/chips/cc2430/ioCC2430.h:259: warning: non-atomic accesses to shared variable &amp;#39;SLEEP&amp;#39;:
/opt/tinyos-2.x/tos/chips/cc2430/McuSleepC.nc:61: warning:   non-atomic write
/opt/tinyos-2.x/tos/chips/cc2430/McuSleepC.nc:61: warning:   non-atomic read
    compiled TestSensorC to build/hmote2430/app.c
cp /opt/tinyos-2.x/support/make/mcs51/startup.a51 build/hmote2430
cp /opt/tinyos-2.x/support/make/mcs51/startup.bat build/hmote2430
cp /opt/tinyos-2.x/support/make/mcs51/MAKEHEX.sh        build/hmote2430

    compiling TestSensorC to a hmote2430 binary

mv build/hmote2430/app.c build/hmote2430/app.preMangle.c
perl -w /opt/tinyos-2.x/support/make/mcs51/mangleAppC.pl --KEIL --file=build/hmote2430/app.preMangle.c &amp;gt; build/hmote2430
/app.c
cp /opt/tinyos-2.x/support/make/mcs51/CC2430-F128.bat build/hmote2430
cp /opt/tinyos-2.x/support/make/mcs51/AUTOMAKE.sh .

    compiled TestSensorC to a hmote2430 binary

**** Build Completed!!! ****
&lt;/pre&gt;

&lt;p&gt;
Generate Hex file:&lt;/p&gt;

&lt;pre&gt;
vu_anh_dung@anhdung /opt/tinyos-2.x/apps/Battery3
$ ./AUTOMAKE.sh

C:\cygwin\opt\tinyos-2.x\apps\Battery3\build\hmote2430&amp;gt;echo off

A51 MACRO ASSEMBLER V8.01 - SN: K1MMC-0LE18C
COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2007

ASSEMBLY COMPLETE.  0 WARNING(S), 0 ERROR(S)

C:\cygwin\opt\tinyos-2.x\apps\Battery3\build\hmote2430&amp;gt;echo off

C51 COMPILER V8.12 - SN: K1MMC-0LE18C
COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2008
*** WARNING C219 IN LINE 1519 OF APP.C: long constant truncated
*** ERROR C136 IN LINE 1588 OF APP.C: invalid dimension size: [0]

C51 COMPILATION COMPLETE.  1 WARNING(S),  1 ERROR(S)

LX51 LINKER/LOCATER V4.25 - SN: K1MMC-0LE18C
COPYRIGHT KEIL ELEKTRONIK GmbH 1995 - 2007
startup.obj, app.obj TO app CLASSES( XDATA(X:0xE000-X:0xFF00), IDATA(I:0-I:0xFF)) REGFILE(app.reg)ma
*** ERROR L210: I/O ERROR ON INPUT FILE:
    EXCEPTION 0021H: PATH OR FILE NOT FOUND
    FILE: APP.OBJ

Extended 8051/251 Object to Hex File Converter V1.36b
COPYRIGHT KEIL ELEKTRONIK GmbH 2000 - 2006

*** ERROR: CAN&amp;#39;T OPEN FILE &amp;#39;app&amp;#39;
**********************************************************
***** app.hex is created.. upload IMAGE to CC2430 !! *****
**** You can use SmartRF04 Flash Programmer (chipcon) ****
**********************************************************
ls: app.hex: No such file or directory
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please help me!</title><link>https://community.arm.com/thread/103237?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2009 22:16:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:208a7f5f-87ca-468f-88a0-6114d3a61e65</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Guess what?&lt;/p&gt;

&lt;p&gt;
People can&amp;#39;t help you unless they have access to _all_ relevant
symbols required to decode a source line.&lt;/p&gt;

&lt;p&gt;
The symbol AlarmToTimerC__0__fired is probably zero, which it most
probably should not be. Time for you to check why.&lt;/p&gt;

&lt;p&gt;
The warning line (1526) uses a large number of symbols that I can
not know the value/type of.&lt;/p&gt;

&lt;p&gt;
But the above problems are generic C problems. You do know C?&lt;/p&gt;

&lt;p&gt;
By the way: Why not format the code as code when posting? This is
clearly described in the text just above the message box when you
write a post.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please help me!</title><link>https://community.arm.com/thread/77556?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2009 21:46:38 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:654cfe99-03ed-40f0-bb03-a0726a440709</guid><dc:creator>Vu Anh Dzung</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thank you so much for your answer.&lt;/p&gt;

&lt;p&gt;
If possible, please check it for me, because I can not post my
program to website, and so sorry for my English limited.&lt;/p&gt;

&lt;p&gt;
line 1526: TransformCounterC__0__OVERFLOW_MASK =
/*CounterMilli32C.Transform*/TransformCounterC__0__NUM_UPPER_BITS ?
((/*CounterMilli32C.Transform*/TransformCounterC__0__upper_count_type
)2 &amp;lt;&amp;lt;
(/*CounterMilli32C.Transform*/TransformCounterC__0__NUM_UPPER_BITS -
1)) - 1 : 0&lt;br /&gt;
line 1527: &lt;b&gt;};&lt;/b&gt;&lt;br /&gt;
...&lt;/p&gt;

&lt;p&gt;
...&lt;/p&gt;

&lt;p&gt;
line 1596:&lt;b&gt;typedef int
/*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC__0____nesc_sillytask_fired[/*HilTimerMilliC.AlarmToTimerC*/AlarmToTimerC__0__fired];&lt;/b&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Please help me!</title><link>https://community.arm.com/thread/56363?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2009 20:42:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:56ca066c-d1b0-411d-a539-4b3acf01fa4e</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Was &amp;quot;Please help me!&amp;quot; a descriptive summary?&lt;/p&gt;

&lt;p&gt;
Have you taken a closer look at:&lt;/p&gt;

&lt;pre&gt;
*** WARNING C219 IN LINE 1527 OF APP.C: long constant truncated
*** ERROR C136 IN LINE 1596 OF APP.C: invalid dimension size: [0]
&lt;/pre&gt;

&lt;p&gt;
We can&amp;#39;t do it for you. We do not know the contents of line 1527
and line 1596 of your APP.C file.&lt;/p&gt;

&lt;p&gt;
Always take care of problems in the order they arrive, instead of
trying to cheat the last step by copying an other hex file or
similar.&lt;/p&gt;

&lt;p&gt;
When the C code is correct and compileable, then there will be an
APP.OBJ file, and then the linker will have the required files to try
to create a HEX file.&lt;/p&gt;

&lt;p&gt;
Another thing: The AUTOMAKE.sh file seems a bit stupid, since it
prints &amp;quot;app.hex is created&amp;quot; when no such file is actually
created.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>