On 9/25/06, Сергей Кушнир <[EMAIL PROTECTED]> wrote:
Hello, David! I'm sorry asking specifically you, I have wrote about my problem in threads TinyOS-help & TimyOS-devel, but didn't get any answer :( In our research laboratory in Institute of Radio-Electronics of Russian Academy of Science we develope wireless transmitters/receivers based on chaotic communication. And the core of our platform is Atmel's microcontroller ATmega168. I have wrote a test platform (based on Mica2's files - actually changed ATm128 registers to appropriate ones of ATm168) that allows me to perfom application Blink. But when I'm trying to compile it, compiler exclaims, that "atmega168 is unknown target". Indeed, when I saw supported targets by avr-gcc, there wasn't ATmega168. That is, AVR toolchain with TinyOS 2.0 is older that I need. So, I have configured & installed Binutils 2.16.1 (./configure --target=avr), GNU GCC 3.4.6 (./configure --target=avr --enable-languages="c"), and the latest AVR Libc 1.4.4. I changed paths to new versions of tools and tryed to compile Blink for mica2 platform, but compiler showed me:
We use a patched avr-binutils to allow $ in identifiers (used by the nesC compiler), so you need to apply the attached patch. In a binutils tree, the following should work: patch -p1 <tinyos-binutils.diff This patch is for 2.15, I expect it should work for 2.16 too (the changes are small). FWIW, nesC 1.2.8 will have an option to use a different separator than "$" (I can hear the crys of joy already ;-)). Btw: this patch modifies both the AVR and msp430 assemblers. David Gay
usr/local/lib/gcc/avr/3.4.6/../../../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>." /tmp/ccBuWqI9.s: Assembler messages: /tmp/ccBuWqI9.s:10: Error: unknown opcode `atm128powe' /tmp/ccBuWqI9.s:12: Error: unrecognized symbol type "" /tmp/ccBuWqI9.s:12: Error: unknown opcode `atm128powe' /tmp/ccBuWqI9.s:13: Error: expected comma after name `McuSleepC' in .size directive /tmp/ccBuWqI9.s:13: Error: unknown opcode `atm128powe' /tmp/ccBuWqI9.s:14: Error: unknown opcode `mcusleepc' /tmp/ccBuWqI9.s:48: Error: unrecognized symbol type "" /tmp/ccBuWqI9.s:48: Error: unknown opcode `hplcc1000' /tmp/ccBuWqI9.s:48: Error: unknown opcode `write' ............................................................................ What is it? Version conflict? I have chosen these versions of GCC&Binutils which are described in readme of AVRLibC. Maybe, the problem is in Nesc compiler? What I have to do with it? Please, dont ignore my request! Best regards Sergey, 5-year student of Moscow Institute of Physics and Technology
diff --recur -u binutils-2.15/bfd/configure.in avr-binutils-2.15tinyos/bfd/configure.in --- binutils-2.15/bfd/configure.in 2004-05-17 12:35:57.000000000 -0700 +++ avr-binutils-2.15tinyos/bfd/configure.in 2005-03-25 11:37:01.000000000 -0800 @@ -7,7 +7,7 @@ AC_CANONICAL_SYSTEM AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.15) +AM_INIT_AUTOMAKE(bfd, 2.15-tinyos) # Uncomment the next line to remove the date from the reported bfd version is_release=y diff --recur -u binutils-2.15/gas/config/tc-avr.h avr-binutils-2.15tinyos/gas/config/tc-avr.h --- binutils-2.15/gas/config/tc-avr.h 2002-09-04 17:01:17.000000000 -0700 +++ avr-binutils-2.15tinyos/gas/config/tc-avr.h 2005-05-20 12:03:31.000000000 -0700 @@ -113,8 +113,12 @@ would print `12 34 56 78'. The default value is 4. */ #define LISTING_WORD_SIZE 2 -/* AVR port uses `$' as a logical line separator */ -#define LEX_DOLLAR 0 +/* AVR port uses `$' as a logical line separator and doesn't + allow it in symbols. We allow it in the middle of symbols. + We also hack get_symbol_end to disallow it at the end of a symbol. */ +#define LEX_DOLLAR 1 +#define TC_EOL_IN_INSN(PTR) (*(PTR) == '$' && is_part_of_name((PTR)[-1]) && is_part_of_name((PTR)[1])) +#define TC_FORBID_DOLLAR_AT_END /* An `.lcomm' directive with no explicit alignment parameter will use this macro to set P2VAR to the alignment that a request for diff --recur -u binutils-2.15/gas/config/tc-msp430.h avr-binutils-2.15tinyos/gas/config/tc-msp430.h --- binutils-2.15/gas/config/tc-msp430.h 2002-12-30 11:25:07.000000000 -0800 +++ avr-binutils-2.15tinyos/gas/config/tc-msp430.h 2005-03-25 11:37:46.000000000 -0800 @@ -101,7 +101,7 @@ example, a value of 2 might print `1234 5678' where a value of 1 would print `12 34 56 78'. The default value is 4. */ -#define LEX_DOLLAR 0 +#undef LEX_DOLLAR /* MSP430 port does not use `$' as a logical line separator */ #define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) (P2VAR) = 0 diff --recur -u binutils-2.15/gas/expr.c avr-binutils-2.15tinyos/gas/expr.c --- binutils-2.15/gas/expr.c 2004-05-17 12:36:07.000000000 -0700 +++ avr-binutils-2.15tinyos/gas/expr.c 2005-05-20 12:04:11.000000000 -0700 @@ -1900,6 +1900,15 @@ ; if (is_name_ender (c)) c = *input_line_pointer++; +#ifdef TC_FORBID_DOLLAR_AT_END + /* This is for the Atmel AVR platforms. We want to allow $ in symbols + but also as a line separator. Yucky. */ + if (input_line_pointer[-2] == '$') + { + input_line_pointer--; + c = '$'; + } +#endif } *--input_line_pointer = 0; return (c);
_______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help