aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSasquatch <zajc3w@gmail.com>2025-07-27 17:09:11 +0100
committerGitHub <noreply@github.com>2025-07-27 12:09:11 -0400
commit4a567c8d1050d95ea22019545877715b842fa1b3 (patch)
tree0b0898ed6a93360a40f77ec9eeec93d19ab29344
parent60879fd298fe3b4f3dda63561e6a1c9bdc5ee9af (diff)
downloadkutter-4a567c8d1050d95ea22019545877715b842fa1b3.tar.gz
kutter-4a567c8d1050d95ea22019545877715b842fa1b3.tar.xz
kutter-4a567c8d1050d95ea22019545877715b842fa1b3.zip
spi_flash: FATFS fix missing long filenames support needed by flash-sdcard.sh (#6981)
enable long file support, needed for boards using swspi and long filenames for firmware like mks robin 1.1/1.2 added MKS robin nano 1.2 board with description what and why Signed-off-by: Leszek Zajac <zajc3w@gmail.com>
-rw-r--r--lib/fatfs/ffconf.h2
-rw-r--r--scripts/spi_flash/board_defs.py11
-rw-r--r--scripts/spi_flash/fatfs_api.h3
-rw-r--r--scripts/spi_flash/fatfs_lib.py3
-rw-r--r--scripts/spi_flash/spi_flash.py2
5 files changed, 17 insertions, 4 deletions
diff --git a/lib/fatfs/ffconf.h b/lib/fatfs/ffconf.h
index c47808bb..34522e7e 100644
--- a/lib/fatfs/ffconf.h
+++ b/lib/fatfs/ffconf.h
@@ -97,7 +97,7 @@
*/
-#define FF_USE_LFN 0
+#define FF_USE_LFN 1
#define FF_MAX_LFN 255
/* The FF_USE_LFN switches the support for LFN (long file name).
/
diff --git a/scripts/spi_flash/board_defs.py b/scripts/spi_flash/board_defs.py
index bc0c3d57..fe6ec9ab 100644
--- a/scripts/spi_flash/board_defs.py
+++ b/scripts/spi_flash/board_defs.py
@@ -50,6 +50,17 @@ BOARD_DEFS = {
"firmware_path": "Robin_e3.bin",
"current_firmware_path": "Robin_e3.cur"
},
+ # twotrees sapphire 5 v1.1 using mks robin nano 1.2 board
+ 'mks-robin-v12': {
+ 'mcu': "stm32f103xe",
+ 'spi_bus': "swspi",
+ 'spi_pins': "PC8,PD2,PC12",
+ 'cs_pin': "PC11",
+ 'skip_verify': True,
+ "conversion_script": "scripts/update_mks_robin.py",
+ "firmware_path": "ROBIN_NANO35.BIN",
+ "current_firmware_path": "ROBIN_NANO35.BIN"
+ },
'btt-octopus-f407-v1': {
'mcu': "stm32f407xx",
'spi_bus': "swspi",
diff --git a/scripts/spi_flash/fatfs_api.h b/scripts/spi_flash/fatfs_api.h
index 2400bc86..adbf7588 100644
--- a/scripts/spi_flash/fatfs_api.h
+++ b/scripts/spi_flash/fatfs_api.h
@@ -26,7 +26,8 @@ struct ff_file_info {
uint16_t modified_date;
uint16_t modified_time;
uint8_t attrs;
- char name[13];
+ char name_sfn[13]; // unused, just for compatibility with fatfs lib
+ char name[256];
};
struct ff_disk_info {
diff --git a/scripts/spi_flash/fatfs_lib.py b/scripts/spi_flash/fatfs_lib.py
index 2f27c083..ef92070a 100644
--- a/scripts/spi_flash/fatfs_lib.py
+++ b/scripts/spi_flash/fatfs_lib.py
@@ -32,7 +32,8 @@ FATFS_CDEFS = """
uint16_t modified_date;
uint16_t modified_time;
uint8_t attrs;
- char name[13];
+ char name_sfn[13];
+ char name[256];
};
struct ff_disk_info {
diff --git a/scripts/spi_flash/spi_flash.py b/scripts/spi_flash/spi_flash.py
index e45e0b7c..729dd2bb 100644
--- a/scripts/spi_flash/spi_flash.py
+++ b/scripts/spi_flash/spi_flash.py
@@ -380,7 +380,7 @@ class FatFS:
(fdate >> 5) & 0xF, fdate & 0x1F, ((fdate >> 9) & 0x7F) + 1980,
(ftime >> 11) & 0x1F, (ftime >> 5) & 0x3F, ftime & 0x1F)
return {
- 'name': self.ffi_main.string(finfo.name, 13),
+ 'name': self.ffi_main.string(finfo.name, 256),
'size': finfo.size,
'modified': dstr,
'is_dir': bool(finfo.attrs & 0x10),