This is the mail archive of the ecos-discuss@sourceware.org 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]

cyg_flash_program_mask


Hi folks,

It seems that many Flash devices expose separate "program" and "erase"
operations.  It also seems fairly common to represent an erased bit as
"1" and a programmed bit as "0".  In this view "program" can only
perform a 1->0 transition and "erase" resets bits back to 1.  So a
Flash chip's "program" operation is logically an "and-mask" operation.

Since the erase operation is one that ages the chip, it makes sense in
some applications to use multiple overlaying "and-mask" operations to
incrementally write to data units that are smaller than the smallest
erase unit.

Is there any interest to add support for this behaviour to the eCos
API?

If I understand correctly, the cyg_flash_program() operation erases
before program such that the resulting bit pattern in the Flash always
represents the input bit pattern exactly, instead of being the result
of an "and-mask" operation.

A single extra API function could be enough:

int cyg_flash_program_mask(cyg_flashaddr_t flash_base,
                           void *ram_base, size_t len,
                           cyg_flashaddr_t *err_address);

Cheers,

Tom


-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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