michallenc commented on PR #16624: URL: https://github.com/apache/nuttx/pull/16624#issuecomment-3016728929
@xiaoxiang781216 @jingfei195887 Looking at the code and your modifications, I basically see two options how to use BCH in direct access to MTD without buffering. Separate driver that uses BCH functions: - we would need to call bchlib_write and similar functions. - this would require some even larger modifications in BCH layer, because we would need to initialize BCH layer from MTD layer as these functions still use bch specific stuff (buffer, lock, etc) and it calls write function from FTL (though this can be changed to any block based driver) - `bchlib_write` works better than my write in the mtd driver, but I don't think it is necessary to read the sector, modifying it and then passing it to write. This is done in BCH layer because it expects FTL layer to read entire erase page, erase it and then write it back modified. But as direct access would not erase the page, we can just fill the buffer with erase state and write it. But better option seems the changes @xiaoxiang781216 suggested: change the behavior of BCH/FTL layer to support non buffered access without page erase before write if some specific flag is passed during open operation. This should be pretty straightforward, just some if statements. The bigger issue is how to support byte access as FTL (or any other block based driver) write function expects to get blocks to write, not bytes. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org