This is the mail archive of the mailing list for the eCos project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: flash/am29xxxxx flash_program_buf length fix

>>>>> "David" == David Vrabel <> writes:

 David> I don't think this is correct.  You're going to overwrite the
 David> partial word following the buffer you're writing with garbage.

True, it isn't perfect, but neither is the current approach of simply
discarding the last bytes.

 David> I think instead an check (in addition to the check to ensure
 David> the buffer is word-size aligned) needs to be made at the start
 David> of flash_program_buf() to ensure the len is a multiple of word
 David> size.  Something like this, I think:

 David> 8 - 1)) return FLASH_ERR_INVALID;

 David> This will require that you fix the caller.

But then the caller needs to the flash width - is there a simple way
to do that?

The problem comes up fairly often in RedBoot here when we update the (gzip
compressed) application in flash with a simple:

fis create app

If you're lucky this compilation exactly takes up a multiple of the
flash word size and it works, and if not you get a flash verify error
because the remaining bytes weren't written :/


Bye, Peter Korsgaard

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]