- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have almost the same problem as mentioned in the thread https://community.cypress.com/t5/Nor-Flash/SpansionFFS-with-SLLD-FTL-InitAll-fails/m-p/155153. However, the cause of the problem cannot be the same as in this thread as we are not using any level translator. We are using STM32G483VE MCU and S256FL256LAGMFI NOR flash. We can read id and status registers from the device, so the communication is working. However, when trying to use SpansionFFS, it always ends in the same condition as for JaAr_633041 - on line 274 at io_pim_spansion.c in function pim_ioctl_span_init(). Even though the formatting in FTL_Format() does not return any error, return code of the FTL_InitAll() function is 14 (FTL_ERR_NOT_FORMATTED) as if the formatting did not end correctly. The underlying problem is also the same, it is because FTL_FindSuperSysEB() on line 141 in the file ftl_init.c returns 28019. Then, formatCount is set 26 on line 188 and whole function fails as format is set to FTL_DONT_FORMAT.
In Format.h, we have changed the defines to have 4 KB sectors, 64 KB eblocks.
Preprocessor define __SLLD is defined in the IDE.
Write enable, write disable, sector erase, program, read and read status register commands are implemented in the slld layer.
Before calling any of the FFS APIs, slld_RDIDCmd() can be called and correctly returns 0x01 0x60 0x19 as specified in the datasheet.
We are stuck on this problem for days, do you have any idea what the problem can be?
Thanks in advance,
Karel
Solved! Go to Solution.
- Labels:
-
Memory Nor Flash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Takashiro,
you were correct from the beginning, it was issues with slld_hal.c layer. The problem was this: lines 196-208 and 304-316 in the slld hal I sent you is absolute nonsense. I should have written just
cmd.Address = sys_addr;
in both places and it would be enough. Sorry I did not notice it until now, such as stupid mistake. It came from when I was porting it from slld_hal_example.c. Another thing I was missing was setting number of dummy cycles in write, but I believe it should not be necessary.
The filesystem now sometimes fails in the mounting stage, but I think it is because I formatted the flash so many times, that some sectors are too worn. On our other board with the same hardware it works correctly now.
I would like to thank you for excellent support which lead me in the right direction, especially your idea to put debug printfs to the low-level functions lead me right to the root of my issues.
Last thing I want to mention is that NUMBER_OF_BYTES_PER_SECTOR must not be larger than PIM_ALLOW_MAX_SECT_SIZE in ion_pim.h as this define then allocates buffer of this size and if it is smaller, it overflows and (at least my) program goes to hard fault handler. I think it should maybe be mentioned in documentation as I did not find it anywhere. But it is a small issue that can be found quickly.
Thank you for your help,
Karel