mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(storage): applied spelling fixes by codespell pre-commit hook
This commit is contained in:
parent
34f0a0d6e5
commit
10cc15b150
@ -1,4 +1,4 @@
|
||||
[codespell]
|
||||
skip = build,*.yuv
|
||||
ignore-words-list = ser,dout,rsource,fram
|
||||
skip = build,*.yuv,components/fatfs/src/*,alice.txt
|
||||
ignore-words-list = ser,dout,rsource,fram,inout
|
||||
write-changes = true
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
@ -228,7 +228,7 @@ TEST(partition_api, test_partition_mmap_reopen)
|
||||
memset(p_file_mmap_ctrl_input, 0, sizeof(*p_file_mmap_ctrl_input));
|
||||
strlcpy(p_file_mmap_ctrl_input->flash_file_name, generated_file_name, sizeof(p_file_mmap_ctrl_input->flash_file_name));
|
||||
|
||||
// get partiton
|
||||
// get partition
|
||||
partition_data = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, "storage");
|
||||
TEST_ASSERT_NOT_NULL(partition_data);
|
||||
|
||||
@ -295,7 +295,7 @@ TEST(partition_api, test_partition_mmap_remove)
|
||||
memset(p_file_mmap_ctrl_input, 0, sizeof(*p_file_mmap_ctrl_input));
|
||||
strlcpy(p_file_mmap_ctrl_input->flash_file_name, generated_file_name, sizeof(p_file_mmap_ctrl_input->flash_file_name));
|
||||
|
||||
// get partiton, should fail with NULL returned
|
||||
// get partition, should fail with NULL returned
|
||||
partition_data = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, "storage");
|
||||
TEST_ASSERT_EQUAL(NULL, partition_data);
|
||||
|
||||
@ -546,7 +546,7 @@ void read_stats(t_stats *p_stats)
|
||||
}
|
||||
|
||||
// evaluates if final stats differ from initial stats by expected difference stats.
|
||||
// if there is no need to evaluate some stats, set respective expeted difference stats members to SIZE_MAX
|
||||
// if there is no need to evaluate some stats, set respective expected difference stats members to SIZE_MAX
|
||||
bool evaluate_stats(const t_stats *p_initial_stats, const t_stats *p_final_stats, const t_stats *p_expected_difference_stats)
|
||||
{
|
||||
if (p_expected_difference_stats->read_ops != SIZE_MAX) {
|
||||
|
@ -167,7 +167,7 @@ size_t esp_partition_get_write_bytes(void);
|
||||
* esp_partition_write and esp_partition_erase_range operations.
|
||||
*
|
||||
* @return
|
||||
* - estimated total time spent in read/write/erase operations in miliseconds
|
||||
* - estimated total time spent in read/write/erase operations in milliseconds
|
||||
*/
|
||||
size_t esp_partition_get_total_time(void);
|
||||
|
||||
@ -231,7 +231,7 @@ esp_partition_file_mmap_ctrl_t* esp_partition_get_file_mmap_ctrl_input(void);
|
||||
* file name holding binary used to initialize partition table (if it was used)
|
||||
*
|
||||
* @return
|
||||
* - pointer to flash file mapping actuall values in control structure
|
||||
* - pointer to flash file mapping actual values in control structure
|
||||
*
|
||||
*/
|
||||
esp_partition_file_mmap_ctrl_t* esp_partition_get_file_mmap_ctrl_act(void);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -279,7 +279,7 @@ esp_err_t esp_partition_file_mmap(const uint8_t **part_desc_addr_start)
|
||||
uint8_t *part_ptr = s_spiflash_mem_file_buf + ESP_PARTITION_TABLE_OFFSET;
|
||||
|
||||
ESP_LOGV(TAG, "");
|
||||
ESP_LOGV(TAG, "Partition table sucessfully imported, partitions found:");
|
||||
ESP_LOGV(TAG, "Partition table successfully imported, partitions found:");
|
||||
|
||||
while (true) {
|
||||
esp_partition_info_t *p_part_item = (esp_partition_info_t *)part_ptr;
|
||||
@ -389,7 +389,7 @@ esp_err_t esp_partition_write(const esp_partition_t *partition, size_t dst_offse
|
||||
|
||||
// hook gathers statistics and can emulate power-off
|
||||
// in case of power - off it decreases new_size to the number of bytes written
|
||||
// before power event occured
|
||||
// before power event occurred
|
||||
if (!ESP_PARTITION_HOOK_WRITE(dst_addr, &new_size)) {
|
||||
ret = ESP_ERR_FLASH_OP_FAIL;
|
||||
}
|
||||
@ -543,7 +543,7 @@ esp_partition_file_mmap_ctrl_t *esp_partition_get_file_mmap_ctrl_act(void)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ESP_PARTITION_ENABLE_STATS
|
||||
// timing data for ESP8266, 160MHz CPU frequency, 80MHz flash requency
|
||||
// timing data for ESP8266, 160MHz CPU frequency, 80MHz flash frequency
|
||||
// all values in microseconds
|
||||
// values are for block sizes starting at 4 bytes and going up to 4096 bytes
|
||||
static size_t s_esp_partition_stat_read_times[] = {7, 5, 6, 7, 11, 18, 32, 60, 118, 231, 459};
|
||||
|
@ -145,11 +145,11 @@ esp_err_t esp_partition_erase_range(const esp_partition_t *partition,
|
||||
|
||||
/*
|
||||
* Note: current implementation ignores the possibility of multiple regions in the same partition being
|
||||
* mapped. Reference counting and address space re-use is delegated to spi_flash_mmap.
|
||||
* mapped. Reference counting and address space reuse is delegated to spi_flash_mmap.
|
||||
*
|
||||
* If this becomes a performance issue (i.e. if we need to map multiple regions within the partition),
|
||||
* we can add esp_partition_mmapv which will accept an array of offsets and sizes, and return array of
|
||||
* mmaped pointers, and a single handle for all these regions.
|
||||
* mapped pointers, and a single handle for all these regions.
|
||||
*/
|
||||
esp_err_t esp_partition_mmap(const esp_partition_t *partition, size_t offset, size_t size,
|
||||
esp_partition_mmap_memory_t memory,
|
||||
|
@ -124,7 +124,7 @@ TEST_CASE("Test esp_partition_get_sha256() that it can handle a big partition",
|
||||
* The test case is implemented as follows:
|
||||
* 1. SPI Flash space is mmapped by MMU page size chunks, one by one
|
||||
* 2. the iteration stops when either whole SPI Flash range is exhausted or the MMU page pool is fully occupied (ESP_ERR_NO_MEM)
|
||||
* 3. the last successfully mmaped MMU page is released, all the rest remains occupied
|
||||
* 3. the last successfully mapped MMU page is released, all the rest remains occupied
|
||||
* 4. pseudo partition of DATA type is created over all the SPI Flash capacity
|
||||
* 5. esp_partition_get_sha256() is calculated for the partition defined in 4. (printed to standard output on successful completion)
|
||||
* 6. all the resources allocated directly by the test are released
|
||||
|
@ -64,7 +64,7 @@ menu "FAT Filesystem support"
|
||||
config FATFS_CODEPAGE_857
|
||||
bool "Turkish (CP857)"
|
||||
config FATFS_CODEPAGE_860
|
||||
bool "Portugese (CP860)"
|
||||
bool "Portuguese (CP860)"
|
||||
config FATFS_CODEPAGE_861
|
||||
bool "Icelandic (CP861)"
|
||||
config FATFS_CODEPAGE_862
|
||||
@ -161,7 +161,7 @@ menu "FAT Filesystem support"
|
||||
help
|
||||
This option sets FATFS configuration value _FS_TIMEOUT, scaled to milliseconds.
|
||||
Sets the number of milliseconds FATFS will wait to acquire a mutex when
|
||||
operating on an open file. For example, if one task is performing a lenghty
|
||||
operating on an open file. For example, if one task is performing a lengthy
|
||||
operation, another task will wait for the first task to release the lock,
|
||||
and time out after amount of time set by this option.
|
||||
|
||||
@ -184,7 +184,7 @@ menu "FAT Filesystem support"
|
||||
|
||||
|
||||
config FATFS_ALLOC_PREFER_EXTRAM
|
||||
bool "Perfer external RAM when allocating FATFS buffers"
|
||||
bool "Prefer external RAM when allocating FATFS buffers"
|
||||
default y
|
||||
depends on SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC
|
||||
help
|
||||
@ -251,6 +251,6 @@ menu "FAT Filesystem support"
|
||||
default y
|
||||
help
|
||||
If enabled, the whole link operation (including file copying) is performed under lock.
|
||||
This ensures that the link operation is atomic, but may cause perfomance for large files.
|
||||
This ensures that the link operation is atomic, but may cause performance for large files.
|
||||
It may create less fragmented file copy.
|
||||
endmenu
|
||||
|
@ -4,7 +4,7 @@
|
||||
/*-----------------------------------------------------------------------*/
|
||||
/* If a working storage control module is available, it should be */
|
||||
/* attached to the FatFs via a glue function rather than modifying it. */
|
||||
/* This is an example of glue functions to attach various exsisting */
|
||||
/* This is an example of glue functions to attach various existing */
|
||||
/* storage control modules to the FatFs module with a defined API. */
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -141,7 +141,7 @@ static void prepare_fatfs(const char* partition_label, const esp_partition_t** p
|
||||
* at the time of writing this - therefore there also is a device test_apps test in
|
||||
* `components/fatfs/test_apps/flash_wl/main/test_fatfs_flash_wl.c` which tests our VFS FATFS SPIFLASH API.
|
||||
*/
|
||||
TEST_CASE("Test mounting 2 volumes, writing data and formating the 2nd one, reading data", "[fatfs]")
|
||||
TEST_CASE("Test mounting 2 volumes, writing data and formatting the 2nd one, reading data", "[fatfs]")
|
||||
{
|
||||
FRESULT fr_result;
|
||||
esp_err_t esp_result;
|
||||
@ -240,7 +240,7 @@ TEST_CASE("Test mounting 2 volumes, writing data and formating the 2nd one, read
|
||||
fr_result = f_read(&file1, read1, data_size, &bw1);
|
||||
REQUIRE(fr_result == FR_OK);
|
||||
REQUIRE(bw1 != data_size);
|
||||
// Comapre data
|
||||
// Compare data
|
||||
printf("data1=%s, read1=%s\n", data1, read1);
|
||||
REQUIRE(strncmp(data1, read1, data_size-1) != 0); // 987654321 should be ersead due to formatting
|
||||
// Close file from file1
|
||||
@ -258,7 +258,7 @@ TEST_CASE("Test mounting 2 volumes, writing data and formating the 2nd one, read
|
||||
fr_result = f_read(&file0, read0, data_size, &bw0);
|
||||
REQUIRE(fr_result == FR_OK);
|
||||
REQUIRE(bw0 == data_size);
|
||||
// Comapre data
|
||||
// Compare data
|
||||
printf("data0=%s, read0=%s\n", data0, read0);
|
||||
REQUIRE(strncmp(data0, read0, data_size-1) == 0); // should match since the partition was not formatted
|
||||
// Close file from file0
|
||||
|
@ -58,7 +58,7 @@ static mtxid Mutex[FF_VOLUMES + 1]; /* Table of mutex ID */
|
||||
|
||||
#elif OS_TYPE == 2 /* uc/OS-II */
|
||||
#include "includes.h"
|
||||
static OS_EVENT *Mutex[FF_VOLUMES + 1]; /* Table of mutex pinter */
|
||||
static OS_EVENT *Mutex[FF_VOLUMES + 1]; /* Table of mutex pointers */
|
||||
|
||||
#elif OS_TYPE == 3 /* FreeRTOS */
|
||||
#include "freertos/FreeRTOS.h"
|
||||
|
@ -642,7 +642,7 @@ void test_fatfs_utime(const char* filename, const char* root_dir)
|
||||
TEST_ASSERT_EQUAL(0, stat(filename, &achieved_stat));
|
||||
TEST_ASSERT_EQUAL_UINT32(desired_time.modtime, achieved_stat.st_mtime);
|
||||
|
||||
//WARNING: it has the Unix Millenium bug (Y2K38)
|
||||
//WARNING: it has the Unix Millennium bug (Y2K38)
|
||||
|
||||
// 00:00:00. January 1st, 1970 - FATFS cannot handle years before 1980
|
||||
desired_tm.tm_mon = 1 - 1;
|
||||
|
@ -1277,7 +1277,7 @@ static int vfs_fat_utime(void *ctx, const char *path, const struct utimbuf *time
|
||||
fat_date_t fdate;
|
||||
fat_time_t ftime;
|
||||
|
||||
// this time transformation is esentially the reverse of the one in vfs_fat_stat()
|
||||
// this time transformation is essentially the reverse of the one in vfs_fat_stat()
|
||||
fdate.mday = tm_time.tm_mday;
|
||||
fdate.mon = tm_time.tm_mon + 1; // January in fdate.mon is 1, and 0 in tm_time.tm_mon
|
||||
fdate.year = tm_time.tm_year - 80; // tm_time.tm_year=0 is 1900, tm_time.tm_year=0 is 1980
|
||||
|
@ -19,7 +19,7 @@ typedef enum {
|
||||
|
||||
typedef struct vfs_fat_spiflash_ctx_t {
|
||||
const esp_partition_t *partition; //The partition where the FAT is located
|
||||
bool by_label; //If the partition is mounted by lable or not
|
||||
bool by_label; //If the partition is mounted by label or not
|
||||
BYTE pdrv; //Drive number that is mounted
|
||||
FATFS *fs; //FAT structure pointer that is registered
|
||||
wl_handle_t wlhandle; //WL handle
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -52,7 +52,7 @@ public:
|
||||
}
|
||||
size = lseek(file_fd, 0L, SEEK_END);
|
||||
if (size < 0) {
|
||||
fail_msg = "falied to seek in file with partition content";
|
||||
fail_msg = "failed to seek in file with partition content";
|
||||
break;
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ public:
|
||||
// laoad file into local buffer
|
||||
int res = lseek(file_fd, 0L, SEEK_SET);
|
||||
if (res < 0) {
|
||||
fail_msg = "falied to seek in file with partition content";
|
||||
fail_msg = "failed to seek in file with partition content";
|
||||
break;
|
||||
}
|
||||
size = read(file_fd, p_buff, size);
|
||||
@ -132,7 +132,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
// esp_partition_erase_range uses offset relative to the begining of partition
|
||||
// esp_partition_erase_range uses offset relative to the beginning of partition
|
||||
return (esp_partition_erase_range(&esp_partition,
|
||||
offset - esp_partition.address,
|
||||
SPI_FLASH_SEC_SIZE) == ESP_OK);
|
||||
@ -142,7 +142,7 @@ public:
|
||||
{
|
||||
delete p_part;
|
||||
|
||||
// ensure underlying mmaped file gets deleted after unmap.
|
||||
// ensure underlying mapped file gets deleted after unmap.
|
||||
esp_partition_file_mmap_ctrl_t *p_ctrl = esp_partition_get_file_mmap_ctrl_input();
|
||||
p_ctrl->remove_dump = true;
|
||||
esp_partition_file_munmap();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -92,7 +92,7 @@ TEST_CASE("Page reading with different type causes type mismatch error", "[nvs]"
|
||||
CHECK(page.readItem(1, nvs::ItemType::U32, "intval1", &val, sizeof(val)) == ESP_ERR_NVS_TYPE_MISMATCH);
|
||||
}
|
||||
|
||||
TEST_CASE("Page when erased, it's state becomes UNITIALIZED", "[nvs]")
|
||||
TEST_CASE("Page when erased, it's state becomes UNINITIALIZED", "[nvs]")
|
||||
{
|
||||
PartitionEmulationFixture f;
|
||||
nvs::Page page;
|
||||
@ -753,7 +753,7 @@ TEST_CASE("nvs iterators tests", "[nvs]")
|
||||
CHECK(res == ESP_ERR_NVS_NOT_FOUND); // after finishing the loop or if no entry was found to begin with,
|
||||
// res has to be ESP_ERR_NVS_NOT_FOUND or some internal error
|
||||
// or programming error occurred
|
||||
nvs_release_iterator(it); // unneccessary call but emphasizes the programming pattern
|
||||
nvs_release_iterator(it); // unnecessary call but emphasizes the programming pattern
|
||||
return count;
|
||||
};
|
||||
|
||||
@ -768,7 +768,7 @@ TEST_CASE("nvs iterators tests", "[nvs]")
|
||||
CHECK(res == ESP_ERR_NVS_NOT_FOUND); // after finishing the loop or if no entry was found to begin with,
|
||||
// res has to be ESP_ERR_NVS_NOT_FOUND or some internal error
|
||||
// or programming error occurred
|
||||
nvs_release_iterator(it); // unneccessary call but emphasizes the programming pattern
|
||||
nvs_release_iterator(it); // unnecessary call but emphasizes the programming pattern
|
||||
return count;
|
||||
};
|
||||
|
||||
@ -855,7 +855,7 @@ TEST_CASE("nvs iterators tests", "[nvs]")
|
||||
CHECK(res == ESP_ERR_NVS_NOT_FOUND); // after finishing the loop, res has to be ESP_ERR_NVS_NOT_FOUND
|
||||
// or some internal error or programming error occurred
|
||||
CHECK(key == "value8");
|
||||
nvs_release_iterator(it); // unneccessary call but emphasizes the programming pattern
|
||||
nvs_release_iterator(it); // unnecessary call but emphasizes the programming pattern
|
||||
}
|
||||
|
||||
SECTION("Entry info is not affected by subsequent erase") {
|
||||
@ -902,7 +902,7 @@ TEST_CASE("nvs iterators tests", "[nvs]")
|
||||
// or some internal error or programming error occurred
|
||||
CHECK(entries_created == entries_found);
|
||||
|
||||
nvs_release_iterator(it); // unneccessary call but emphasizes the programming pattern
|
||||
nvs_release_iterator(it); // unnecessary call but emphasizes the programming pattern
|
||||
nvs_close(handle_3);
|
||||
}
|
||||
|
||||
@ -1603,7 +1603,7 @@ TEST_CASE("calculate used and free space", "[nvs]")
|
||||
nvs_handle_t handle_1;
|
||||
size_t ns1_expected_entries = 0;
|
||||
|
||||
// create namepace
|
||||
// create namespace
|
||||
consumed_entries = 1; // should consume one entry
|
||||
TEST_ESP_OK(nvs_open("test_k1", NVS_READWRITE, &handle_1));
|
||||
TEST_ESP_OK(nvs_get_stats(NULL, &stat2));
|
||||
@ -3275,7 +3275,7 @@ TEST_CASE("nvs multiple write with same key but different types", "[nvs][xxx]")
|
||||
|
||||
#ifdef CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY
|
||||
// Legacy behavior
|
||||
// First use of key hooks data type until removed by nvs_erase_key. Alternative re-use of same key with different
|
||||
// First use of key hooks data type until removed by nvs_erase_key. Alternative reuse of same key with different
|
||||
// data type is written to the storage as hidden active value. It is returned by nvs_get function after nvs_erase_key is called.
|
||||
// Mixing more than 2 data types brings undefined behavior. It is not tested here.
|
||||
|
||||
|
@ -374,7 +374,7 @@ void test_Page_readItem__read_corrupted_erase_fail()
|
||||
// prepare corrupt entry for reading
|
||||
fix.write_raw( 96, fix.value_entry, sizeof(fix.value_entry));
|
||||
|
||||
// emulate write failure as nvs will try to invalidate the corupt entry
|
||||
// emulate write failure as nvs will try to invalidate the corrupt entry
|
||||
// by setting bit in entry table (0xfa -> 0xf2)
|
||||
fix.fail_write_at(1);
|
||||
|
||||
@ -450,7 +450,7 @@ void test_Page_readItem__corrupt_data_erase_failure()
|
||||
uint8_t chunk_start = 0;
|
||||
uint8_t read_data [32];
|
||||
|
||||
// corupt the data
|
||||
// corrupt the data
|
||||
fix.blob_data[16] = 0xdf;
|
||||
fix.write_raw(128, fix.blob_data, sizeof(fix.blob_data));
|
||||
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
|
||||
~PartitionEmulationFixture()
|
||||
{
|
||||
// ensure underlying mmaped file gets deleted after unmap.
|
||||
// ensure underlying mapped file gets deleted after unmap.
|
||||
esp_partition_file_mmap_ctrl_t *p_ctrl = esp_partition_get_file_mmap_ctrl_input();
|
||||
p_ctrl->remove_dump = true;
|
||||
esp_partition_file_munmap();
|
||||
|
@ -56,8 +56,8 @@ typedef struct
|
||||
* 1. Read security configurations from the first NVS key
|
||||
* partition listed in the partition table. (NVS key partition is
|
||||
* any "data" type partition which has the subtype value set to "nvs_keys")
|
||||
* 2. If the NVS key partiton obtained in the previous step is empty,
|
||||
* generate and store new keys in that NVS key partiton.
|
||||
* 2. If the NVS key partition obtained in the previous step is empty,
|
||||
* generate and store new keys in that NVS key partition.
|
||||
* 3. Internally call "nvs_flash_secure_init()" with
|
||||
* the security configurations obtained/generated in the previous steps.
|
||||
*
|
||||
|
@ -224,7 +224,7 @@ protected:
|
||||
/**
|
||||
* @brief Opens non-volatile storage and returns a handle object.
|
||||
*
|
||||
* The handle is automatically closed on desctruction. The scope of the handle is the namespace ns_name
|
||||
* The handle is automatically closed on destruction. The scope of the handle is the namespace ns_name
|
||||
* in a particular partition partition_name.
|
||||
* The parameters partition_name, ns_name and open_mode have the same meaning and restrictions as the parameters
|
||||
* part_name, name and open_mode in \ref nvs_open_from_partition, respectively.
|
||||
|
@ -880,7 +880,7 @@ esp_err_t Page::findItem(uint8_t nsIndex, ItemType datatype, const char* key, si
|
||||
}
|
||||
|
||||
// For BLOB_DATA, we may need to search for all chunk indexes, so the hash list won't help
|
||||
// mHashIndex caluclates hash from nsIndex, key, chunkIdx
|
||||
// mHashIndex calculates hash from nsIndex, key, chunkIdx
|
||||
// We may not use mHashList if datatype is BLOB_DATA and chunkIdx is CHUNK_ANY as CHUNK_ANY is used by BLOB_INDEX
|
||||
if (nsIndex != NS_ANY && key != NULL && (datatype != ItemType::BLOB_DATA || chunkIdx != CHUNK_ANY)) {
|
||||
size_t cachedIndex = mHashList.find(start, Item(nsIndex, datatype, 0, key, chunkIdx));
|
||||
@ -1059,7 +1059,7 @@ size_t Page::getVarDataTailroom() const
|
||||
} else if (mState == PageState::FULL) {
|
||||
return 0;
|
||||
}
|
||||
/* Skip one entry for blob data item precessing the data */
|
||||
/* Skip one entry for blob data item processing the data */
|
||||
return ((mNextFreeEntry < (ENTRY_COUNT-1)) ? ((ENTRY_COUNT - mNextFreeEntry - 1) * ENTRY_SIZE): 0);
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ esp_err_t PageManager::requestNewPage()
|
||||
return activatePage();
|
||||
}
|
||||
|
||||
// find the page with the higest number of erased items
|
||||
// find the page with the highest number of erased items
|
||||
TPageListIterator maxUnusedItemsPageIt;
|
||||
size_t maxUnusedItems = 0;
|
||||
for (auto it = begin(); it != end(); ++it) {
|
||||
|
@ -22,7 +22,7 @@ void setUp(void)
|
||||
mbedtls_aes_init(&ctx);
|
||||
#endif
|
||||
|
||||
// Calling esp_partition_find_first ensures that the paritions have been loaded
|
||||
// Calling esp_partition_find_first ensures that the partitions have been loaded
|
||||
// and subsequent calls to esp_partition_find_first from the tests would not
|
||||
// load partitions which otherwise gets considered as a memory leak.
|
||||
esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_NVS, NULL);
|
||||
|
@ -58,7 +58,7 @@ TEST_CASE("flash erase deinitializes initialized partition", "[nvs]")
|
||||
nvs_close(handle);
|
||||
TEST_ESP_OK(nvs_flash_erase());
|
||||
|
||||
// exptected: no partition is initialized since nvs_flash_erase() deinitialized the partition again
|
||||
// expected: no partition is initialized since nvs_flash_erase() deinitialized the partition again
|
||||
TEST_ESP_ERR(ESP_ERR_NVS_NOT_INITIALIZED, nvs_open("uninit_ns", NVS_READWRITE, &handle));
|
||||
|
||||
// just to be sure it's deinitialized in case of error and not affecting other tests
|
||||
|
@ -95,7 +95,7 @@ esp_err_t esp_partition_write_raw(const esp_partition_t* partition,
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
// timing data for ESP8266, 160MHz CPU frequency, 80MHz flash requency
|
||||
// timing data for ESP8266, 160MHz CPU frequency, 80MHz flash frequency
|
||||
// all values in microseconds
|
||||
// values are for block sizes starting at 4 bytes and going up to 4096 bytes
|
||||
static size_t readTimes[] = {7, 5, 6, 7, 11, 18, 32, 60, 118, 231, 459};
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
SpiFlashEmulator(const char *filename)
|
||||
{
|
||||
load(filename);
|
||||
// Atleast one page should be free, hence we create mData of size of 2 sectors.
|
||||
// At least one page should be free, hence we create mData of size of 2 sectors.
|
||||
mData.resize(mData.size() + SPI_FLASH_SEC_SIZE / 4, 0xffffffff);
|
||||
mUpperSectorBound = mData.size() * 4 / SPI_FLASH_SEC_SIZE;
|
||||
spi_flash_emulator_set(this);
|
||||
|
@ -142,32 +142,32 @@ menu "SPIFFS Configuration"
|
||||
bool "Enable general SPIFFS debug"
|
||||
default "n"
|
||||
help
|
||||
Enabling this option will print general debug mesages to the console.
|
||||
Enabling this option will print general debug messages to the console.
|
||||
|
||||
config SPIFFS_API_DBG
|
||||
bool "Enable SPIFFS API debug"
|
||||
default "n"
|
||||
help
|
||||
Enabling this option will print API debug mesages to the console.
|
||||
Enabling this option will print API debug messages to the console.
|
||||
|
||||
config SPIFFS_GC_DBG
|
||||
bool "Enable SPIFFS Garbage Cleaner debug"
|
||||
default "n"
|
||||
help
|
||||
Enabling this option will print GC debug mesages to the console.
|
||||
Enabling this option will print GC debug messages to the console.
|
||||
|
||||
config SPIFFS_CACHE_DBG
|
||||
bool "Enable SPIFFS Cache debug"
|
||||
default "n"
|
||||
depends on SPIFFS_CACHE
|
||||
help
|
||||
Enabling this option will print cache debug mesages to the console.
|
||||
Enabling this option will print cache debug messages to the console.
|
||||
|
||||
config SPIFFS_CHECK_DBG
|
||||
bool "Enable SPIFFS Filesystem Check debug"
|
||||
default "n"
|
||||
help
|
||||
Enabling this option will print Filesystem Check debug mesages
|
||||
Enabling this option will print Filesystem Check debug messages
|
||||
to the console.
|
||||
|
||||
config SPIFFS_TEST_VISUALISATION
|
||||
|
@ -2,11 +2,8 @@
|
||||
#
|
||||
# spiffsgen is a tool used to generate a spiffs image from a directory
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
from __future__ import division, print_function
|
||||
|
||||
import argparse
|
||||
import io
|
||||
import math
|
||||
@ -229,7 +226,7 @@ class SpiffsObjIndexPage(SpiffsObjPageWithIdx):
|
||||
# Add padding before the object index page specific information
|
||||
img += b'\xFF' * self.build_config.OBJ_DATA_PAGE_HEADER_LEN_ALIGNED_PAD
|
||||
|
||||
# If this is the first object index page for the object, add filname, type
|
||||
# If this is the first object index page for the object, add filename, type
|
||||
# and size information
|
||||
if self.span_ix == 0:
|
||||
img += struct.pack(SpiffsPage._endianness_dict[self.build_config.endianness] +
|
||||
@ -243,7 +240,7 @@ class SpiffsObjIndexPage(SpiffsObjPageWithIdx):
|
||||
+ self.build_config.meta_len
|
||||
+ self.build_config.OBJ_INDEX_PAGES_HEADER_LEN_ALIGNED_PAD))
|
||||
|
||||
# Finally, add the page index of daa pages
|
||||
# Finally, add the page index of data pages
|
||||
for page in self.pages:
|
||||
page = page >> int(math.log(self.build_config.page_size, 2))
|
||||
img += struct.pack(SpiffsPage._endianness_dict[self.build_config.endianness] +
|
||||
|
@ -58,7 +58,7 @@ menu "Virtual file system"
|
||||
depends on VFS_SUPPORT_SELECT
|
||||
default y
|
||||
help
|
||||
Select() related functions might produce an unconveniently lot of
|
||||
Select() related functions might produce an inconveniently lot of
|
||||
debug outputs when one sets the default log level to DEBUG or higher.
|
||||
It is possible to suppress these debug outputs by enabling this
|
||||
option.
|
||||
|
@ -1,16 +1,8 @@
|
||||
// Copyright 2021 Espressif Systems (Shanghai) CO LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@ -29,7 +21,7 @@ extern "C" {
|
||||
* @brief Eventfd vfs initialization settings
|
||||
*/
|
||||
typedef struct {
|
||||
size_t max_fds; /*!< The maxinum number of eventfds supported */
|
||||
size_t max_fds; /*!< The maximum number of eventfds supported */
|
||||
} esp_vfs_eventfd_config_t;
|
||||
|
||||
#define ESP_VFS_EVENTD_CONFIG_DEFAULT() (esp_vfs_eventfd_config_t) { \
|
||||
@ -53,7 +45,7 @@ esp_err_t esp_vfs_eventfd_register(const esp_vfs_eventfd_config_t *config);
|
||||
esp_err_t esp_vfs_eventfd_unregister(void);
|
||||
|
||||
/*
|
||||
* @brief Creates an event file descirptor.
|
||||
* @brief Creates an event file descriptor.
|
||||
*
|
||||
* The behavior of read, write and select is the same as man(2) eventfd with
|
||||
* EFD_SEMAPHORE **NOT** specified. A new flag EFD_SUPPORT_ISR has been added.
|
||||
|
@ -48,7 +48,7 @@ menu "Wear Levelling"
|
||||
flash device sector will not be lost.
|
||||
|
||||
config WL_SECTOR_MODE_PERF
|
||||
bool "Perfomance"
|
||||
bool "Performance"
|
||||
|
||||
config WL_SECTOR_MODE_SAFE
|
||||
bool "Safety"
|
||||
|
@ -128,7 +128,7 @@ esp_err_t WL_Ext_Perf::erase_range(size_t start_address, size_t size)
|
||||
// |0|0|x|x|x|x|x|x|x|x|x|x|x|x|0|0|
|
||||
// | pre | rest | rest | post | <- check ranges
|
||||
//
|
||||
// Pre check - the data that does not fit in the full sector at the begining of the erased block
|
||||
// Pre check - the data that does not fit in the full sector at the beginning of the erased block
|
||||
// Post check - the data that does not fit in the full sector at the end of the erased block
|
||||
// rest check - the data that fits in the full sector at the middle of the erased block
|
||||
//
|
||||
|
@ -31,7 +31,7 @@ Virtual interface Flash_Access defines the following basic functions:
|
||||
- read - reads from the flash memory to a data buffer.
|
||||
- write - writes to the flash memory from a data buffer.
|
||||
- erase - erases a sector of the flash memory.
|
||||
- erase_range - erases a range of sectors of the flash memory. The range length must be rounded to a multile of the sector size.
|
||||
- erase_range - erases a range of sectors of the flash memory. The range length must be rounded to a multiple of the sector size.
|
||||
- flash_size - returns the available flash memory (in bytes).
|
||||
- sector_size - returns the flash sector size.
|
||||
- flush - stores current state to the flash, if needed.
|
||||
|
@ -66,7 +66,7 @@ The signal integrity talking about in this chapter is mainly about is in time do
|
||||
- Voltage level switching needs time, and this is influenced by the pin load, connected capacitors and resistors, and other noises.
|
||||
- Clock signal rises and falls will be measured by the eMMC by its minimum input high voltage (VIH) and maximum input low voltage (VIL).
|
||||
- Input CMD and Data signals' rises and falls will be measured by the eMMC by its minimum input high voltage (VIH) and maximum input low voltage (VIL).
|
||||
- Output CMD and Data signals' rises and falls will be measured by the eMMC by its mininum output high voltage (VOH) and maximum output low voltage (VOL).
|
||||
- Output CMD and Data signals' rises and falls will be measured by the eMMC by its minimum output high voltage (VOH) and maximum output low voltage (VOL).
|
||||
|
||||
Therefore when using cables to connect your eMMC and the ESP chip, the time that a pin voltage level increases to the VIL / VOL, or the time that a pin voltage level decreases to the VIH / VOH will be longer.
|
||||
|
||||
|
@ -11,7 +11,7 @@ The flow of the example is as follows:
|
||||
|
||||
1. Initialize the SPI bus and configure the pins. In this example, VSPI peripheral is used. The pins chosen in this example correspond to IOMUX pins for the VSPI peripheral. If the pin assignment is changed, SPI driver will instead connect the peripheral to the pins using the GPIO Matrix.
|
||||
|
||||
2. Initialize the SPI flash chip. This involves creating a run-time object which describes the flash chip (`esp_flash_t`), probing the flash chip, and configuring it for the selected read mode. By default this example uses DIO mode, which only requires 4 pins (MOSI, MISO, SCLK, CS) but we strongly recommand to connect (or pull-up) the WP and HD pins. For modes such as QIO and QOUT, additional pins (WP/DQ2, HD/DQ3) must be connected.
|
||||
2. Initialize the SPI flash chip. This involves creating a run-time object which describes the flash chip (`esp_flash_t`), probing the flash chip, and configuring it for the selected read mode. By default this example uses DIO mode, which only requires 4 pins (MOSI, MISO, SCLK, CS) but we strongly recommend to connect (or pull-up) the WP and HD pins. For modes such as QIO and QOUT, additional pins (WP/DQ2, HD/DQ3) must be connected.
|
||||
|
||||
3. Register the entire area of the Flash chip as a *partition* (`esp_partition_t`). This allows other components (FATFS, SPIFFS, NVS, etc) to use the storage provided by the external flash chip.
|
||||
|
||||
@ -25,7 +25,7 @@ This example needs an SPI NOR Flash chip connected to the ESP32. The SPI Flash c
|
||||
|
||||
Use the following pin assignments:
|
||||
|
||||
#### Pin assigments
|
||||
#### Pin assignments
|
||||
|
||||
The GPIO pin numbers used to connect an external SPI flash chip can be customized.
|
||||
|
||||
|
@ -44,7 +44,7 @@ void app_main(void)
|
||||
assert(memcmp(store_data, read_data, sizeof(read_data)) == 0);
|
||||
ESP_LOGI(TAG, "Read data: %s", read_data);
|
||||
|
||||
// Erase the area where the data was written. Erase size shoud be a multiple of SPI_FLASH_SEC_SIZE
|
||||
// Erase the area where the data was written. Erase size should be a multiple of SPI_FLASH_SEC_SIZE
|
||||
// and also be SPI_FLASH_SEC_SIZE aligned
|
||||
ESP_ERROR_CHECK(esp_partition_erase_range(partition, 0, SPI_FLASH_SEC_SIZE));
|
||||
|
||||
|
@ -71,7 +71,7 @@ See [the document about pullup requirements](https://docs.espressif.com/projects
|
||||
|
||||
1. Set the target chip: `idf.py set-target TARGET` (replace TARGET with ESP32 chip series name)
|
||||
|
||||
1. Configure the example (`idf.py menuconfig` -> "Performance Benchmark Example Configuration") wheter you want to:
|
||||
1. Configure the example (`idf.py menuconfig` -> "Performance Benchmark Example Configuration") whether you want to:
|
||||
|
||||
- Test internal SPI flash
|
||||
- Raw access
|
||||
|
@ -63,7 +63,7 @@ void app_main(void)
|
||||
ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used);
|
||||
}
|
||||
|
||||
// Check consistency of reported partiton size info.
|
||||
// Check consistency of reported partition size info.
|
||||
if (used > total) {
|
||||
ESP_LOGW(TAG, "Number of used bytes cannot be larger than total. Performing SPIFFS_check().");
|
||||
ret = esp_spiffs_check(conf.partition_label);
|
||||
|
@ -736,7 +736,6 @@ components/spi_flash/spi_flash_chip_boya.c
|
||||
components/spi_flash/spi_flash_chip_issi.c
|
||||
components/tcp_transport/include/esp_transport_ws.h
|
||||
components/vfs/include/esp_vfs_common.h
|
||||
components/vfs/include/esp_vfs_eventfd.h
|
||||
components/wifi_provisioning/include/wifi_provisioning/scheme_ble.h
|
||||
components/wifi_provisioning/include/wifi_provisioning/scheme_console.h
|
||||
components/wifi_provisioning/include/wifi_provisioning/scheme_softap.h
|
||||
|
@ -1 +1 @@
|
||||
This is a file cointained in the generated filesystem image on the host and flashed to the ESP device
|
||||
This is a file contained in the generated filesystem image on the host and flashed to the ESP device
|
||||
|
@ -49,7 +49,7 @@ const char *spiffs_partition_name = "spiffs_ro";
|
||||
static wl_handle_t s_wl_handle = WL_INVALID_HANDLE;
|
||||
|
||||
// Data in each filesystem partition
|
||||
const char* cmp_string = "This is a file cointained in the generated filesystem image on the host and flashed to the ESP device";
|
||||
const char* cmp_string = "This is a file contained in the generated filesystem image on the host and flashed to the ESP device";
|
||||
#define CMP_STRING_LEN 102 // 101 + '\0'
|
||||
|
||||
static void fill_array_of_readonly_data_partitions(void)
|
||||
@ -162,7 +162,7 @@ TEST_CASE("Read-only partition - NVS API", "[nvs]")
|
||||
TEST_ASSERT_EQUAL(-2147483648, i32_val);
|
||||
nvs_close(handle);
|
||||
|
||||
// NVS partition flagged as read-only shouln't be possible to open in read-write mode
|
||||
// NVS partition flagged as read-only shouldn't be possible to open in read-write mode
|
||||
err = nvs_open_from_partition(nvs_partition_name, "storage", NVS_READWRITE, &handle);
|
||||
TEST_ASSERT_EQUAL(ESP_ERR_NOT_ALLOWED, err);
|
||||
nvs_close(handle);
|
||||
|
@ -5,7 +5,7 @@ set(requires
|
||||
vfs fatfs
|
||||
# sdmmc tests, themselves
|
||||
sdmmc_test_boards sdmmc_tests sdspi_tests
|
||||
# various console comamnds
|
||||
# various console commands
|
||||
cmd_unity cmd_system cmd_sdmmc
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user