diff --git a/src/bootloader/bootloader_with_flash.c b/src/bootloader/bootloader_with_flash.c index 9e733ec..957d1be 100644 --- a/src/bootloader/bootloader_with_flash.c +++ b/src/bootloader/bootloader_with_flash.c @@ -32,7 +32,7 @@ typedef struct _sflash_img_hdr_t enum srec_type { - srec_err, srec_sob, srec_data, srec_rec, srec_eob + srec_err, srec_err_chksum, srec_sob, srec_data, srec_rec, srec_eob }; uint8_t h2i(uint8_t *c) @@ -102,7 +102,7 @@ int decode_srec(srec_t *pRec, uint8_t *pBuf, int buflen) chksum = ~chksum; byte = h2i(&pRec->data[2*i]); if (chksum != byte) - return 0; + return srec_err_chksum; return pRec->type; } @@ -215,7 +215,7 @@ void Exec_RE_at(void *pEntry) int main(int argc, char *argv[]) { - uint8_t buf[256]; + uint8_t buf[1024]; srec_t srec; int srec_state, i; uint32_t haddr, result;