Installing a Test ITS400 Accelerometer Application

From Cyber-Physical Systems Laboratory
Jump to navigationJump to search

TinyOS 2.x comes with an application that tests the functionality of the ITS400 sensor board of the Intelmote 2. The test is located in /opt/tinyos-2.x/tos/sensorboards/im2sb/examples. The following output specifically tests the STMicroelectronics LIS3L02DQ accelerometer.

Compilation

$ make intelmote2 debug install bootloader
/opt/tinyos-2.x-contrib/intelmote2/support/make/bootloader.extra:14: warning: ov
erriding commands for target `program'
/opt/tinyos-2.x/support/make/pxa27x/jflashmm.extra:13: warning: ignoring old com
mands for target `program'
/opt/tinyos-2.x-contrib/intelmote2/support/make/bootloader.extra:18: warning: ov
erriding commands for target `program_input'
/opt/tinyos-2.x/support/make/pxa27x/jflashmm.extra:18: warning: ignoring old com
mands for target `program_input'
/opt/tinyos-2.x-contrib/intelmote2/support/make/intelmote2.extra:41: warning: ov
erriding commands for target `bytes'
/opt/tinyos-2.x/support/make/pxa27x/pxa27x.rules:102: warning: ignoring old comm
ands for target `bytes'
mkdir -p build/intelmote2
echo  -mcpu=iwmmxt -mfpu=softfpa -defsym BOOTLOADER=1  /opt/tinyos-2.x-contrib/i
ntelmote2/tos/platforms/intelmote2/toscrt0.s /opt/tinyos-2.x-contrib/intelmote2/
tos/chips/pxa27x/pxa27x_util.s /opt/tinyos-2.x-contrib/intelmote2/tos/chips/pxa2
7x/mmu_table.s -o build/intelmote2/asms.o
-mcpu=iwmmxt -mfpu=softfpa -defsym BOOTLOADER=1 /opt/tinyos-2.x-contrib/intelmot
e2/tos/platforms/intelmote2/toscrt0.s /opt/tinyos-2.x-contrib/intelmote2/tos/chi
ps/pxa27x/pxa27x_util.s /opt/tinyos-2.x-contrib/intelmote2/tos/chips/pxa27x/mmu_
table.s -o build/intelmote2/asms.o
    compiling TestSensorC to a intelmote2 binary
ncc -o build/intelmote2/main.exe -g -fnesc-no-inline -I/opt/tinyos-2.x-contrib/i
ntelmote2/tos/platforms/intelmote2/chips/da9030 -I/opt/tinyos-2.x-contrib/intelm
ote2/tos/platforms/intelmote2 -I/opt/tinyos-2.x-contrib/intelmote2/tos/chips/pxa
27x -I/opt/tinyos-2.x-contrib/intelmote2/tos/sensorboards/im2cb -I/opt/tinyos-2.
x-contrib/intelmote2/tos/sensorboards/xbow_cb -I/opt/tinyos-2.x-contrib/intelmot
e2/tos/platforms/intelmote2/chips/da9030 -I/opt/tinyos-2.x-contrib/intelmote2/to
s/platforms/intelmote2 -I/opt/tinyos-2.x-contrib/intelmote2/tos/chips/pxa27x -I/
opt/tinyos-2.x-contrib/intelmote2/tos/chips/ov7649 -I/opt/tinyos-2.x-contrib/int
elmote2/tos/chips/ov7670 -Wall -Wshadow -Wnesc-all -target=intelmote2 -fnesc-cfi
le=build/intelmote2/app.c -board=im2sb -DDEFINED_TOS_AM_GROUP=0x22 -DBOOTLOADER
-T/opt/tinyos-2.x-contrib/intelmote2/tos/platforms/intelmote2/tos.x -DSYSTEM_COR
E_FREQUENCY=13 -DSYSTEM_BUS_FREQUENCY=13  TestSensorC.nc -lm  /opt/tinyos-2.x-co
ntrib/intelmote2/tos/platforms/intelmote2/toscrt0.s /opt/tinyos-2.x-contrib/inte
lmote2/tos/chips/pxa27x/pxa27x_util.s /opt/tinyos-2.x-contrib/intelmote2/tos/chi
ps/pxa27x/mmu_table.s
In file included from TestSensorC.nc:42:
In component `TestSensorM':
TestSensorM.nc: In function `ReadAccelX.readDone':
TestSensorM.nc:86: warning: passing argument 2 of `Packet.getPayload' makes inte
ger from pointer without a cast
In C file:
/opt/tinyos-2.x/tos/chips/lis3l02dq/HplLIS3L02DQLogicSPIP.nc: At top level:
/opt/tinyos-2.x/tos/chips/lis3l02dq/HplLIS3L02DQLogicSPIP.nc:67: warning: non-at
omic accesses to shared variable `mState':
/opt/tinyos-2.x/tos/chips/lis3l02dq/HplLIS3L02DQLogicSPIP.nc:148: warning:   non
-atomic write
/opt/tinyos-2.x/tos/chips/lis3l02dq/HplLIS3L02DQLogicSPIP.nc:165: warning:   non
-atomic write
/opt/tinyos-2.x/tos/sensorboards/im2sb/LIS3L02DQInternalP.nc:53: warning: non-at
omic accesses to shared variable `currentId':
/opt/tinyos-2.x/tos/sensorboards/im2sb/LIS3L02DQInternalP.nc:83: warning:   non-
atomic write
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):64: warning: non-atomic accesses to shared variable `errorRes
ult':
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):72: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):84: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):96: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):120: warning:   non-atomic write
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):121: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):129: warning:   non-atomic write
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):130: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):138: warning:   non-atomic write
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):139: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):63: warning: non-atomic accesses to shared variable `byteResu
lt':
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):69: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):75: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):75: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):81: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):87: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):87: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):93: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):99: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQReaderP.nc(TestSensorC.Sensor.Ha
lLIS3L02DQReaderP):99: warning:   non-atomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQControlP.nc:58: warning: non-ato
mic accesses to shared variable `clientResult':
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQControlP.nc:67: warning:   non-a
tomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQControlP.nc:72: warning:   non-a
tomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQControlP.nc:77: warning:   non-a
tomic read
/opt/tinyos-2.x/tos/chips/lis3l02dq/HalLIS3L02DQControlP.nc:82: warning:   non-a
tomic read
TestSensorM.nc: In function `TestSensorM$ReadAccelX$readDone':
TestSensorM.nc:86: warning: passing arg 2 of `TestSensorM$Packet$getPayload' mak
es integer from pointer without a cast
    compiled TestSensorC to build/intelmote2/main.exe
           66316 bytes in ROM
             576 bytes in RAM
            9216 bytes in STACK
          252352 bytes available in HEAP
