From eae3026f5ae7f8941ae620aabf897a3c1ab688b7 Mon Sep 17 00:00:00 2001 From: Daniel Beer Date: Mon, 16 Jul 2012 10:05:46 +1200 Subject: [PATCH] flash_bsl: fix error with large block sizes. --- drivers/flash_bsl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/flash_bsl.c b/drivers/flash_bsl.c index 7d5fa94..0fbf5d3 100644 --- a/drivers/flash_bsl.c +++ b/drivers/flash_bsl.c @@ -37,7 +37,10 @@ struct flash_bsl_device { int long_password; }; -#define MAX_PACKET 256 +#define MAX_BLOCK 256 + +/* This should be at least MAX_BLOCK + 4 */ +#define MAX_PACKET 512 /* adapted from TI's published BSL source code */ #define CRC_INIT 0xffff @@ -263,7 +266,6 @@ static void flash_bsl_perror(uint8_t code) { } } -#define MAX_BLOCK 256 static int flash_bsl_readmem(device_t dev_base, address_t addr, uint8_t *mem, address_t len) {