Commit Graph
111 Commits
Author SHA1 Message Date
Frédéric DesbiensandCopilot 123218cc51 Added copyright headers to files missing them
Applied the standard MIT license header to all project-owned C, header,
assembly, shell, and Python files that were missing a copyright notice.
Third-party, toolchain startup, and auto-generated files were excluded.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-06 21:48:12 +02:00
Frédéric DesbiensandCopilot b9f54b87bb Updated version number constants (#74)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-04 17:12:31 -04:00
Frédéric DesbiensandCopilot 2e061ba319 Added a release preparation script (#73)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-04 17:11:35 -04:00
Frédéric DesbiensandCopilot bfb39676df Added opt-in lazy sector release to reduce O(N²) deletion (issue #70) (#71)
WARNING: This feature is brand new and has not been tested beyond the
existing regression suite.  It should be thoroughly tested — including
stress, power-loss, and wear-levelling scenarios — before being used in
any production system.

When LX_NAND_FLASH_ENABLE_LAZY_SECTOR_RELEASE is defined and free blocks
exceed LX_NAND_FLASH_SECTOR_RELEASE_LAZY_THRESHOLD (default 10), releasing
a sector from a full block defers the copy+erase.  A tombstone page is
written to a freshly-allocated block; the old full block is flagged
COMPACTION_PENDING in its block status and recorded in a new per-LG
compaction table.  Compaction (merge + erase) is triggered lazily:

  * sector_write: before writing to a full block with a pending source
  * block_data_move: intercepts wear-levelling moves for pending LGs
  * defragment: iterates all pending LGs (now actually implemented)
  * block_allocate: emergency compaction when the free list is empty

Reads transparently fall back to the compaction-pending block when the
primary block does not contain the requested sector.

Crash recovery is handled in open_extended:
  - Phase 1: detects COMPACTION_PENDING blocks and either clears the flag
    (crash before mapping update — abort) or rebuilds compaction_table
    (crash after mapping update — resume deferred compaction).
  - Phase 2: erases orphaned ALLOCATED blocks not present in any mapping.

Without the flag, all paths remain unchanged and defragment returns
LX_NOT_SUPPORTED as before.

Fixes: https://github.com/eclipse-threadx/levelx/issues/70

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-02 11:25:12 -04:00
Frédéric Desbiens a46b74fb8a Merge pull request #69 from eclipse-threadx/dev
Merge changes ahead of the v6.5.0.202601 release
v6.5.0.202601_rel
2026-03-06 19:43:03 +01:00
Frédéric Desbiens b80f28e0e6 Merge pull request #68 from fdesbiens/dev
Updated copyright headers and version number constants
2026-03-05 09:39:50 +01:00
Frédéric Desbiens f98a5c4eb8 Updated version number constants. 2026-03-05 09:23:24 +01:00
Frédéric Desbiens b9ba4a97bf Updated copyright headers and removed trailing whitespace 2026-03-05 09:17:20 +01:00
Frédéric Desbiens fa1a8e5ff4 Merge pull request #65 from borlandong/fix-performance-issue
Updated the logic to skip unnecessary main data read in _lx_nand_flash_sector_read
2026-02-17 11:38:13 -05:00
Frédéric Desbiens 89c745fcf5 Merge pull request #66 from rahmanih/update_nand_simulator
Updated the nand flash simulator
2026-02-17 11:36:36 -05:00
Haithem Rahmani 4782f22568 update nand flash simulator
align the nand flash simulator against the PR #65

Tests:
Total Test time (real) =   6.33 sec
~/work/git_repos/github/eclipse/levelx_rahmanih/test/cmake
3/3 Test #1: default_build_coverage::levelx_nand_flash_test ........   Passed   44.06 sec

100% tests passed, 0 tests failed out of 3
2026-02-10 09:28:48 +01:00
borlandong 58dc81e83c perf: skip unnecessary main data read in _lx_nand_flash_sector_read 2026-01-22 12:09:25 +08:00
Frédéric Desbiens 1751446fb0 Merge pull request #63 from eclipse-threadx/dev
Merge changes ahead of the 202504 release
v6.4.5.202504_rel v6.5.0.202601_pre
2026-01-12 18:05:43 -05:00
Frédéric Desbiens c27eb52bd2 Updated version number constants 2026-01-12 18:01:37 -05:00
Frédéric Desbiens c03223909a Merge pull request #62 from rahmanih/fix_nor_flash_format
Fix: force initial erase count to 1
2026-01-12 17:55:06 -05:00
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
Frédéric Desbiens 6a534bed34 Update minimal CMake version in CMakeLists.txt to 3.13 2025-11-25 10:48:08 -05:00
Frédéric Desbiens 4585b92f15 Update minimal CMake version in CMakeLists.txt to 3.13 2025-11-25 10:45:08 -05:00
Frédéric Desbiens 63ed12cfd6 Merge pull request #60 from rahmanih/add_new_level_apis_pr
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.
2025-11-25 10:40:13 -05:00
Frédéric Desbiens a1761869fd Merge pull request #59 from rahmanih/fix_issue_58
fix: "array out of bounds" error leading to memory corruption
2025-11-25 10:09:17 -05:00
Frédéric Desbiens 5783f64fe1 Merge pull request #61 from rahmanih/fix_issue_53
fix: Wrong out-of-range check in lx_nand_flash_block_find.
2025-11-25 09:59:41 -05: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
Frédéric Desbiens 04e385f3d5 Merge pull request #50 from ayedm1/fix_levelx_github_action_job
fix github levelx regression test action issue
2024-12-12 17:31:11 +01:00
Mohamed AYED 7c5d83d794 update regression_test.yml
fix github levelx regression test action issue

update regression_test.yml

uses: azure-rtos/threadx/.github/workflows/regression_template.yml@master
==>
uses: eclipse-threadx/threadx/.github/workflows/regression_template.yml@master
2024-11-29 21:54:31 +01:00
Stefan Wick 24eb7d8692 Merge pull request #40 from eclipse-threadx/wickste-patch-6
Update branding in issues templates
2024-03-10 22:18:15 -07:00
Stefan Wick 058b242a9a Update hardware-or-architecture-support.md 2024-03-10 22:04:45 -07:00
Stefan Wick a3c9691d89 Update feature_request.md 2024-03-10 22:04:18 -07:00
Stefan Wick f5a55077ad Update bug_report.md 2024-03-10 22:03:35 -07:00
Stefan Wick 656d1490f4 Merge pull request #39 from eclipse-threadx/wickste-patch-5
Update README.md
2024-03-07 07:20:23 -08:00
Stefan Wick 8e1d00b591 Update README.md 2024-03-06 16:56:23 -08:00
Stefan Wick f8899e5d6d Merge pull request #38 from eclipse-threadx/bo-ms/add_revision_history
Add revision history file.
v6.4.1_rel
2024-02-27 17:24:08 -08:00
Stefan Wick acc5190739 Merge branch 'master' into bo-ms/add_revision_history 2024-02-27 17:14:01 -08:00
Stefan Wick 79cbf4019f Merge branch 'master' into bo-ms/add_revision_history 2024-02-27 17:11:51 -08:00
Stefan Wick 2a963969bc Merge pull request #37 from eclipse-threadx/tizho/update_version
Update version number to 6.4.1
2024-02-27 17:07:24 -08:00
Bo Chen (from Dev Box) 1317123fdc Add revision history file. 2024-02-27 16:58:07 +08:00
TiejunZhou 814a8a346c Update version number to 6.4.1 2024-02-27 06:37:17 +00:00
Stefan Wick 34616e26e7 Merge pull request #35 from eclipse-threadx/wickste-patch-4
Update README.md
2024-02-21 07:09:23 -08:00
Stefan Wick f840cf4ce6 Update README.md 2024-02-20 22:51:45 -08:00
Stefan Wick ec683ddf14 Merge pull request #33 from eclipse-threadx/wickste-patch-3
Update LICENSE.txt and Delete LICENSED-HARDWARE.txt
2024-02-13 12:23:50 -08:00
Stefan Wick 1d6706dfa9 Merge branch 'master' into wickste-patch-3 2024-02-12 09:04:40 -08:00
Stefan Wick 6809f87fdd Merge pull request #32 from eclipse-threadx/wickste-patch-2
Update CONTRIBUTING.md
2024-02-12 08:20:24 -08:00
Stefan Wick 9b766d144f Merge branch 'master' into wickste-patch-2 2024-02-12 08:20:12 -08:00
Stefan Wick fb4b913dc2 Merge pull request #31 from eclipse-threadx/wickste-patch-1
Create SECURITY.md
2024-02-09 10:48:15 -08:00
Stefan Wick 01517ad256 Delete LICENSED-HARDWARE.txt 2024-02-06 21:41:48 -08:00
Stefan Wick 9f85e68bd1 Update LICENSE.txt 2024-02-06 21:41:28 -08:00
Stefan Wick bc8f7f3623 Update CONTRIBUTING.md 2024-02-06 21:15:04 -08:00
Stefan Wick 3ca016c042 Create SECURITY.md 2024-02-06 18:34:50 -08:00