0

I usually work with cooja within Contiki. However, I wanted to test RPL with Contiki-ng.

I successfully installed Contiki-ng on my machine (macOS v10.15 (Catalina)). When I build the examples in the terminal, they build successfully and I can implement then as a native target. However, when I try to compile them to run a cooja simulation I get these errors:

[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - > make hello-world.sky TARGET=sky
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   MKDIR     build/sky/obj
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   CC        ../../os/contiki-main.c
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - In file included from ../../arch/cpu/msp430/./msp430-def.h:46:0,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../arch/platform/sky/./contiki-conf.h:12,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki.h:37,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki-main.c:43:
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./legacymsp430.h:62:0: error: "_EINT" redefined
> [-Werror]
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - In file included from
> /usr/local/Cellar/gcc-msp430/4.7.0-20120911_2/lib/gcc/msp430/4.7.0/../../../../msp430/include/in430.h:4:0,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from
> /usr/local/Cellar/gcc-msp430/4.7.0-20120911_2/lib/gcc/msp430/4.7.0/../../../../msp430/include/msp430f1611.h:122,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from
> /usr/local/Cellar/gcc-msp430/4.7.0-20120911_2/lib/gcc/msp430/4.7.0/../../../../msp430/include/msp430.h:165,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../arch/cpu/msp430/./msp430-def.h:45,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../arch/platform/sky/./contiki-conf.h:12,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki.h:37,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki-main.c:43:
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - /usr/local/Cellar/gcc-msp430/4.7.0-20120911_2/lib/gcc/msp430/4.7.0/../../../../msp430/include/intrinsics.h:162:0: note: this is the location of the previous definition
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - In file included from ../../arch/cpu/msp430/./msp430-def.h:46:0,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../arch/platform/sky/./contiki-conf.h:12,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki.h:37,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki-main.c:43:
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./legacymsp430.h:63:0: error: "_DINT" redefined
> [-Werror]
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - In file included from
> /usr/local/Cellar/gcc-msp430/4.7.0-20120911_2/lib/gcc/msp430/4.7.0/../../../../msp430/include/in430.h:4:0,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from
> /usr/local/Cellar/gcc-msp430/4.7.0-20120911_2/lib/gcc/msp430/4.7.0/../../../../msp430/include/msp430f1611.h:122,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from
> /usr/local/Cellar/gcc-msp430/4.7.0-20120911_2/lib/gcc/msp430/4.7.0/../../../../msp430/include/msp430.h:165,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../arch/cpu/msp430/./msp430-def.h:45,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../arch/platform/sky/./contiki-conf.h:12,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki.h:37,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki-main.c:43:
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - /usr/local/Cellar/gcc-msp430/4.7.0-20120911_2/lib/gcc/msp430/4.7.0/../../../../msp430/include/intrinsics.h:163:0: note: this is the location of the previous definition
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - In file included from ../../arch/cpu/msp430/./msp430-def.h:66:0,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../arch/platform/sky/./contiki-conf.h:12,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki.h:37,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki-main.c:43:
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:7:1: error: expected identifier or
> '(' before '<' token
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - In file included from ../../arch/cpu/msp430/./msp430-def.h:66:0,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../arch/platform/sky/./contiki-conf.h:12,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki.h:37,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki-main.c:43:
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:32:3: error: stray '\302' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:32:3: error: stray '\267' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - In file included from ../../arch/cpu/msp430/./msp430-def.h:66:0,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../arch/platform/sky/./contiki-conf.h:12,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki.h:37,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki-main.c:43:
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:154:10: error: missing terminating '
> character [-Werror]
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:154:5: error: missing terminating '
> character
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:200:7: error: stray '\342' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:200:7: error: stray '\206' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:200:7: error: stray '\265' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:205:7: error: stray '\342' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:205:7: error: stray '\206' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:205:7: error: stray '\265' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:241:7: error: stray '\342' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:241:7: error: stray '\206' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:241:7: error: stray '\265' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:246:7: error: stray '\342' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:246:7: error: stray '\206' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:246:7: error: stray '\265' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:273:7: error: stray '\342' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:273:7: error: stray '\206' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:273:7: error: stray '\265' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:278:7: error: stray '\342' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:278:7: error: stray '\206' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:278:7: error: stray '\265' in program
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:321:10: error: missing terminating '
> character [-Werror]
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:321:5: error: missing terminating '
> character
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:408:12: error: missing terminating "
> character [-Werror]
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:408:1: error: missing terminating "
> character
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:411:3: error: missing terminating "
> character [-Werror]
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:411:3: error: missing terminating "
> character
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - In file included from ../../arch/cpu/msp430/./msp430-def.h:66:0,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../arch/platform/sky/./contiki-conf.h:12,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki.h:37,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../os/contiki-main.c:43:
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:416:20: error: missing terminating "
> character [-Werror]
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:416:9: error: missing terminating "
> character
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:420:1: error: missing terminating "
> character [-Werror]
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - ../../arch/cpu/msp430/./stdint.h:420:1: error: missing terminating "
> character
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - In file included from ../../arch/cpu/msp430/./msp430-def.h:66:0,
>      [java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -                  from ../../arch/platform/sky/./contiki-conf.h:12,

I assume the problem is with msp430, but I successfully installed and I don’t know where the issue is.

I also tried to run the Docker image, but as I'm quite new to Docker. I couldn't run it as I don't understand these steps "prepare contiker function, run contiker: $ contiker bash"

How can I fix it?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Sara Sosh
  • 3
  • 3
  • 1
    Please edit your post with the error message formatted as a code block. Currently it not readable – kfx Dec 23 '19 at 20:24
  • How did you get the file `arch/cpu/msp430/./legacymsp430.h` and similar ones? They are not part of Contiki-NG, and should be in the msp430 header file location. – kfx Dec 23 '19 at 20:25
  • When I first started I get the error that these files arch/cpu/msp430/./legacymsp430.h are missing, so I downloaded them from git hub. I add them into the file system within the msp430 folder. – Sara Sosh Dec 23 '19 at 22:01
  • It then appears that you have installed the Contiki-NG toolchain incorrectly. It may be best to delete things and start from scratch again. I add to the recommendation to use Docker for an easy start. – kfx Dec 24 '19 at 08:27
  • It does seem that using Docker is the best choice if you could kindly explain the last two steps? I did pull the container correctly but when I try to execute cooja it gives me this error: " Buildfile: /home/user/contiki-ng/tools/cooja/build.xml does not exist! Build failed" – Sara Sosh Dec 24 '19 at 18:34
  • At least some of the problem is the ***stray errors***, e.g. "`error: stray '\342' in program. error: stray '\206' in program. error: stray '\265' in program`". 342 (octal) is a signature for [UTF-8](https://en.wikipedia.org/wiki/UTF-8) sequences. This is a ***very*** common error when copying code from web pages, [PDF](https://en.wikipedia.org/wiki/Portable_Document_Format) documents, through chat (e.g. [Skype Chat](https://en.wikipedia.org/wiki/Features_of_Skype#Skype_chat) or [Facebook Messenger](https://en.wikipedia.org/wiki/Facebook_Messenger)), etc. – Peter Mortensen Apr 25 '23 at 18:06
  • cont' - The canonical question is *[Compilation error: stray ‘\302’ in program, etc.](https://stackoverflow.com/questions/19198332)* – Peter Mortensen Apr 25 '23 at 18:07
  • Analysis: 342 206 265 (octal) → 0xE2 0x86 0xB5 (hexadecimal) → UTF-8 sequence for Unicode code point U+FF1A ([DOWNWARDS ARROW WITH CORNER LEFTWARDS](https://www.charset.org/utf-8/9)). That is probably from some representation of return/newline. – Peter Mortensen Apr 25 '23 at 18:10

0 Answers0