xscale-elf-objcopy --output-target=binary build/intelmote2/main.exe build/intelm
ote2/main.bin.out
    installing intelmote2 binary using the USB boot loader
/opt/tinyos-2.x-contrib/intelmote2/tools/platforms/intelmote2/bootloader//USBLoa
derHost.exe -p build/intelmote2/main.bin.out
Program Mode, File name = build/intelmote2/main.bin.out
File Size 66316
Device not detected
Device not connected to USB. Retry
Device not detected
Device not connected to USB. Retry
Device not detected
Device not connected to USB. Retry
USB Communication Failed. Device not connected to USB.

Installation

The application compiled above, but USBLoaderHost failed to find the Intelmote2. This is a common occurrence. Just disconnect/reconnect the USB cable, jiggle it, and remove an add-on boards attached to the Intelmote2 until it is able to detect the mote. Eventually, you should see the following output of a successful image transfer:

$ make intelmote2 debug reinstall bootloader
/opt/tinyos-2.x-contrib/intelmote2/support/make/bootloader.extra:14: warning: ov
erriding commands for target `program'
/opt/tinyos-2.x/support/make/pxa27x/jflashmm.extra:13: warning: ignoring old com
mands for target `program'
/opt/tinyos-2.x-contrib/intelmote2/support/make/bootloader.extra:18: warning: ov
erriding commands for target `program_input'
/opt/tinyos-2.x/support/make/pxa27x/jflashmm.extra:18: warning: ignoring old com
mands for target `program_input'
/opt/tinyos-2.x-contrib/intelmote2/support/make/intelmote2.extra:41: warning: ov
erriding commands for target `bytes'
/opt/tinyos-2.x/support/make/pxa27x/pxa27x.rules:102: warning: ignoring old comm
ands for target `bytes'
xscale-elf-objcopy --output-target=binary build/intelmote2/main.exe build/intelm
ote2/main.bin.out
    installing intelmote2 binary using the USB boot loader
/opt/tinyos-2.x-contrib/intelmote2/tools/platforms/intelmote2/bootloader//USBLoa
derHost.exe -p build/intelmote2/main.bin.out
Program Mode, File name = build/intelmote2/main.bin.out
File Size 66316
Device not detected
Device not connected to USB. Retry
Device detected
Device detected
GET_IMAGE_DETAILS Received.
ImgSize=66316, Num Packets= 1088
Total Packets Uploaded = 0, 0.00% completed
Sending CRC Check command 62169
Total Packets Uploaded = 546, 50.00% completed
Sending CRC Check command 59977
Image Download Completed
CRC of the Image = 28566, Total Size = 66316
Time taken for Upload 4271 Milli Seconds
Image Verification Completed.
Loading Image to boot location and marking it as golden.
Time Elapsed till IMG_VERIFY 6990 Milli Seconds
Time Elapsed 10583 Milli Seconds
Successfully copied image to boot location.

Mapped Boot Image to golden. Booting New Image.

Overall Time Elapsed 13240 Milli Seconds

Execution

After the application is transferred, install the ITS400 sensor board and the UART board onto the Intelmote2 and reboot the mote.

Then, launch the Java application that comes with the test. You should see the following output, which displays the raw acceleration reading.

Liang Fok@liang-mbp /opt/tinyos-2.x/tos/sensorboards/im2sb/examples
$ java TestSensor -comm serial@COM6:115200
serial@COM6:115200: resynchronising
Received packet. Value= 724
Received packet. Value= 725
Received packet. Value= 728
Received packet. Value= 729
Received packet. Value= 718
Received packet. Value= 730
Received packet. Value= 732
Received packet. Value= 742
Received packet. Value= 720
Received packet. Value= 740
Received packet. Value= 738
Received packet. Value= 738
Received packet. Value= 739
Received packet. Value= 735
Received packet. Value= 689
Received packet. Value= 825
Received packet. Value= 760
Received packet. Value= 669
Received packet. Value= 821
Received packet. Value= 756
Received packet. Value= 835
Received packet. Value= 896
Received packet. Value= 757