This was done by changing the flash imgae address offsets to 32 bit variables instead of 16 bit in Deluge.h and tos-nwprog.
NWPROG_PORT = 5213
NWPROG_PKT_SIZE = 64
NWPROG_PORT = 5213
NWPROG_PKT_SIZE = 64
-NWPROG_REQ_FMT = "!BBH"
-NWPROG_REPLY_FMT = "!BBBBH"
+NWPROG_REQ_FMT = "!BBL"
+NWPROG_REPLY_FMT = "!BBBBL"
ERROR_SUCCESS = 0
nRetries = 3
ERROR_SUCCESS = 0
nRetries = 3
def send_command(cmd_str, retries):
s.sendto(cmd_str, (remote, NWPROG_PORT))
s.settimeout(3)
def send_command(cmd_str, retries):
s.sendto(cmd_str, (remote, NWPROG_PORT))
s.settimeout(3)
- (real_cmd, real_imgno, real_offset) = struct.unpack(NWPROG_REQ_FMT, cmd_str[0:4])
+ (real_cmd, real_imgno, real_offset) = struct.unpack(NWPROG_REQ_FMT, cmd_str[0:6])
try:
data, addr = s.recvfrom(1024)
# make sure this is the guy we're programming
try:
data, addr = s.recvfrom(1024)
# make sure this is the guy we're programming
data = send_command(sreqpkt, 5)
if data != False:
data = send_command(sreqpkt, 5)
if data != False:
- (error, pack, cmd, imgno, offset) = struct.unpack(NWPROG_REPLY_FMT, data[0:6])
+ (error, pack, cmd, imgno, offset) = struct.unpack(NWPROG_REPLY_FMT, data[0:8])
if offset == pkt_offset:
for c in data[6:]:
print >>sys.stderr, ord(c)
if offset == pkt_offset:
for c in data[6:]:
print >>sys.stderr, ord(c)
nx_uint8_t cmd;
nx_uint8_t imgno;
nx_union {
nx_uint8_t cmd;
nx_uint8_t imgno;
nx_union {
- nx_uint16_t offset;
- nx_uint16_t when;
- nx_uint16_t nimages;
+ nx_uint32_t offset;
+ nx_uint32_t when;
+ nx_uint32_t nimages;
} cmd_data;
nx_uint8_t data[0];
} prog_req_t;
} cmd_data;
nx_uint8_t data[0];
} prog_req_t;