Ok!
It appears that the makefile has a setting SENSORBOARD which is set to
micasb. On changing it to imote2, it no longer uses the mica tools.
Progress!
But I still get plenty of warnings.
I am attaching the output of compilation, the makefile and the makerules
that I think it uses below. Any idea what to do?
COMPILATION OUTPUT:
________________________________________________________________________________
$ make imote2 debug
mkdir -p build/imote2
xscale-elf-as -mcpu=iwmmxt -mfpu=softfpa -defsym BOOTLOADER=1
/cygdrive/c/tinyos
-1.x/tos/platform/pxa27x/../imote2/flash.s
/cygdrive/c/tinyos-1.x/tos/platform/p
xa27x/../imote2/binarymover.s
/cygdrive/c/tinyos-1.x/tos/platform/pxa27x/barecrt
.s /cygdrive/c/tinyos-1.x/tos/platform/pxa27x/mmu_table.s
/cygdrive/c/tinyos-1.x
/tos/platform/pxa27x/util.s -o build/imote2/asms.o
cd /cygdrive/c/tinyos-1.x/tos/platform/pxa27x/lib; make;
make[1]: Entering directory
`/cygdrive/c/tinyos-1.x/beta/platform/pxa27x/lib'
xscale-elf-gcc -g -O2 -Wall -I/cygdrive/c/tinyos-1.x/tos/platform/pxa27x
-I/cygd
rive/c/tinyos-1.x/tos/platform/pxa27x/lib/DSP
-I/cygdrive/c/tinyos-1.x/tos/platf
orm/pxa27x/lib/ -c -o bufferManagement.o bufferManagement.c
In file included from bufferManagement.c:2:
assert.h:8: warning: `C' attribute directive ignored
In file included from bufferManagement.c:4:
systemUtil.h:28: warning: `C' attribute directive ignored
systemUtil.h:28: warning: `spontaneous' attribute directive ignored
xscale-elf-gcc -g -O2 -Wall -I/cygdrive/c/tinyos-1.x/tos/platform/pxa27x
-I/cygd
rive/c/tinyos-1.x/tos/platform/pxa27x/lib/DSP
-I/cygdrive/c/tinyos-1.x/tos/platf
orm/pxa27x/lib/ -c -o downsample.o downsample.c
xscale-elf-gcc -g -O2 -Wall -I/cygdrive/c/tinyos-1.x/tos/platform/pxa27x
-I/cygd
rive/c/tinyos-1.x/tos/platform/pxa27x/lib/DSP
-I/cygdrive/c/tinyos-1.x/tos/platf
orm/pxa27x/lib/ -c -o frequency.o frequency.c
xscale-elf-gcc -g -O2 -Wall -I/cygdrive/c/tinyos-1.x/tos/platform/pxa27x
-I/cygd
rive/c/tinyos-1.x/tos/platform/pxa27x/lib/DSP
-I/cygdrive/c/tinyos-1.x/tos/platf
orm/pxa27x/lib/ -c -o paramtask.o paramtask.c
In file included from paramtask.c:4:
systemUtil.h:28: warning: `C' attribute directive ignored
systemUtil.h:28: warning: `spontaneous' attribute directive ignored
xscale-elf-gcc -g -O2 -Wall -I/cygdrive/c/tinyos-1.x/tos/platform/pxa27x
-I/cygd
rive/c/tinyos-1.x/tos/platform/pxa27x/lib/DSP
-I/cygdrive/c/tinyos-1.x/tos/platf
orm/pxa27x/lib/ -c -o profile.o profile.c
xscale-elf-gcc -g -O2 -Wall -I/cygdrive/c/tinyos-1.x/tos/platform/pxa27x
-I/cygd
rive/c/tinyos-1.x/tos/platform/pxa27x/lib/DSP
-I/cygdrive/c/tinyos-1.x/tos/platf
orm/pxa27x/lib/ -c -o queue.o queue.c
xscale-elf-gcc -g -O2 -Wall -I/cygdrive/c/tinyos-1.x/tos/platform/pxa27x
-I/cygd
rive/c/tinyos-1.x/tos/platform/pxa27x/lib/DSP
-I/cygdrive/c/tinyos-1.x/tos/platf
orm/pxa27x/lib/ -c -o systemUtil.o systemUtil.c
In file included from systemUtil.c:2:
systemUtil.h:28: warning: `C' attribute directive ignored
systemUtil.h:28: warning: `spontaneous' attribute directive ignored
xscale-elf-gcc -g -O2 -Wall -I/cygdrive/c/tinyos-1.x/tos/platform/pxa27x
-I/cygd
rive/c/tinyos-1.x/tos/platform/pxa27x/lib/DSP
-I/cygdrive/c/tinyos-1.x/tos/platf
orm/pxa27x/lib/ -c -o utils.o utils.c
xscale-elf-gcc -g -O2 -Wall -I/cygdrive/c/tinyos-1.x/tos/platform/pxa27x
-I/cygd
rive/c/tinyos-1.x/tos/platform/pxa27x/lib/DSP
-I/cygdrive/c/tinyos-1.x/tos/platf
orm/pxa27x/lib/ -c -o wmmx.o wmmx.c
xscale-elf-ar -rvs libimote2.a bufferManagement.o downsample.o frequency.o
para
mtask.o profile.o queue.o systemUtil.o utils.o wmmx.o
r - bufferManagement.o
r - downsample.o
r - frequency.o
r - paramtask.o
r - profile.o
r - queue.o
r - systemUtil.o
r - utils.o
r - wmmx.o
make[1]: Leaving directory `/cygdrive/c/tinyos-1.x/beta/platform/pxa27x/lib'
compiling TinyDBApp to a imote2 binary
ncc -o build/imote2/main.exe -g -fnesc-no-inline -I %T/lib/Util
-I%T/lib/Attribu
tes -I%T/lib/Commands -I%T/lib/TinyDB -I%T/lib/MintRoute -I%T/lib/Queue
-I%T/li
b/FS -I%T/lib/TinyDB/Aggregates -fno-strict-aliasing
-I/cygdrive/c/tinyos-1.x/to
s/lib/CC2420Radio -I/cygdrive/c/tinyos-1.x/tos/lib/Flash
-DAUTO_BATTERY_MONITORI
NG=1 -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -target=imote2
-fnesc-cfi
le=build/imote2/app.c -board=imote2 -DTOSH_DATA_LENGTH=49 -DBOOTLOADER
-DIDENT_P
ROGRAM_NAME=\"TinyDBApp\" -DIDENT_USER_ID=\"windows\"
-DIDENT_HOSTNAME=\"acomput
ername\" -DIDENT_USER_HASH=0x0ed9aaeaL -DIDENT_UNIX_TIME=0x4941f869L
-DIDENT_UID
_HASH=0x85f1c7deL TinyDBApp.nc -lm build/imote2/asms.o
/cygdrive/c/tinyos-1.x/t
os/platform/pxa27x/lib/libimote2.a
c:/tinyos-1.x/beta/platform/imote2/BufferedSTUARTM.nc:21:1: warning:
"NUMBUFFERS
" redefined
In file included from <command line>:22:
C:/cygwin/tmp/nesccppm2qeRLNX:2482:1: warning: this is the location of the
previ
ous definition
c:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc: In function
`RadioQueue.enqueue':
c:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc:3747: implicit declaration of
funct
ion `wdt_enable'
c:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc:3747: `WDTO_15MS' undeclared
(first
use in this function)
c:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc:3747: (Each undeclared
identifier i
s reported only once
c:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc:3747: for each function it
appears
in.)
c:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc: In function `signalError':
c:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc:3788: implicit declaration of
funct
ion `itoa'
c:/tinyos-1.x/tos/system/VoltageC.nc: At top level:
c:/tinyos-1.x/tos/system/VoltageC.nc:34: C file Voltage not found
c:/tinyos-1.x/tos/system/VoltageC.nc:51: `TOS_ADC_VOLTAGE_PORT' undeclared
here
(not in a function)
c:/tinyos-1.x/tos/system/ADCM.nc: In function `HPLADC.dataReady':
c:/tinyos-1.x/tos/system/ADCM.nc:112: `TOSH_ADC_PORTMAPSIZE' undeclared
(first u
se in this function)
c:/tinyos-1.x/tos/system/ADCM.nc: In function `startGet':
c:/tinyos-1.x/tos/system/ADCM.nc:136: `TOSH_ADC_PORTMAPSIZE' undeclared
(first u
se in this function)
c:/tinyos-1.x/tos/system/ADCC.nc: At top level:
c:/tinyos-1.x/tos/system/ADCC.nc:54: component HPLADCC not found
c:/tinyos-1.x/tos/system/ADCC.nc:58: no match
c:/tinyos-1.x/tos/system/VoltageC.nc:45: component VoltageM not found
c:/tinyos-1.x/tos/system/VoltageC.nc:47: no match
c:/tinyos-1.x/tos/system/VoltageC.nc:49: no match
c:/tinyos-1.x/tos/system/VoltageC.nc:51: constant expression expected
c:/tinyos-1.x/tos/system/VoltageC.nc:51: cannot find `ADC'
c:/tinyos-1.x/tos/system/VoltageC.nc:52: cannot find `ADCControl'
make: *** [exe0] Error 1
________________________________________________________________________________
Makefile:
COMPONENT=TinyDBApp
SENSORBOARD=imote2
PFLAGS=-I %T/lib/Util -I%T/lib/Attributes -I%T/lib/Commands -I%T/lib/TinyDB
-I%T
/lib/MintRoute -I%T/lib/Queue -I%T/lib/FS -I%T/lib/TinyDB/Aggregates
-fno-stric
t-aliasing
MSG_SIZE=49
include ../Makerules
_________________________________________________________________________________
Makerules
(I have attached it as a file)
_________________________________________________________________________________
Message: 7
Date: Thu, 11 Dec 2008 22:20:55 -0500
From: Rahul Iyer <[email protected]>
Subject: [Tinyos-help] TinyDB setup trouble on IntelMote2
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Hi,
I've got the TinyOS Blink App to compile on Intel Imote2 - so I know
TinyOS has been setup properly. But I can't get TinyDBApp to compile.
Furthermore, there isn't much documentation about this - most
documentation deals with Mica motes. When compiling the TinyDB app for
the intelmote, the included make file appears to use the Mica
compilers for some reason. I haven't had much experience with nesC or
TinyOS, so I'm not sure what's going on in the background, or how to
port it to the intelmotes. Any suggestions? Thanks.
Sincerely,
Rahul
------------------------------
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
End of Tinyos-help Digest, Vol 68, Issue 28
*******************************************
#-*-Makefile-*- vim:syntax=make
#$Id: Makerules,v 1.37 2004/11/07 15:22:14 mdwelsh Exp $
######################################################################
# Base Makefile for nesC apps.
#
# Created: 6/2002, Philip Levis <[email protected]>
#
# Updated: 6/18/2002 Rob von Behren <[email protected]>
# Multi-platform support
#
# Updated: 6/20/2002 David Gay <[email protected]>
# Compile via gcc, make tos.th system-wide, not app-wide
# (still need to ponder group selection)
#
# Updated: 6/27/2003 Jaein Jeong <[email protected]>
# In-network programming support for mica2, mica2dot platforms
#
######################################################################
ifndef MAKERULES
MAKERULES=$(shell ncc -print-tosdir)/../apps/Makerules
endif
ifndef QUELL_RECURSIVE_TINYOS_APPS_MAKERULES
QUELL_RECURSIVE_TINYOS_APPS_MAKERULES=1
include $(MAKERULES)
else
# this needs to be -dlpt=3 on thinkpads
# PROGRAMMER_EXTRA_FLAGS :=
# We don't actually set it here, so you can either set the
# PROGRAMMER_EXTRA_FLAGS environment variable (recommended) or
# define it in ../Makelocal
-include $(shell ncc -print-tosdir)/../apps/Makelocal
# User configuration:
# Specify user values in Makelocal to override the defaults here
ifndef DEFAULT_LOCAL_GROUP
DEFAULT_LOCAL_GROUP := 0x7d
endif
ifndef OPTFLAGS
OPTFLAGS := -Os
endif
ifndef NESC_FLAGS
NESC_FLAGS := -Wnesc-all
endif
# configure the base for the app dirs. This is used to generate more
# useful package names in the documentation.
ifeq ($(BASEDIR)_x, _x)
BASEDIR := $(shell pwd | sed 's...@\(.*\)/apps....@\1@' )
endif
# The output directory for generated documentation
ifeq ($(DOCDIR)_x, _x)
DOCDIR := $(BASEDIR)/doc/nesdoc
endif
##################################################
#
##################################################
ifeq ($(PLATFORMS)_x, _x)
PLATFORMS = mica mica2 mica2dot pc
endif
OBJCOPY = avr-objcopy
SET_ID = set-mote-id
PROGRAMER = uisp
ifdef MSG_SIZE
PFLAGS := -DTOSH_DATA_LENGTH=$(MSG_SIZE) $(PFLAGS)
endif
#ifdef APP_DIR
#PFLAGS := -I$(APP_DIR) $(PFLAGS)
#endif
# This is for network reprogramming
# If XNP is defined, add the network reprogramming related files
# to the search path and generate a timestamp to make each build unique.
XNP_DIR := ../../tos/lib/Xnp
ifdef XNP
PFLAGS := -I$(XNP_DIR) $(shell $(XNP_DIR)/ident.pl .ident_install_id
$(COMPONENT)) $(PFLAGS)
endif
PFLAGS := $(PFLAGS) -Wall -Wshadow
-DDEF_TOS_AM_GROUP=$(DEFAULT_LOCAL_GROUP) $(NESC_FLAGS)
NCC = ncc
LIBS = -lm
######################################################################
# Choose platform options, based on MAKECMDGOALS
######################################################################
# be quieter....
#ifeq ($(VERBOSE_MAKE)_x, _x)
#MAKEFLAGS += -s
#endif
#export VERBOSE_MAKE
define USAGE
Usage: make <platform>
make all
make clean
make install[.n] <platform>
make reinstall[.n] <platform> # no rebuild of target
make docs <platform>
Valid platforms are: $(PLATFORMS)
endef
PLATAUX=$(PLATFORMS) all
PLATFORM := $(filter $(PLATAUX), $(MAKECMDGOALS))
PFLAGS := -target=$(PLATFORM) $(PFLAGS)
MAKECMDGOALS := $(filter-out $(PLATAUX), $(MAKECMDGOALS))
#########################################################################
# TinySec processing
#########################################################################
ifndef TINYSEC
TINYSEC := false # default: disable tinysec
endif
# The tinysec keyfile to use and the default key name (this re matches the
# first key. you can explicitly list keys by: make mica KEYNAME=mykeyname
KEYFILE := $(HOME)/.tinyos_keyfile
KEYNAME := '\w+'
ifeq ($(TINYSEC),true)
TINYSEC_KEY := $(shell mote-key -kf $(KEYFILE) -kn $(KEYNAME))
ifeq ($(TINYSEC_KEY),)
$(error tinysec key has not been properly set. It is needed for tinysec. \
Check to make sure that the script exists)
endif
PFLAGS := $(PFLAGS) -I%T/lib/TinySec -I%T/platform/%p/TinySec
-DTINYSEC_KEY="$(TINYSEC_KEY)" -DTINYSEC_KEYSIZE=8
ifeq ($(PLATFORM),mica2dot)
PFLAGS := $(PFLAGS) -I%T/platform/mica2/TinySec
endif
endif
#########################################################################
# Programming Boards : flags
#########################################################################
ifeq ($(shell uname),FreeBSD)
PROGRAMMER_FLAGS=-dlpt=/dev/ppi0 -dprog=dapa $(PROGRAMMER_PART)
$(PROGRAMMER_EXTRA_FLAGS)
else
PROGRAMMER_FLAGS=-dprog=dapa $(PROGRAMMER_PART)
$(PROGRAMMER_EXTRA_FLAGS)
endif
PROGRAMMER := DAPA
#########################################################################
# Programming Boards : command line input
# Command line input for programmers:
# none : default to parallel programming board
# MIB510=<dev> : use mib510 serial port programming board at port <dev>
# EPRB=<host> : use eprb at hostname <host>
# AVRISP=<dev> : use AVRISP serial programmer at port <dev>
#########################################################################
### If MIB510 then
MIB5100 := $(subst MIB510=,,$(filter MIB510=%,$(MAKECMDGOALS)))
ifneq ($(MIB510_),)
MIB510 := $(MIB5100)
endif
MAKECMDGOALS := $(filter-out MIB510=%,$(MAKECMDGOALS))
### If STK is a set environment variable or if STK=xxx appears on the command
### line, then take it to be a network address and program assuming an stk500
### module.
EPRB0 := $(subst EPRB=,,$(filter EPRB=%,$(MAKECMDGOALS)))
ifneq ($(EPRB_),)
EPRB := $(EPRB0)
endif
MAKECMDGOALS := $(filter-out EPRB=%,$(MAKECMDGOALS))
ifneq (x$(MIB510),x)
PROGRAMMER := STK
PROGRAMMER_FLAGS=-dprog=mib510 -dserial=$(MIB510) $(PROGRAMMER_PART)
$(PROGRAMMER_EXTRA_FLAGS_MIB)
endif
ifneq (x$(EPRB),x)
PROGRAMMER := STK
PROGRAMMER_FLAGS=-dprog=stk500 -dhost=$(EPRB) $(PROGRAMMER_PART)
$(PROGRAMMER_EXTRA_FLAGS_STK)
endif
ifdef AVRISP
PROGRAMMER := STK
PROGRAMMER_FLAGS=-dprog=stk500 -dserial=$(AVRISP) $(PROGRAMMER_PART)
$(PROGRAMMER_EXTRA_FLAGS_AVRISP)
endif
#Sensor Board Defaults
ifeq ($(SENSORBOARD),)
ifeq ($(PLATFORM),mica)
SENSORBOARD = micasb
endif
ifeq ($(PLATFORM),mica2)
SENSORBOARD = micasb
endif
ifeq ($(PLATFORM),mica128)
SENSORBOARD = micasb
endif
ifeq ($(PLATFORM),rene2)
SENSORBOARD = basicsb
endif
ifeq ($(PLATFORM),pc)
SENSORBOARD = micasb
endif
ifeq ($(PLATFORM),mica2dot)
SENSORBOARD = basicsb
endif
endif
BUILDDIR = build/$(PLATFORM)
MAIN_EXE = $(BUILDDIR)/main.exe
MAIN_SREC = $(BUILDDIR)/main.srec
ifeq ($(PLATFORM), pc)
OPTFLAGS := -g -O0
PFLAGS := -pthread $(PFLAGS) -fnesc-nido-tosnodes=1000
-fnesc-cfile=$(BUILDDIR)/app.c
MAIN_TARGET = $(MAIN_EXE)
else
PFLAGS := $(PFLAGS) -finline-limit=100000 -fnesc-cfile=$(BUILDDIR)/app.c
MAIN_TARGET = $(MAIN_SREC)
endif
PFLAGS := -board=$(SENSORBOARD) $(PFLAGS)
# added options to support network reprogramming. This sets the correct
bootloader
# for mica2 and mica2dot platforms. And this also sets the programmer flag for
# native ATmega128.
ifeq ($(PLATFORM), mica)
PROGRAMMER_PART=-dpart=ATmega103 --wr_fuse_e=fd
PROGRAMMER_FLAGS_INP=-dprog=dapa $(PROGRAMMER_EXTRA_FLAGS)
ifdef AVRISP
PROGRAMMER_FLAGS_INP=-dprog=stk500 -dserial=$(AVRISP_DEV) -dpart=ATmega103
endif
endif
ifeq ($(PLATFORM), mica128)
PROGRAMMER_PART=-dpart=ATmega128 --wr_fuse_e=ff
PROGRAMMER_FLAGS_INP=-dprog=dapa $(PROGRAMMER_EXTRA_FLAGS)
ifdef AVRISP
PROGRAMMER_FLAGS_INP=-dprog=stk500 -dserial=$(AVRISP_DEV) -dpart=ATmega128
endif
endif
ifeq ($(PLATFORM), mica2)
BOOTLOADER=$(XNP_DIR)/inpispm2.srec
PROGRAMMER_PART=-dpart=ATmega128 --wr_fuse_e=ff
PROGRAMMER_FLAGS_INP=-dprog=dapa $(PROGRAMMER_EXTRA_FLAGS)
ifdef AVRISP
PROGRAMMER_FLAGS_INP=-dprog=stk500 -dserial=$(AVRISP_DEV) -dpart=ATmega128
endif
endif
ifeq ($(PLATFORM), mica2dot)
BOOTLOADER =$(XNP_DIR)/inpispm2d.srec
PROGRAMMER_PART=-dpart=ATmega128 --wr_fuse_e=ff
PROGRAMMER_FLAGS_INP=-dprog=dapa $(PROGRAMMER_EXTRA_FLAGS)
ifdef AVRISP
PROGRAMMER_FLAGS_INP=-dprog=stk500 -dserial=$(AVRISP_DEV) -dpart=ATmega128
endif
endif
######################################################################
# Rules for documentation generation
######################################################################
# add documentation flags to ncc, if requested
DOCS := $(filter docs, $(MAKECMDGOALS))
MAKECMDGOALS := $(filter-out docs, $(MAKECMDGOALS))
ifeq ($(DOCS)_x, docs_x)
build: FORCE
@echo " Making documentation for $(COMPONENT) on $(PLATFORM)"
nesdoc $(DOCDIR)/$(PLATFORM) -fnesc-is-app $(PFLAGS) $(CFLAGS)
$(COMPONENT).nc
endif
# dummy rule for 'docs' target - so make won't complain about it
docs:
@true
######################################################################
# Rules for debugging
######################################################################
# add documentation flags to ncc, if requested
DBG := $(filter debug, $(MAKECMDGOALS))
MAKECMDGOALS := $(filter-out debug, $(MAKECMDGOALS))
ifeq ($(DBG)_x, debug_x)
OPTFLAGS := -O1 -g -fnesc-no-inline
endif
# dummy rule for 'debug' target - so make won't complain about it
debug:
@true
# For those who like debugging optimised code, there's debugopt
DBGOPT := $(filter debugopt, $(MAKECMDGOALS))
MAKECMDGOALS := $(filter-out debugopt, $(MAKECMDGOALS))
ifeq ($(DBGOPT)_x, debugopt_x)
OPTFLAGS := $(OPTFLAGS) -g
endif
# dummy rule for 'debug' target - so make won't complain about it
debugopt:
@true
######################################################################
# top-level rules. switch based on MAKECMDGOALS
######################################################################
#
# rules for make clean
#
ifeq ($(MAKECMDGOALS)_x, clean_x)
PLATFORM=
$(PLATAUX):
@echo ""
else
ifeq ($(PLATFORM)_x,_x)
$(error $(PLATAUX) $(MAKECMDGOALS) $(USAGE))
endif
MAKECMDGOALS := $(patsubst install.%,install,$(MAKECMDGOALS))
MAKECMDGOALS := $(patsubst reinstall.%,reinstall,$(MAKECMDGOALS))
#
# rules for make install <platform>
#
ifeq ($(MAKECMDGOALS)_x, install_x)
$(PLATAUX):
@true
else
ifeq ($(MAKECMDGOALS)_x, reinstall_x)
$(PLATAUX):
@true
else
ifeq ($(MAKECMDGOALS)_x, inp_x)
$(PLATAUX):
@true
else
ifeq ($(MAKECMDGOALS)_x, reset_x)
$(PLATAUX):
@true
else
ifneq ($(filter $(BUILDLESS_DEPS),$(MAKECMDGOALS)), )
$(PLATAUX):
@true
else
all:
for platform in $(PLATFORMS); do \
$(MAKE) $$platform $(DOCS) || exit 1; \
done
$(PLATFORMS): build
endif
endif
endif
endif
endif
endif
######################################################################
######################################################################
## ##
## Begin main rules ##
## ##
######################################################################
######################################################################
ifneq ($(DOCS)_x, docs_x)
build: $(MAIN_TARGET)
endif
install: $(MAIN_SREC) FORCE
@$(MAKE) $(PLATFORM) re$@ PROGRAMMER="$(PROGRAMMER)"
PROGRAMMER_FLAGS="$(PROGRAMMER_FLAGS)"
install.%: $(MAIN_SREC) FORCE
$(MAKE) $(PLATFORM) re$@ PROGRAMMER="$(PROGRAMMER)"
PROGRAMMER_FLAGS="$(PROGRAMMER_FLAGS)"
ifeq ($(PROGRAMMER),DAPA) ### program via parallel port
reinstall: FORCE
@echo " installing $(PLATFORM) binary"
$(PROGRAMER) $(PROGRAMMER_FLAGS) --erase
sleep 1
$(PROGRAMER) $(PROGRAMMER_FLAGS) --upload if=$(MAIN_SREC)
sleep 1
$(PROGRAMER) $(PROGRAMMER_FLAGS) --verify if=$(MAIN_SREC)
reinstall.%: FORCE
@echo " installing $(PLATFORM) binary"
$(SET_ID) $(MAIN_SREC) $(MAIN_SREC).out `echo $@ |perl -pe
's/^reinstall.//; $$_=hex if /^0x/i;'`
$(PROGRAMER) $(PROGRAMMER_FLAGS) --erase
sleep 1
$(PROGRAMER) $(PROGRAMMER_FLAGS) --upload if=$(MAIN_SREC).out
sleep 1
$(PROGRAMER) $(PROGRAMMER_FLAGS) --verify if=$(MAIN_SREC).out
reset: FORCE
@echo " resetting $(PLATFORM)"
$(PROGRAMER) $(PROGRAMMER_FLAGS)
else ### Otherwise, program via the stk500 where STK specifies a network
address
reinstall: FORCE
@echo " installing $(PLATFORM) binary"
$(PROGRAMER) $(PROGRAMMER_FLAGS) --erase --upload if=$(MAIN_SREC)
reinstall.%: FORCE
@echo " installing $(PLATFORM) binary"
$(SET_ID) $(MAIN_SREC) $(MAIN_SREC).$*.out `echo $@ |perl -pe
's/^reinstall.//; $$_=hex if /^0x/i;'`
$(PROGRAMER) $(PROGRAMMER_FLAGS) --erase --upload
if=$(MAIN_SREC).$*.out
reset: FORCE
@echo " resetting $(PLATFORM)"
$(PROGRAMER) $(PROGRAMMER_FLAGS)
endif ### Done programming
$(MAIN_EXE): $(BUILDDIR) $(BUILD_EXTRA_DEPS) FORCE
@echo " compiling $(COMPONENT) to a $(PLATFORM) binary"
$(NCC) -o $(MAIN_EXE) $(OPTFLAGS) $(PFLAGS) $(CFLAGS) $(COMPONENT).nc
$(LIBS) $(LDFLAGS)
@echo " compiled $(COMPONENT) to $@"
@objdump -h $(MAIN_EXE) | perl -ne '$$b{$$1}=hex $$2 if
/^\s*\d+\s*\.(text|data|bss)\s+(\S+)/; END { printf("%16d bytes in ROM\n%16d
bytes in RAM\n",$$b{text}+$$b{data},$$b{data}+$$b{bss}); }'
$(MAIN_SREC): $(MAIN_EXE)
$(OBJCOPY) --output-target=srec $(MAIN_EXE) $(MAIN_SREC)
$(BUILDDIR):
mkdir -p $(BUILDDIR)
clean: FORCE
rm -rf $(BUILDDIR)
rm -f core.*
rm -f *~
# uploading boot loader for network reprogramming. Do this after loading app
srec file.
# using either 'make install' or 'make reinstall'
inp: FORCE
$(PROGRAMER) $(PROGRAMMER_FLAGS_INP) --upload if=$(BOOTLOADER)
FORCE:
.phony: FORCE
endif #ifdef MAKERULES
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help