Commit Graph
5 Commits
Author SHA1 Message Date
Haithem Rahmani 9bf1c24243 fix: force initial erase count to 1
for each erased block write the word (1 | LX_NOR_ERASED) at the
first word. this is actually equivalent to 0x80000001.
When the lx_nor_flash_open_extended() is called, only the erase count will remain
valid.

Remove the LX_DISABLE/LX_RESTORE sequence.
2026-01-08 10:36:43 +01:00
Haithem Rahmani 47b2a17d4b Add new levelx APIs
New APIs
--------
- lx_nor_flash_format(): erases nor flash blocks and setup block metadata
- lx_nor_flash_open_extended(): same as lx_nor_flash_open() with
  user data pointer a last argument.
- lx_nand_flash_open_extended(): same as lx_nand_flash_open() with
  user data pointer a last argument.

Updates
-------
- lx_nor_flash_open(): calls lx_nor_flash_open_extended() with a NULL as
  last argument
- lx_nand_flash_open(): calls lx_nand_flash_open_extended() with a NULL as
  last argument
- regression tests: to call the lx_nor_flash_format()

Test results
-------------
100% tests passed, 0 tests failed out of 3

Total Test time (real) =   6.27 sec
3/3 Test #1: standalone_free_sector_verify_build::levelx_nand_flash_test ........   Passed    6.29 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   6.29 sec
3/3 Test #1: nor_obsolete_mapping_cache_build::levelx_nand_flash_test ........   Passed    6.58 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   6.58 sec
3/3 Test #1: nor_obsolete_cache_build::levelx_nand_flash_test ........   Passed    6.67 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   6.67 sec
3/3 Test #1: nor_mapping_cache_build::levelx_nand_flash_test ........   Passed    6.77 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   6.78 sec
3/3 Test #1: full_build::levelx_nand_flash_test ........   Passed    6.91 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   6.91 sec
3/3 Test #1: free_sector_verify_build::levelx_nand_flash_test ........   Passed    7.14 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   7.14 sec
3/3 Test #1: standalone_full_build::levelx_nand_flash_test ........   Passed    7.21 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   7.21 sec
3/3 Test #1: standalone_build::levelx_nand_flash_test ........   Passed   12.05 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =  12.06 sec
3/3 Test #1: default_build_coverage::levelx_nand_flash_test ........   Passed   48.78 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =  48.81 sec

Add new levelx APIs

New APIs
--------
- lx_nor_flash_format(): erases nor flash blocks and setup block metadata
- lx_nor_flash_open_extended(): same as lx_nor_flash_open() with
  user data pointer a last argument.
- lx_nand_flash_open_extended(): same as lx_nand_flash_open() with
  user data pointer a last argument.

Updates
-------
- lx_nor_flash_open(): calls lx_nor_flash_open_extended() with a NULL as
  last argument
- lx_nand_flash_open(): calls lx_nand_flash_open_extended() with a NULL as
  last argument
- regression tests: to call the lx_nor_flash_format()

Test results
-------------
100% tests passed, 0 tests failed out of 3

Total Test time (real) =   6.27 sec
3/3 Test #1: standalone_free_sector_verify_build::levelx_nand_flash_test ........   Passed    6.29 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   6.29 sec
3/3 Test #1: nor_obsolete_mapping_cache_build::levelx_nand_flash_test ........   Passed    6.58 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   6.58 sec
3/3 Test #1: nor_obsolete_cache_build::levelx_nand_flash_test ........   Passed    6.67 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   6.67 sec
3/3 Test #1: nor_mapping_cache_build::levelx_nand_flash_test ........   Passed    6.77 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   6.78 sec
3/3 Test #1: full_build::levelx_nand_flash_test ........   Passed    6.91 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   6.91 sec
3/3 Test #1: free_sector_verify_build::levelx_nand_flash_test ........   Passed    7.14 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   7.14 sec
3/3 Test #1: standalone_full_build::levelx_nand_flash_test ........   Passed    7.21 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   7.21 sec
3/3 Test #1: standalone_build::levelx_nand_flash_test ........   Passed   12.05 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =  12.06 sec
3/3 Test #1: default_build_coverage::levelx_nand_flash_test ........   Passed   48.78 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =  48.81 sec

fix: Write the correct meta data on the block after erase

add missing nand_flash_format_extended API
2025-11-14 18:24:59 +01:00
Haithem Rahmani 0f7dd521e5 fix: Wrong out of range check in lx_nand_flash_block_find
Fix issue 53

Signed-off-by: Haithem Rahmani <haithem.rahmani@st.com>
2025-11-04 16:51:46 +01:00
Haithem Rahmani b5dcbff38c fix: "array out of bounds" error leading to memory corruption
Fix description
----------------
add missing checks on the index of nor_flash -> lx_nor_flash_extended_cache[i]

Fixes Issue#58

Signed-off-by: Haithem Rahmani <haithem.rahmani@st.com>
2025-11-04 08:51:41 +01:00
Haithem Rahmani 7d1ef20acf fix: "array out of bounds" error leading to memory corruption
Fix description
----------------
add missing checks on the index of nor_flash -> lx_nor_flash_extended_cache[i]

Fixes Issue#58

Signed-off-by: Haithem Rahmani <haithem.rahmani@st.com>
2025-10-22 16:14:04 +01:00