Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storeage/stream_flash: Cache write_block_size to ctx on init #68658

Merged

Conversation

de-nordic
Copy link
Collaborator

The commit caches write_block_size and erase_value to stream flash context, at init, to avoid calling Flash API multiple times to get these values at various stages of code exectuion, at run-time.

@de-nordic de-nordic force-pushed the stream_flash_sync_wbs branch from 9c676bb to f9d4c77 Compare February 6, 2024 17:14
@de-nordic de-nordic marked this pull request as ready for review February 7, 2024 14:35
@zephyrbot zephyrbot added the area: Storage Storage subsystem label Feb 7, 2024
The commit caches write_block_size and erase_value to stream flash
context, at init, to avoid calling Flash API multiple times
to get these values at various stages of code exectuion,
at run-time.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
@de-nordic de-nordic force-pushed the stream_flash_sync_wbs branch from f9d4c77 to 1a23b32 Compare May 28, 2024 17:20
@henrikbrixandersen henrikbrixandersen merged commit 25138ff into zephyrproject-rtos:main May 29, 2024
22 checks passed
@@ -65,6 +65,8 @@ struct stream_flash_ctx {
#ifdef CONFIG_STREAM_FLASH_ERASE
off_t last_erased_page_start_offset; /* Last erased offset */
#endif
uint8_t erase_value;
uint8_t write_block_size; /* Offset/size device write alignment */
Copy link
Contributor

@guicnDell guicnDell Jul 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@de-nordic I have now updated to Zephyr 3.7 and this is a bug for me.
The block size on the device I'm using, NXP's LPC55S59, is 512 and of course, we have an issue since this was defined as 1 byte (max size is 255).
This needs to be size_t.

How should we proceed here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. I have provided fix here #76053.
Thanks for reporting the issue.
I just want to mention that you are always free to provide a fix that will go under review, so any doubts you can have, regarding technical solution, can be resolved together in the context of your contribution; so next time you find something like this I would like to encourage you to log an issue and, if you have time, follow it with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Storage Storage subsystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants