Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DELUGE: tos-deluge corrupts mote ram data (AT45DB erase/inject commands) #180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tools/tinyos/misc/tos-deluge.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ ERROR_FAIL = 1 # T2-compatible
DELUGE_MAX_PAGES = 128
DELUGE_IDENT_OFFSET = 0
DELUGE_IDENT_SIZE = 128
DELUGE_IDENT_UID_SIZE = 4

class FMReqPacket(tos.Packet):
def __init__(self, packet = None):
Expand Down Expand Up @@ -206,8 +207,8 @@ def erase(imgNum):

print 'Attempt the workaround for AT45DB...'
sreqpkt = FMReqPacket((FM_CMD_WRITE, imgNum, 0, 0, []))
sreqpkt.data = [0xFF] * DELUGE_IDENT_SIZE
sreqpkt.length = DELUGE_IDENT_SIZE
sreqpkt.data = [0xFF] * DELUGE_IDENT_UID_SIZE
sreqpkt.length = DELUGE_IDENT_UID_SIZE
success = am.write(sreqpkt, FM_AMID)
result = handleResponse(success, "ERROR: Unable to erase the flash volume")
if not result: return False;
Expand Down