Skip to content

Commit 6cbe7e3

Browse files
committed
fix: write function error in the flash
1 parent 70589e6 commit 6cbe7e3

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

src/SFUD/Seeed_SFUD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace fs {
5050
SEEED_FS_DEBUG("The status of f_mount : %d",status);
5151
SEEED_FS_DEBUG("more information about the status , you can view the FRESULT enum");
5252
if (status == FR_NO_FILESYSTEM){
53-
BYTE work[512]; /* Work area (larger is better for processing time) */
53+
BYTE work[SECTORSIZE]; /* Work area (larger is better for processing time) */
5454
FRESULT ret;
5555
ret = f_mkfs(_drv, FM_FAT, 0, work, sizeof(work));
5656
SEEED_FS_DEBUG("The status of f_mkfs : %d",ret);

src/SFUD/Seeed_SFUD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ typedef enum {
2828
FLASH_SPI
2929
} sfud_type_t;
3030

31-
#define SECTORSIZE 512
31+
#define SECTORSIZE 4096
3232

3333
typedef struct {
3434
uint8_t ssPin;

src/Seeed_FS.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,11 @@ void seeed_fs_log_debug(const char *file, const long line, const char *format, .
432432

433433
/* args point to the first variable parameter */
434434
va_start(args, format);
435-
436-
printf("[SEEED_FS](%s:%ld) ", file, line);
435+
Serial.print("[SEEED_FS] ");
436+
Serial.println(log_buf);
437437
/* must use vprintf to print */
438438
vsnprintf(log_buf, sizeof(log_buf), format, args);
439-
440-
printf("%s\n", log_buf);
439+
Serial.println(log_buf);
441440
va_end(args);
442441
}
443442

@@ -452,10 +451,10 @@ void seeed_fs_log_info(const char *format, ...) {
452451

453452
/* args point to the first variable parameter */
454453
va_start(args, format);
455-
printf("[SEEED_FS]");
454+
Serial.print("[SEEED_FS INFO] ");
456455
/* must use vprintf to print */
457456
vsnprintf(log_buf, sizeof(log_buf), format, args);
458-
printf("%s\n", log_buf);
457+
Serial.println(log_buf);
459458
va_end(args);
460459
}
461460

src/fatfs/ffconf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170

171171

172172
#define _MIN_SS 512
173-
#define _MAX_SS 512
173+
#define _MAX_SS 4096
174174
/* These options configure the range of sector size to be supported. (512, 1024,
175175
/ 2048 or 4096) Always set both 512 for most systems, all type of memory cards and
176176
/ harddisk. But a larger value may be required for on-board flash memory and some

0 commit comments

Comments
 (0)