I have tried what you suggest prior to writing these emails, and it does not work. The motes worked only when I converted the code to assume a synchronous memory write() return. The sending mote worked because one does not get anything back from the writeTXFIFO() call. The receiving mote, however, failed because it had returned before the packet buffer had been written.
-----Original Message----- From: Philip Levis [mailto:[EMAIL PROTECTED] Sent: Monday, December 05, 2005 11:11 PM To: Séva Safris Cc: 'Joe Polastre'; [email protected] Subject: Re: [Tinyos-help] Telos synchronous memory io Séva Safris wrote: > Ok, so here's the deal: > > I'm working on the implementation of the 802.14.5 security spec for the > telos platform. I need to do a memory write in the middle of a readRXFIFO() > function like this: > 1) read out the header info making sure not to read out any of the data > 2) build the nonce and write it into memory > 3) call security decryption strobe (the correct nonce HAS to be written by > this time) > 4) read out the now decrypted and authenticated data > > All of this has to happen in the readRXFIFO() function of the HPLCC2420M.nc > file. If I do an asynchronous HPLCC2420RAM.write() in step 2) above, then I > can continue steps 3) and 4) in another function which will be called from > the writeDone() callback. However, this does not work because the > readRXFIFO() function will end up returning before the post of the > writeDone() is called. readRXFIFO() will return and I will never see the > packet. Why does it all have to happen in the function? Why not do this: Read the necessary header bytes from the RXFIFO. In the readDone() event, build the nonce and write it. In the writeDone() event, call the decryption strobe (a synchronous op). Read the bytes out. This will probably require that you add some states to the state machine. > Since we do not have a "real" thread architecture in the os, I do not > currently see a solution to this problem if I use asynchronous memory > writes. > > Question: Can I do a HPLCC2420RAM.write() call in step 2) above and ignore > the writeDone() callback? I realize that alternate platform implementations > bind us to a common interface, but I am dealing with the telos platform in > particular. Or is it critical that I wait for the callback? The chipcon docs > dont seem to specify a need for any special behavior when dealing with > memory access (beyond that of csn considerations). > > Can I ignore the HPLCC2420RAM.writeDone(), just assuming it completes on > return of the HPLCC2420RAM.write() command (just for telos)? I think that the current version in 1.x CVS isn't actually split phase, so you might be able to get away with it. Joe was talking about making it properly split phase, though, so... Phil _______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
