Download TINYOS LABORATORY DEVELOPMENT
Transcript
event result_t NPX_DOWNLOAD_DONE(uint16_t wProgramID, uint8_t bRet, uint16_t wEENofP); • This event is signaled when the download operation has completed. • The Program ID, the success of the download, and the actual number of EEPROM pages used are passed in as arguments for this event. • If the download succeeds, bRet will be true, otherwise bRet will be false. • The user program must ensure the integrity of the downloaded program, i.e. the user program must ensure that it does not overwrite the program in the EEPROM by not writing to any of the memory locations where the program is stored. The EEPROM pages used for storing the program is given by the Start Page (wEEStartP) and the Number of Pages (wEENofP) values. Due to a bug in the new makerules, the default In-Network Programming option does not install the In-Network Programming bootloader, i.e. the mica2 INP bootloader. A quick fix is to change the mib510.extra file located under the TinyOS directory “tools\make\avr”. The mib510.extra file should contain the inpisp upload code given in the mib510.extra file listed below. #-*-Makefile-*- vim:syntax=make #$Id: mib510.extra,v 1.2 2004/04/24 09:33:37 cssharp Exp $ #Added inpisp upload code. 2005/08/14 rkaliski ifeq ($(MIB510),) $(error MIB510 must be defined, try "make $(TARGETS) help") endif PROGRAM = mib510 PROGRAMMER_FLAGS = -dprog=mib510 -dserial=$(MIB510) $(PROGRAMMER_PART) $(PROGRAMMER_EXTRA_FLAGS_MIB) program: FORCE @echo " installing $(PLATFORM) binary using mib510" $(PROGRAMMER) $(PROGRAMMER_FLAGS) --erase --upload if=$(INSTALL_SREC) #inpisp upload code ifeq ($(XNP),yes) @echo " Uploading Bootloader" $(PROGRAMMER) $(PROGRAMMER_FLAGS) --upload if=$(BOOTLOADER) endif Custom file A- 4: mib510.extra, enable TinyOS inpisp program download The changes to the makelocal file, see Custom file A- 2, allows any Xnp enabled application to successfully compile. To compile an Xnp enabled application the XNP, yes option must be specified as an argument to make. 15