From f33f5b6723f22b0f4ef8605bca8d61b80ee995ab Mon Sep 17 00:00:00 2001 From: Martin Cerveny Date: Tue, 26 Mar 2013 14:37:11 +0100 Subject: [PATCH] tos-deluge sends too large serial packet (AT45DB erase/inject commands) --- tools/tinyos/misc/tos-deluge.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/tinyos/misc/tos-deluge.in b/tools/tinyos/misc/tos-deluge.in index 0f97e62820..1e5fd5e0bb 100755 --- a/tools/tinyos/misc/tos-deluge.in +++ b/tools/tinyos/misc/tos-deluge.in @@ -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): @@ -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;