This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Bug with flash unlock
- From: "Will Wagner" <willw at carallon dot com>
- To: "ecos-discuss at sources dot redhat dot com" <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 28 Jul 2010 21:55:19 +0100
- Subject: [ECOS] Bug with flash unlock
Hello,
It appears there is a trivial bug in the generic flash unlock code. I
could be misunderstanding what the code is trying to do but it looks like
it recusively locking subsequent devices rather than unlocking.
The below patch fixes the issue:
Index: packages/io/flash/current/src/flash.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/src/flash.c,v
retrieving revision 1.32
diff -u -w -b -r1.32 flash.c
--- packages/io/flash/current/src/flash.c 20 Feb 2009 22:06:15 -0000 1.32
+++ packages/io/flash/current/src/flash.c 28 Jul 2010 20:48:20 -0000
@@ -862,7 +862,7 @@
// Recurse if necessary for the next device
if (len > (dev->end + 1 - flash_base)) {
- return cyg_flash_lock(dev->end+1,
+ return cyg_flash_unlock(dev->end+1,
len - (dev->end + 1 - flash_base),
err_address);
}
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss