The checksum should be reset after sending it.
@@ -125,6 +125,7 @@ void lpc_write_ram(struct lpc_device *dev, const struct sprog_data *d, unsigned
lpc_printf("%s\r\n", buf);
if((i % 20)==19) {
lpc_printf("%u\r\n", checksum);
+ checksum = 0;
if(lpc_getline(reply_buf)) {
if(strcmp(reply_buf, "OK\r\n")==0) {
@@ -21,7 +21,7 @@ int uuencode_line(const struct sprog_data *d, char *dst, int *offset, int *check
*checksum += srcbuf[i];
}
- for(i=0; (b+i)%3; i++)
+ for(i=0; i<3; i++)
srcbuf[b+i] = 0;
dst[0] = b;