Closed wxp821217 closed 4 years ago
Hi @wxp821217 - thanks for letting us know about this issue. We're looking into it. I'll get back to you soon.
Hi @wxp821217 - you are correct, fx_media_format
makes a driver request FX_DRIVER_INIT
, which calls _lx_nand_flash_open
. At the end of fx_media_format
, a FX_DRIVER_UNINIT
driver request is made, which calls _lx_nand_flash_close
. Later, when you call fx_media_open
, another driver request FX_DRIVER_INIT
is made and _lx_nand_flash_open
is called again. This is how FileX and LevelX are supposed to work. Are you seeing problems?
Dear goltscott,
Some Abort is happened very time when I am doing some try with Demo_filex_nand_flash.
With logs, Root cause is likely using memset() unreasonably.
` else
{
/* The opened NAND flash list is empty. Add the NAND flash to empty list. */
_lx_nand_flash_opened_ptr = nand_flash;
nand_flash -> lx_nand_flash_open_next = nand_flash;
nand_flash -> lx_nand_flash_open_previous = nand_flash;
}`
` /* Place the NAND flash control block on the list of opened NAND flashes. First,
check for an empty list. */
if (_lx_nand_flash_opened_count)
{
/* List is not empty - other NAND flashes are open. */
/* Pickup tail pointer. */
tail_ptr = _lx_nand_flash_opened_ptr -> lx_nand_flash_open_previous;
/* Place the new NAND flash control block in the list. */
_lx_nand_flash_opened_ptr -> lx_nand_flash_open_previous = nand_flash;
tail_ptr -> lx_nand_flash_open_next = nand_flash;
/* Setup this NAND flash's opened links. */
nand_flash -> lx_nand_flash_open_previous = tail_ptr;
nand_flash -> lx_nand_flash_open_next = _lx_nand_flash_opened_ptr;
}`
But Here nand_flash -> lx_nand_flash_open_previous=NULL,(Because of memset at fistly), So the nand_flash -> lx_nand_flash_open_previous = tail_ptr is Illegal.
I will double check it again..
Best Regards Joshua Wang
@wxp821217 - in the demo_filex_nand_flash.c example, when fx_media_open
is called, _lx_nand_flash_opened_count
is 0. So the else
statement is executed.
Dear goldscott,
I am busy for porting FatSys & Marvell BBM, So sorry for the late reply.
In my demo, When FX_DRIVER_BOOT_WRITE request is failed, Only FX_IO_ERR is returned, BUT FX_DRIVER_UNINIT is not called.
When fx_media_open() is called again, the gobal parmeter _lx_nand_flash_opened_count is equal 1, So the Illegal operation is happened as Mentioned above.
Pls double check it, Thanks...
Best Regards Joshua Wang
Hi @wxp821217 - sounds like you need to step into you driver and figure out why the FX_DRIVER_BOOT_WRITE request is failing.
closing - feel free to open again.
Dear LevelX,
![image](https://user-images.githubusercontent.com/11240975/90312179-eadf0800-df34-11ea-83cc-5d111b3a1965.png)
As you seen, The follow is in problem. ` LX_PARAMETER_NOT_USED(name);
` if (_lx_nand_flash_opened_count)
Because of memst of nand flash, some assert is happened.
Best Regards Joshu Wang