Skip to content

Conversation

@fdesbiens
Copy link
Contributor

No description provided.

rahmanih and others added 11 commits October 22, 2025 16:14
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>
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>
Fix issue 53

Signed-off-by: Haithem Rahmani <haithem.rahmani@st.com>
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
fix: Wrong out-of-range check in lx_nand_flash_block_find.
fix: "array out of bounds" error leading to memory corruption
New APIs:
- lx_nor_flash_format(): setup the NOR Flash for a new and fresh filesystem.
- lx_nor_flash_open_extended(): adds a user data pointer that could be passed to the underlying low-level NOR driver.
-  lx_nand_flash_open_extended(): adds a user data pointer that could be passed to the underlying low-level NAND driver.

Updated APIs:
- lx_nor_flash_open(): call the lx_nor_flash_open_extended() with a NULL as user data pointer.
- lx_nand_flash_open(): call the lx_nand_flash_open_extended() with a NULL as user data pointer.
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.
Fix: force initial erase count to 1
@github-actions
Copy link

github-actions bot commented Jan 12, 2026

Test Results

30 tests   30 ✔️  4m 48s ⏱️
10 suites    0 💤
10 files      0

Results for commit c27eb52.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jan 12, 2026

Code Coverage

Package Line Rate Branch Rate Health
default_build_coverage Package 1 65% 60%
Summary 65% (1408 / 2164) 60% (660 / 1109)

@fdesbiens fdesbiens closed this Jan 12, 2026
@fdesbiens fdesbiens reopened this Jan 12, 2026
@fdesbiens fdesbiens merged commit 1751446 into master Jan 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants