update lfs pos to 3500
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef FLASH_MAX_UPGRADE_SIZE
|
#ifndef FLASH_MAX_UPGRADE_SIZE
|
||||||
//#define FLASH_MAX_UPGRADE_SIZE (512 * 1024)
|
//#define FLASH_MAX_UPGRADE_SIZE (512 * 1024)
|
||||||
#define FLASH_MAX_UPGRADE_SIZE (2200 * 1024)
|
#define FLASH_MAX_UPGRADE_SIZE (3200 * 1024)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FLASH_ERROR() do {} while(0)
|
#define FLASH_ERROR() do {} while(0)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#if HID_DFU_EN
|
#if HID_DFU_EN
|
||||||
|
|
||||||
#ifndef DFU_FLASH_MAX_UPGRADE_SIZE
|
#ifndef DFU_FLASH_MAX_UPGRADE_SIZE
|
||||||
#define DFU_FLASH_MAX_UPGRADE_SIZE (2200 * 1024)
|
#define DFU_FLASH_MAX_UPGRADE_SIZE (3200 * 1024)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DFU_FLASH_ERROR()
|
#define DFU_FLASH_ERROR()
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ lfs_file_t file;
|
|||||||
swlock_t flash_lock = SWLOCK_INITIAL_VALUE;
|
swlock_t flash_lock = SWLOCK_INITIAL_VALUE;
|
||||||
|
|
||||||
static rtos_qspi_flash_t qspi_flash_ctx_s;
|
static rtos_qspi_flash_t qspi_flash_ctx_s;
|
||||||
#define FLASH_CLKBLK CLKBLK_FLASHLIB
|
#define FLASH_CLKBLK CLKBLK_FLASHLIB
|
||||||
#ifndef FS_BASE_ADDR
|
#ifndef FS_BASE_ADDR
|
||||||
#define FS_BASE_ADDR (2500 * 1024)
|
#define FS_BASE_ADDR (3500 * 1024)
|
||||||
#endif
|
#endif
|
||||||
#define SECTOR_SIZE 4096
|
#define SECTOR_SIZE 4096
|
||||||
rtos_qspi_flash_t *qspi_flash_ctx = &qspi_flash_ctx_s;
|
rtos_qspi_flash_t *qspi_flash_ctx = &qspi_flash_ctx_s;
|
||||||
@@ -145,13 +145,13 @@ int lfs_format_all(void) {
|
|||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
return res; // Already failed and released lock, or blocked
|
return res; // Already failed and released lock, or blocked
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mount succeeded, but we want to format, so unmount first
|
// Mount succeeded, but we want to format, so unmount first
|
||||||
lfs_unmount(&lfs);
|
lfs_unmount(&lfs);
|
||||||
|
|
||||||
// 格式化整个LFS分区,清除所有数据
|
// 格式化整个LFS分区,清除所有数据
|
||||||
int err = lfs_format(&lfs, &cfg);
|
int err = lfs_format(&lfs, &cfg);
|
||||||
|
|
||||||
// Even if format fails, we must cleanup the session
|
// Even if format fails, we must cleanup the session
|
||||||
lfs_session_active = 0;
|
lfs_session_active = 0;
|
||||||
swlock_release(&flash_lock);
|
swlock_release(&flash_lock);
|
||||||
@@ -264,7 +264,7 @@ int lfs_create_directory(const char * dir_path)
|
|||||||
{
|
{
|
||||||
char temp_file[256];
|
char temp_file[256];
|
||||||
snprintf(temp_file, sizeof(temp_file), "%s/.dir", dir_path);
|
snprintf(temp_file, sizeof(temp_file), "%s/.dir", dir_path);
|
||||||
|
|
||||||
lfs_file_t file;
|
lfs_file_t file;
|
||||||
int result = lfs_file_open(&lfs, &file, temp_file, LFS_O_RDWR | LFS_O_CREAT);
|
int result = lfs_file_open(&lfs, &file, temp_file, LFS_O_RDWR | LFS_O_CREAT);
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#if HID_DFU_EN
|
#if HID_DFU_EN
|
||||||
|
|
||||||
#ifndef DFU_FLASH_MAX_UPGRADE_SIZE
|
#ifndef DFU_FLASH_MAX_UPGRADE_SIZE
|
||||||
#define DFU_FLASH_MAX_UPGRADE_SIZE (2200 * 1024)
|
#define DFU_FLASH_MAX_UPGRADE_SIZE (3200 * 1024)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DFU_FLASH_ERROR()
|
#define DFU_FLASH_ERROR()
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ swlock_t lfs_lock = SWLOCK_INITIAL_VALUE;
|
|||||||
static rtos_qspi_flash_t qspi_flash_ctx_s;
|
static rtos_qspi_flash_t qspi_flash_ctx_s;
|
||||||
#define FLASH_CLKBLK CLKBLK_FLASHLIB
|
#define FLASH_CLKBLK CLKBLK_FLASHLIB
|
||||||
#ifndef FS_BASE_ADDR
|
#ifndef FS_BASE_ADDR
|
||||||
#define FS_BASE_ADDR (2500 * 1024)
|
#define FS_BASE_ADDR (3500 * 1024)
|
||||||
#endif
|
#endif
|
||||||
#define SECTOR_SIZE 4096
|
#define SECTOR_SIZE 4096
|
||||||
rtos_qspi_flash_t *qspi_flash_ctx = &qspi_flash_ctx_s;
|
rtos_qspi_flash_t *qspi_flash_ctx = &qspi_flash_ctx_s;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#if HID_DFU_EN
|
#if HID_DFU_EN
|
||||||
|
|
||||||
#ifndef DFU_FLASH_MAX_UPGRADE_SIZE
|
#ifndef DFU_FLASH_MAX_UPGRADE_SIZE
|
||||||
#define DFU_FLASH_MAX_UPGRADE_SIZE (2200 * 1024)
|
#define DFU_FLASH_MAX_UPGRADE_SIZE (3200 * 1024)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DFU_FLASH_ERROR()
|
#define DFU_FLASH_ERROR()
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ swlock_t flash_lock = SWLOCK_INITIAL_VALUE;
|
|||||||
static rtos_qspi_flash_t qspi_flash_ctx_s;
|
static rtos_qspi_flash_t qspi_flash_ctx_s;
|
||||||
#define FLASH_CLKBLK CLKBLK_FLASHLIB
|
#define FLASH_CLKBLK CLKBLK_FLASHLIB
|
||||||
#ifndef FS_BASE_ADDR
|
#ifndef FS_BASE_ADDR
|
||||||
#define FS_BASE_ADDR (2500 * 1024)
|
#define FS_BASE_ADDR (3500 * 1024)
|
||||||
#endif
|
#endif
|
||||||
#define SECTOR_SIZE 4096
|
#define SECTOR_SIZE 4096
|
||||||
rtos_qspi_flash_t *qspi_flash_ctx = &qspi_flash_ctx_s;
|
rtos_qspi_flash_t *qspi_flash_ctx = &qspi_flash_ctx_s;
|
||||||
|
|||||||
Reference in New Issue
Block a user