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

lx_nand_flash_sector_release.c put LX_NULL into main buffer pointer when call lx_nand_flash_driver_pages_read function #51

Open
TheBraveBurjak opened this issue Dec 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@TheBraveBurjak
Copy link

lx_nand_flash_sector_release.c

                /* Read a page.  */
#ifdef LX_NAND_ENABLE_CONTROL_BLOCK_FOR_DRIVER_INTERFACE
                status = (nand_flash -> lx_nand_flash_driver_pages_read)(nand_flash, block, (ULONG)page, LX_NULL, spare_buffer_ptr, 1);
#else
                status = (nand_flash -> lx_nand_flash_driver_pages_read)(block, (ULONG)page, LX_NULL, spare_buffer_ptr, 1);
#endif

Hello, this LX_NULL is crashing my application because I didn't expect LevelX gonna use this function to read spare bytes. Especially, when we have defined extra_bytes_get. Maybe we should use extra_bytes_get instead?

nand_flash_ptr -> lx_nand_flash_driver_extra_bytes_get = lx_nand_driver_extra_bytes_get;

@TheBraveBurjak TheBraveBurjak added the bug Something isn't working label Dec 27, 2024
@fdesbiens
Copy link
Contributor

Thank you for the bug report @TheBraveBurjak. Can someone in @eclipse-threadx/iot-threadx-committers take a look?

@Chabrol
Copy link

Chabrol commented Jan 20, 2025

But NAND Driver Requirements doesn't state that lx_nand_flash_driver_extra_bytes_get must be implemented. I would rather keep it the original way and instead improve the Driver Read Pages description, mentioning possible null arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants