eclipse-threadx / levelx

Eclipse ThreadX - LevelX Provides Flash Wear Leveling for FileX and Stand Alone purposes.
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/levelx/index.md
MIT License
102 stars 61 forks source link

lx_nand_flash_open takes too long time and continuously read pages within a block again and again #49

Open kaotao opened 4 months ago

kaotao commented 4 months ago

Describe the bug We have successfully making levelx working together with filex on a nxp 1052 board with a nand flash of 4Gb。We made out test program based on demo_filex_nand_flash.c. The performance especially lx_nand_flash_open is poor. After board startup and levelx & filex format, the first several times of lx_nand_flash_open consumes about several seconds, but later increases to more than 10 seconds and at last takes 30 seconds, which is too long( 12 seconds without logs on). Our nand spi clock speed is 40M HZ

Checking through the log, we found during lx_nand_flash_open, levelx will continuously read some pages within a block again and again(eg, read block 2047 pages 42 to 0, and then read block 2047 pages 42 to 2, and then read block 2047 pages 42 to 3 and keep on doing like this until read block 2047 pages 42 to 16). Can't levelx read pages within a block once and get all the required information, so as to increase performance? Meanwhile, i didn't find any cache function for nand flash.

Please also mention any information which could help others to understand the problem you're facing: We are using the latest levelx Maybe we will implement cache function for nand flash

To Reproduce After power on , levelx behaves all the same

levelx_performance_test.txt