Error occurred while adding a Flash region
I encountered an error while attempting to add a 4MByte Flash region to the frdmrw612_wifi_cli_over_ble_wu project, as shown in the image below.
I tried to initialize the new Flash region by creating a separate lfs_config and using the existing lfs_init function, but an error occurred during the lfs_mount process.
The error occurs specifically in the lfs_mount function when calling the lfs_dir_fetchmatch function, which returns an error value of -5.
What additional aspects should be checked when adding a new Flash region?
For reference, the symbols.ldt and end_text.ldt files have been updated with the new Flash region information, based on the existing LITTLEFS_FLASH_region information.
Hi,
What SDK version are you using?
Can you please share steps to replicate this?
Regards,
Daniel.
Hi, @DanielRuvalcaba
The SDK version I am using is 2.16.100, as shown in the image below.
To reproduce the situation, I performed the following steps:
In MCUXpresso, navigate to Project properties -> C/C++ Build -> MCU Settings and allocate the TEST_LITTLEFS_region.
In the project folder, navigate to linkscripts and add the following content to two files:
1. symbols.ldt
TEST_LITTLEFS_FLASH_START_ADDRESS = __base_TEST_LITTLEFS_FLASH_region;
TEST_LITTLEFS_FLASH_SECTOR_SIZE = 0x1000; /* 4k flash sector size */
TEST_LITTLEFS_FLASH_MAX_SECTORS = (__top_TEST_LITTLEFS_FLASH_region
TEST_LITTLEFS_FLASH_START_ADDRESS) / TEST_LITTLEFS_FLASH_SECTOR_SIZE;
2. end_text.ldt
.TEST_LITTLEFS_FLASH_region :
{
. = ORIGIN(TEST_LITTLEFS_FLASH_region) + LENGTH(TEST_LITTLEFS_FLASH_region) - 1;
} > TEST_LITTLEFS_FLASH_region
Flash Config
Define the flash specifications and write the Test_LittleFS_config as shown in the attached test_littlefs.c file.
.....
TEST_LITTLEFS INIT
Regards,
hclee.
Hi,
Thanks for the instructions.
I am having 2 issues while replicating this:
1. The following "TEST_LITTLEFS_FLASH_MAX_SECTORS = (__top_TEST_LITTLEFS_FLASH_region TEST_LITTLEFS_FLASH_START_ADDRESS) / TEST_LITTLEFS_FLASH_SECTOR_SIZE;" in symbols.ldt is giving me some problems in the linker. Is it defined correctly?
2. The project can't find #include "ble_lower_level.h" and #include "audio.h". These files are not included in the original wifi_cli_over_ble_wu example, right?
Regards,
Daniel.
1.
There was a typo in the part I mentioned.
The original is as follows:
What I wrote is as follows:
I thought I added it correctly according to the original format, but could there be a problem with this method?
2.
The audio.h file is a file I added separately. The file only contains several values defined with #define, and there is no content related to Flash.
Hi,
Thanks for the details.
I am checking this.
Regards,
Daniel.
Hi, @DanielRuvalcaba
Could you provide an update on the status of the issue I inquired about earlier?
Regards,
hclee
Hi,
Sorry for the late reply. By any chance, have you tried to mount the littlefs as in littlefs_shell?
I'm sharing with you an article that might help you.
Regards,
Daniel.