Debuging

  • : Function ereg() is deprecated in /home/project-web/tinyos8051wg/htdocs/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/project-web/tinyos8051wg/htdocs/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/project-web/tinyos8051wg/htdocs/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/project-web/tinyos8051wg/htdocs/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/project-web/tinyos8051wg/htdocs/includes/file.inc on line 647.
  • : Function ereg() is deprecated in /home/project-web/tinyos8051wg/htdocs/includes/file.inc on line 647.

The following page contains some debugging advice based on questions posted on the mailing list.

7.1 Problems compiling


In order to compile the code found here you need to setup the TinyOS 2 distribution as well as your compiler.

  • Check your environment, in particular check if the location of contrib and tinyos are correct.
    $CONTRIBROOT=/opt/tinyos-2.x-contrib/
    $TOSDIR=/opt/tinyos-2.x/tos
    $TOSROOT=/opt/tinyos-2.x
    $MAKERULES=/opt/tinyos-2.x/support/make/Makerules
    $TOSMAKE_PATH=/opt/tinyos-2.x/support/make/
    $MSC51_COMPILER=keil

  • Code size limit of Keil evaluation version. The evaluation version of Keil limits the code size, so if you experience errors such as the following, you need to either buy Keil og find a different compiler.
    *******************************************************************************
    * RESTRICTED VERSION WITH 0800H BYTE CODE SIZE LIMIT; USED: 137DH BYTE  (243%) *
    ******************************************************************************
    
    *** ERROR L250: CODE SIZE LIMIT IN RESTRICTED VERSION EXCEEDED LIMIT: 0800H BYTES
    
    

BlinkNoTimer doesn't work

BlinkNoTimer is a good starting point to check your envirionment. It should work for the supported platforms and should be easy to adapt to other platforms.

8. Debuging features

  • StdOut. We provide a basic print library that might help you in uncovering your problems:
       call StdOut.print("Hello world!");
    
  • In-circuit-debug. Some compilers provide in-circuit-debug features:

    • Keil PK51: contains a simulator and a target monitor.
    • IAR: C-Spy (remember to set output format to C-SPY under the IAR project options -> Linker ->Output)


  • Back to basics. If all else fails, try to get the most simple working. The flollowing program for CC2430 sets all pins of P0 low and all pins of P1 high.
    #include < cc2430.h >
    void main(void) {
        P0SEL = 0;     //general purpose I/O
        P0DIR = 0xFF;  //output
        P0 = 0x00;
        P1SEL = 0;     //general purpose I/O
        P1DIR = 0xFF;  //output
        P1 = 0xFF;
    }