From e6cb2dc51d15a8ce255c499d4fa848a9853b6139 Mon Sep 17 00:00:00 2001 From: Daniel Beer Date: Tue, 19 Jun 2012 10:08:48 +1200 Subject: [PATCH] tilib: fix DEVICE_ERASE_MAIN. The address given to the library must be one inside main memory. --- drivers/tilib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tilib.c b/drivers/tilib.c index d4643ca..c694d62 100644 --- a/drivers/tilib.c +++ b/drivers/tilib.c @@ -278,6 +278,9 @@ static int tilib_erase(device_t dev_base, device_erase_type_t type, { struct tilib_device *dev = (struct tilib_device *)dev_base; + if (type == DEVICE_ERASE_MAIN) + address = 0xfffe; + if (dev->MSP430_Erase(ti_erase_type(type), address, 0) < 0) { report_error(dev, "MSP430_Erase"); return -1;