SpansionFFS with SLLD: FTL_InitAll() fail

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
kachna5247
Level 2
Level 2
5 replies posted 5 sign-ins First solution authored

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. 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 

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

0 Likes
1 Solution
kachna5247
Level 2
Level 2
5 replies posted 5 sign-ins First solution authored

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

View solution in original post

0 Likes
7 Replies