Skip to content

Should STM32 LevelX NAND driver reset initialized on FX_DRIVER_UNINIT? #3

Description

@miracoli

Hi,

I noticed that fx_stm32_levelx_nand_driver.c sets current_driver->initialized = FX_TRUE after a successful lx_nand_flash_open().

However, in the FX_DRIVER_UNINIT case, it calls lx_nand_flash_close() but does not set current_driver->initialized back to FX_FALSE.

Could this cause a later FX_DRIVER_INIT to skip lx_nand_flash_open() because initialized is still FX_TRUE, even though the LevelX NAND instance was already closed?

Would it make sense to reset the flag after a successful close, e.g.:

if (status == LX_SUCCESS)
{
    current_driver->initialized = FX_FALSE;
    media_ptr->fx_media_driver_status = FX_SUCCESS;
}

Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions