Author SHA1 Message Date
Jonathan Blanchard dfe5084ab8 Fixed potential file system corruption when truncating or overwriting file data with fault tolerant mode enabled (#78)
* _fx_fault_tolerant_cleanup_FAT_chain(): Add checks to prevent starting a new cluster deletion session in some corner cases where the end of the chain is reached.

* Fixed formatting of previous commit.
2026-02-10 09:31:41 -05:00
Frédéric Desbiens 0462b027a1 Merge pull request #83 from spir6s/master
Provided ports for Renesas RXv1/GNU, RXv2/GNU and RXv3/GNU
2026-02-05 11:00:52 -05:00
Frédéric Desbiens 1839526557 Updated version number constants 2026-01-12 17:44:19 -05:00
Sebastian Paarz 1f3d7aec33 Merge remote-tracking branch 'github/master' 2026-01-09 17:41:50 +01:00
Frédéric Desbiens 693d5f7964 Merge pull request #81 from rahmanih/fix_issue_79
Update media driver status initialization FX_DRIVER_INIT request
2025-11-27 17:31:30 -05:00
Haithem Rahmani 853f8a2431 Update media driver status initialization FX_DRIVER_INIT request
Main Changes
------------
- In fx_media_format(), set fx_media_driver_status to FX_MEDIA_INVALID
  to indicate the request originates from a format call.

- In fx_media_open(), set fx_media_driver_status to FX_MEDIA_NOT_OPEN
   to indicate the request originates from an open call.

Fixed issues
-------------
-Issue #79

Signed-off-by: Haithem Rahmani <haithem.rahmani@st.com>
2025-11-27 14:31:38 +01:00
Frédéric Desbiens 048a01ed64 Merge pull request #76 from eclipse-threadx/dev
Merge changes ahead of the v6.4.2.202503 release.
2025-09-29 12:32:11 +01:00
Frédéric Desbiens 584c5fff0d Updated version number and added build number and hotfix. 2025-09-29 11:57:21 +01:00
Frédéric Desbiens 047f822392 Fix typo in sample code. 2025-09-29 11:55:12 +01:00
Frédéric Desbiens fb48c62046 Merge pull request #75 from Griffin86/cmake_support_for_cortex_m33
Add CMake support for Cortex M33.
2025-09-29 11:35:17 +01:00
David Streicher ecd70a28fe Add CMake support for Cortex M33
Add convenience CMake files for Cortex M33
similar to other Cortex Mx targets
2025-09-19 09:57:44 +02:00
Frédéric Desbiens 2d11b561c3 Merge commit from fork
Ensure proper RAM Disk sizing in the FileX sample.
2025-07-28 13:58:40 -04:00
Frédéric Desbiens 42b4ee916e Ensure proper RAM Disk sizing in the FileX sample. 2025-07-28 13:55:01 -04:00
Frédéric Desbiens 84d35d9b27 Merge commit from fork
Added error handling to the sample.
2025-07-28 10:31:12 -04:00
Frédéric Desbiens 8112cd45cc Added error handling to the sample.
Signed-off-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
2025-07-21 12:38:46 -04:00
Frédéric Desbiens b1f509820d Merge pull request #59 from nflandin/boot-signature-corrections
Boot Record and FSINFO Signature Corrections
2025-06-10 09:23:17 -04:00
Frédéric Desbiens 9023227ba4 Merge pull request #70 from hnguyenHWI/master
Update minimal CMake version to 3.13
2025-05-15 10:59:02 +02:00
Huan Nguyen c7ec0eaedf Update minimal CMake version to 3.13
Anything under 3.5 was breaking build scripts (for FileX and for
other components that use FileX as a dependency e.g. NetXDuo)
2025-05-14 15:47:49 -06:00
Sebastian Paarz 5aa3aa40f1 Added gnu folders for RX ports 2025-03-11 23:54:03 +01:00
Sebastian Paarz d43d5bddbb Added missing RX ports 2025-03-11 22:51:42 +01:00
Frédéric Desbiens 1312f87f3b Merge pull request #66 from ayedm1/fix_file_github_action_issue
fix github filex regression test action issue
2024-12-05 03:34:16 -05:00
Mohamed AYED 98ce59bea2 update regression_test.yml
fix github filex 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:35:53 +01:00
nflandin 151b9158ee re: issue 47 by coran21
Correction of FSINFO trail signature in format function
2024-09-03 15:05:19 -07:00
nflandin ee280d9d14 Update fx_media_format.c
Correction to boot record signature writing; attempted to bring in line with design intent of variable length boot record as used earlier in function.
2024-06-21 10:50:48 -07:00
Stefan Wick 1b85eb2141 Update hardware-or-architecture-support.md 2024-03-10 22:12:14 -07:00
Stefan Wick 3c00cd8b13 Update feature_request.md 2024-03-10 22:11:41 -07:00
Stefan Wick f79b511e43 Update bug_report.md 2024-03-10 22:11:21 -07:00
Stefan Wick 42d10db66b Update README.md 2024-03-06 16:57:16 -08:00
21 changed files with 217 additions and 40 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
---
name: Bug report
about: Create a report to help us improve Azure RTOS.
about: Create a report to help us improve Eclipse ThreadX.
title: ''
labels: bug
assignees: ''
@@ -13,7 +13,7 @@ A clear and concise description of what the bug is.
Please also mention any information which could help others to understand
the problem you're facing:
- What target device are you using?
- Which version of Azure RTOS?
- Which version of Eclipse ThreadX?
- What toolchain and environment?
- What have you tried to diagnose or workaround this issue?
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: Feature request
about: Suggest an idea or enhancement to existing feature for Azure RTOS.
about: Suggest an idea or enhancement to existing feature for Eclipse ThreadX.
title: ''
labels: feature
assignees: ''
@@ -8,12 +8,12 @@ assignees: ''
---
**Is this request related to a particular hardware platform, SoC, board? Please describe.**
Describe in details the hardware support being requested and why this support benefits Azure RTOS.
Describe in details the hardware support being requested and why this support benefits Eclipse ThreadX.
**Describe why you are asking for this support?**
Describe why you are asking for this support.
If this is a new board or SoC, please state whether you are willing to maintain the Azure RTOS support together with you.
If this is a new board or SoC, please state whether you are willing to maintain the Eclipse ThreadX support together with you.
**Additional context**
Add any other context or graphics (drag-and-drop an image) about the hardware here.
+1 -1
View File
@@ -22,4 +22,4 @@ jobs:
pull-requests: write
pages: write
id-token: write
uses: azure-rtos/threadx/.github/workflows/regression_template.yml@master
uses: eclipse-threadx/threadx/.github/workflows/regression_template.yml@master
+1 -1
View File
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
# Set up the project
project(filex
+1 -1
View File
@@ -123,7 +123,7 @@ Instruction for building the FileX as static library using Arm GNU Toolchain and
## Licensing
License terms for using Eclipse ThreadX are defined in the LICENSE.txt file of this repo. Please refer to this file for all definitive licensing information.
License terms for using Eclipse ThreadX are defined in the LICENSE.txt file of this repo. Please refer to this file for all definitive licensing information for all content, incl. the history of this repo.
## Resources
+3 -1
View File
@@ -138,7 +138,9 @@ extern "C" {
#define AZURE_RTOS_FILEX
#define FILEX_MAJOR_VERSION 6
#define FILEX_MINOR_VERSION 4
#define FILEX_PATCH_VERSION 1
#define FILEX_PATCH_VERSION 5
#define FILEX_BUILD_VERSION 202504
#define FILEX_HOTFIX_VERSION ' '
/* Define the following symbols for backward compatibility */
#define EL_PRODUCT_FILEX
@@ -207,7 +207,7 @@ ULONG last_FAT_sector;
/* At this point, the head_cluster points to the cluster chain that is to be removed. */
/* Tail cluster points to the back of the origianal FAT chain where the new chain is attached to.
/* Tail cluster points to the back of the original FAT chain where the new chain is attached to.
The remove process terminates once this cluster is encountered. */
tail_cluster = _fx_utility_32_unsigned_read((UCHAR *)&FAT_chain -> fx_fault_tolerant_FAT_chain_insertion_back);
@@ -261,9 +261,13 @@ ULONG last_FAT_sector;
if (_fx_utility_FAT_entry_multiple_sectors_check(media_ptr, current_cluster))
{
if (head_cluster == next_session || next_session == FX_FREE_CLUSTER)
{
/* Do not start another session if this is the end of the chain. */
if (next_cluster != tail_cluster)
{
next_session = next_cluster;
}
}
break;
}
@@ -276,9 +280,13 @@ ULONG last_FAT_sector;
/* Get next session. */
if (cache_count == cache_max)
{
/* Do not start another session if this is the end of the chain. */
if (next_cluster != tail_cluster)
{
next_session = next_cluster;
}
}
/* Update head cluster and next session into log file. */
_fx_utility_32_unsigned_write((UCHAR *)&FAT_chain -> fx_fault_tolerant_FAT_chain_next_deletion, next_session);
+22 -13
View File
@@ -161,9 +161,11 @@ UINT sectors_per_fat, f, s;
media_ptr -> fx_media_hidden_sectors = hidden_sectors;
/* Initialize the supplied media I/O driver. First, build the
initialize driver request. */
initialize driver request. Set the fx_media_driver_status to FX_MEDIA_INVALID
to let the driver know that the request is issued from a fx_media_format() call
*/
media_ptr -> fx_media_driver_request = FX_DRIVER_INIT;
media_ptr -> fx_media_driver_status = FX_IO_ERROR;
media_ptr -> fx_media_driver_status = FX_MEDIA_INVALID;
media_ptr -> fx_media_driver_info = driver_info_ptr;
media_ptr -> fx_media_driver_write_protect = FX_FALSE;
media_ptr -> fx_media_driver_free_sector_update = FX_FALSE;
@@ -443,17 +445,24 @@ UINT sectors_per_fat, f, s;
_fx_utility_memory_set(&byte_ptr[j + i], ' ', (11 - i));
#endif /* FX_DISABLE_FORCE_MEMORY_OPERATION */
/* Set bootrecord signature. */
#ifdef FX_FORCE_512_BYTE_BOOT_SECTOR
/* Set bootrecord signature. */
byte_ptr[510] = 0x55;
byte_ptr[511] = 0xAA;
/* Put the boot signature in the standard position. */
byte_ptr[FX_SIG_OFFSET] = FX_SIG_BYTE_1;
byte_ptr[FX_SIG_OFFSET + 1] = FX_SIG_BYTE_2;
#else
/* Set bootrecord signature. */
byte_ptr[bytes_per_sector - 2] = 0x55;
byte_ptr[bytes_per_sector - 1] = 0xAA;
if (bytes_per_sector < 512)
{
/* Put the boot signature at the end of the sector. */
byte_ptr[bytes_per_sector - 2] = FX_SIG_BYTE_1;
byte_ptr[bytes_per_sector - 1] = FX_SIG_BYTE_2;
}
else
{
/* Put the boot signature in the standard position. */
byte_ptr[FX_SIG_OFFSET] = FX_SIG_BYTE_1;
byte_ptr[FX_SIG_OFFSET + 1] = FX_SIG_BYTE_2;
}
#endif
/* Select the boot record write command. */
@@ -510,8 +519,8 @@ UINT sectors_per_fat, f, s;
byte_ptr[487] = 0x61;
/* Build the final signature word, this too is used to help verify that this is a FSINFO sector. */
byte_ptr[508] = 0x55;
byte_ptr[509] = 0xAA;
byte_ptr[FX_SIG_OFFSET] = FX_SIG_BYTE_1;
byte_ptr[FX_SIG_OFFSET + 1] = FX_SIG_BYTE_2;
/* Setup the total available clusters on the media. We need to subtract 1 for the FAT32 root directory. */
_fx_utility_32_unsigned_write(&byte_ptr[488], (total_clusters - 1));
+4 -2
View File
@@ -261,9 +261,11 @@ FX_INT_SAVE_AREA
FX_TRACE_IN_LINE_INSERT(FX_TRACE_MEDIA_OPEN, media_ptr, media_driver, memory_ptr, memory_size, FX_TRACE_MEDIA_EVENTS, 0, 0)
/* Initialize the supplied media I/O driver. First, build the
initialize driver request. */
initialize driver request. Set the fx_media_driver_status to FX_MEDIA_NOT_OPEN
to let the driver understand that the request is issued from a fx_media_open() call.
*/
media_ptr -> fx_media_driver_request = FX_DRIVER_INIT;
media_ptr -> fx_media_driver_status = FX_IO_ERROR;
media_ptr -> fx_media_driver_status = FX_MEDIA_NOT_OPEN;
media_ptr -> fx_media_driver_info = driver_info_ptr;
media_ptr -> fx_media_driver_write_protect = FX_FALSE;
media_ptr -> fx_media_driver_free_sector_update = FX_FALSE;
+9
View File
@@ -0,0 +1,9 @@
target_sources(${PROJECT_NAME} PRIVATE
# {{BEGIN_TARGET_SOURCES}}
# {{END_TARGET_SOURCES}}
)
target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/inc
)
+23
View File
@@ -0,0 +1,23 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** FileX Component */
/** */
/** Port Specific */
/** */
/**************************************************************************/
/**************************************************************************/
/* Include the generic version of fx_port.h. */
#include "../../../generic/inc/fx_port.h"
+9
View File
@@ -0,0 +1,9 @@
target_sources(${PROJECT_NAME} PRIVATE
# {{BEGIN_TARGET_SOURCES}}
# {{END_TARGET_SOURCES}}
)
target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/inc
)
+24
View File
@@ -0,0 +1,24 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** FileX Component */
/** */
/** Port Specific */
/** */
/**************************************************************************/
/**************************************************************************/
/* Include the generic version of fx_port.h. */
#include "../../../generic/inc/fx_port.h"
+9
View File
@@ -0,0 +1,9 @@
target_sources(${PROJECT_NAME} PRIVATE
# {{BEGIN_TARGET_SOURCES}}
# {{END_TARGET_SOURCES}}
)
target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/inc
)
+24
View File
@@ -0,0 +1,24 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** FileX Component */
/** */
/** Port Specific */
/** */
/**************************************************************************/
/**************************************************************************/
/* Include the generic version of fx_port.h. */
#include "../../../generic/inc/fx_port.h"
+9
View File
@@ -0,0 +1,9 @@
target_sources(${PROJECT_NAME} PRIVATE
# {{BEGIN_TARGET_SOURCES}}
# {{END_TARGET_SOURCES}}
)
target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_LIST_DIR}/inc
)
+24
View File
@@ -0,0 +1,24 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
**************************************************************************/
/**************************************************************************/
/**************************************************************************/
/** */
/** FileX Component */
/** */
/** Port Specific */
/** */
/**************************************************************************/
/**************************************************************************/
/* Include the generic version of fx_port.h. */
#include "../../../generic/inc/fx_port.h"
+36 -11
View File
@@ -1,3 +1,15 @@
/***************************************************************************
* Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025 Eclipse ThreadX contributors
*
* This program and the accompanying materials are made available under the
* terms of the MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
**************************************************************************/
/* This is a small demo of the high-performance FileX FAT file system. It includes setup for
a small 34KB RAM disk and a loop that writes and reads a small file. */
#include "fx_api.h"
@@ -29,14 +41,16 @@ void thread_0_entry(ULONG thread_input);
/* Define FileX global data structures. */
#define TOTAL_SECTORS 256
#define SECTOR_SIZE 512
FX_MEDIA ram_disk;
FX_FILE my_file;
#ifndef FX_STANDALONE_ENABLE
CHAR *ram_disk_memory;
#else
unsigned char ram_disk_memory[256*512];
unsigned char ram_disk_memory[TOTAL_SECTORS*SECTOR_SIZE];
#endif
/* Define ThreadX global data structures. */
@@ -102,8 +116,12 @@ CHAR local_buffer[30];
/* Format the RAM disk - the memory for the RAM disk was setup in
tx_application_define above. */
fx_media_format(&ram_disk,
tx_application_define above.
Important Note: The user must ensure there is enough RAM for the format
specified. Otherwise, memory corruption can occur.
*/
status = fx_media_format(&ram_disk,
_fx_ram_driver, // Driver entry
ram_disk_memory, // RAM disk memory pointer
media_memory, // Media buffer pointer
@@ -112,28 +130,35 @@ CHAR local_buffer[30];
1, // Number of FATs
32, // Directory Entries
0, // Hidden sectors
256, // Total sectors
512, // Sector size
TOTAL_SECTORS, // Total sectors
SECTOR_SIZE, // Sector size
8, // Sectors per cluster
1, // Heads
1); // Sectors per track
/* Determine if the RAM disk format was successful. */
if (status != FX_SUCCESS)
{
/* Error formatting the RAM disk. */
printf("HTTPS RAM disk format failed, error: %x\n", status);
return;
}
/* Loop to repeat the demo over and over! */
do
{
/* Open the RAM disk. */
status = fx_media_open(&ram_disk, "RAM DISK", _fx_ram_driver, ram_disk_memory, media_memory, sizeof(media_memory));
/* Check the media open status. */
/* Determine if the RAM disk open was successful. */
if (status != FX_SUCCESS)
{
/* Error, break the loop! */
break;
/* Error opening the RAM disk. */
printf("RAM disk open failed, error: %x\n", status);
return;
}
#ifdef FX_ENABLE_FAULT_TOLERANT
status = fx_fault_tolerant_enable(&ram_disk, fault_tolerant_memory, sizeof(fault_tolerant_memory));
+1 -1
View File
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
cmake_policy(SET CMP0057 NEW)
project(regression_test LANGUAGES C)
+1 -1
View File
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
cmake_policy(SET CMP0057 NEW)
project(samples LANGUAGES C)