[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/Deluge/TOSBoot ExtFlash.nc, NONE, 1.1 Hardware.nc, NONE, 1.1 ProgFlash.nc, NONE, 1.1 Makefile, 1.8, 1.9 TOSBoot.nc, 1.7, 1.8 TOSBootM.nc, 1.14, 1.15 TOSBootExtFlash.h, 1.2, NONE TOSBootExtFlash.nc, 1.3, NONE TOSBootProgFlash.h, 1.2, NONE TOSBootProgFlash.nc, 1.2, NONE

Jonathan Hui jwhui at users.sourceforge.net
Thu Jul 21 11:54:27 PDT 2005


Update of /cvsroot/tinyos/tinyos-1.x/beta/Deluge/Deluge/TOSBoot
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv338

Modified Files:
	Makefile TOSBoot.nc TOSBootM.nc 
Added Files:
	ExtFlash.nc Hardware.nc ProgFlash.nc 
Removed Files:
	TOSBootExtFlash.h TOSBootExtFlash.nc TOSBootProgFlash.h 
	TOSBootProgFlash.nc 
Log Message:
- Added mica2 support to TOSBoot for Deluge 2.0.



--- NEW FILE: ExtFlash.nc ---
// $Id: ExtFlash.nc,v 1.1 2005/07/21 18:54:24 jwhui Exp $

/*									tab:2
 *
 *
 * "Copyright (c) 2000-2005 The Regents of the University  of California.  
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose, without fee, and without written agreement is
 * hereby granted, provided that the above copyright notice, the following
 * two paragraphs and the author appear in all copies of this software.
 * 
 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
 *
 */

/**
 * @author Jonathan Hui <jwhui at cs.berkeley.edu>
 */

interface ExtFlash {
  command void startRead(uint32_t addr);
  command uint8_t  readByte();
  command void stopRead();
}

--- NEW FILE: Hardware.nc ---
// $Id: Hardware.nc,v 1.1 2005/07/21 18:54:24 jwhui Exp $

/*									tab:2
 *
 *
 * "Copyright (c) 2000-2005 The Regents of the University  of California.  
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose, without fee, and without written agreement is
 * hereby granted, provided that the above copyright notice, the following
 * two paragraphs and the author appear in all copies of this software.
 * 
 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
 *
 */

/**
 * @author Jonathan Hui <jwhui at cs.berkeley.edu>
 */

interface Hardware {
  command void init();
  command void reboot();
}

--- NEW FILE: ProgFlash.nc ---
// $Id: ProgFlash.nc,v 1.1 2005/07/21 18:54:24 jwhui Exp $

/*									tab:2
 *
 *
 * "Copyright (c) 2000-2005 The Regents of the University  of California.  
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose, without fee, and without written agreement is
 * hereby granted, provided that the above copyright notice, the following
 * two paragraphs and the author appear in all copies of this software.
 * 
 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
 *
 */

/**
 * @author Jonathan Hui <jwhui at cs.berkeley.edu>
 */

interface ProgFlash {
  command result_t write(uint32_t addr, uint8_t* buf, uint16_t len);
}

Index: Makefile
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/Deluge/TOSBoot/Makefile,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Makefile	19 Jul 2005 19:48:54 -0000	1.8
--- Makefile	21 Jul 2005 18:54:24 -0000	1.9
***************
*** 37,40 ****
--- 37,46 ----
  -Os
  
+ ifeq ($(MAKECMDGOALS),mica2)
+   CFLAGS += -DTOSBOOT_START=0x1f000 -DTOSBOOT_END=0x20000
+   CFLAGS += -Wl,--section-start=.text=0x1f000
+   CFLAGS += -Iat45db -Iavr -Imica2
+ endif
+ 
  ifeq ($(MAKECMDGOALS),telosa)
    CFLAGS += -DTOSBOOT_START=0x1100 -DTOSBOOT_END=0x1a00

Index: TOSBoot.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/Deluge/TOSBoot/TOSBoot.nc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TOSBoot.nc	17 Jul 2005 20:53:18 -0000	1.7
--- TOSBoot.nc	21 Jul 2005 18:54:24 -0000	1.8
***************
*** 1,8 ****
  // $Id$
  
! /*									tab:4
   *
   *
!  * "Copyright (c) 2000-2004 The Regents of the University  of California.  
   * All rights reserved.
   *
--- 1,8 ----
  // $Id$
  
! /*									tab:2
   *
   *
!  * "Copyright (c) 2000-2005 The Regents of the University  of California.  
   * All rights reserved.
   *
***************
*** 31,36 ****
  includes Deluge;
  includes TOSBoot;
- includes TOSBootExtFlash;
- includes TOSBootProgFlash;
  
  configuration TOSBoot {
--- 31,34 ----
***************
*** 42,45 ****
--- 40,44 ----
      ExecC,
      ExtFlashC,
+     HardwareC,
      InternalFlashC as IntFlash,
      LedsC,
***************
*** 53,56 ****
--- 52,56 ----
    TOSBootM.Exec -> ExecC;
    TOSBootM.ExtFlash -> ExtFlashC;
+   TOSBootM.Hardware -> HardwareC;
    TOSBootM.IntFlash -> IntFlash;
    TOSBootM.Leds -> LedsC;

Index: TOSBootM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/Deluge/TOSBoot/TOSBootM.nc,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** TOSBootM.nc	12 Jul 2005 22:10:32 -0000	1.14
--- TOSBootM.nc	21 Jul 2005 18:54:24 -0000	1.15
***************
*** 32,39 ****
    uses {
      interface Exec;
      interface InternalFlash as IntFlash;
      interface Leds;
!     interface TOSBootExtFlash as ExtFlash;
!     interface TOSBootProgFlash as ProgFlash;
      interface StdControl as SubControl;
      interface Voltage;
--- 32,40 ----
    uses {
      interface Exec;
+     interface ExtFlash;
+     interface Hardware;
      interface InternalFlash as IntFlash;
      interface Leds;
!     interface ProgFlash;
      interface StdControl as SubControl;
      interface Voltage;
***************
*** 169,177 ****
    }
  
-   void reboot() {
-     WDTCTL = WDT_ARST_1_9;
-     while(1);
-   }
- 
    void runApp() {
      call SubControl.stop();
--- 170,173 ----
***************
*** 206,210 ****
        //   not much else we can do :-/
        if (programImage(TOSBOOT_GOLDEN_IMG_ADDR) == R_PROGRAMMING_ERROR)
! 	reboot();
      }
      else {
--- 202,206 ----
        //   not much else we can do :-/
        if (programImage(TOSBOOT_GOLDEN_IMG_ADDR) == R_PROGRAMMING_ERROR)
! 	call Hardware.reboot();
      }
      else {
***************
*** 216,220 ****
  	//   after two tries, try programming the golden image
  	if (programImage(args.imageAddr) == R_PROGRAMMING_ERROR)
! 	  reboot();
        }
      }
--- 212,216 ----
  	//   after two tries, try programming the golden image
  	if (programImage(args.imageAddr) == R_PROGRAMMING_ERROR)
! 	  call Hardware.reboot();
        }
      }
***************
*** 237,247 ****
  
      TOSH_SET_PIN_DIRECTIONS();
!     
!     BCSCTL1 = RSEL0 + RSEL1 + RSEL2;
!     DCOCTL = DCO0 + DCO1 + DCO2;
  
      call SubControl.init();
      call SubControl.start();
!     
      startupSequence();
  
--- 233,241 ----
  
      TOSH_SET_PIN_DIRECTIONS();
!     call Hardware.init();
  
      call SubControl.init();
      call SubControl.start();
! 
      startupSequence();
  

--- TOSBootExtFlash.h DELETED ---

--- TOSBootExtFlash.nc DELETED ---

--- TOSBootProgFlash.h DELETED ---

--- TOSBootProgFlash.nc DELETED ---



More information about the Tinyos-beta-commits mailing list