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>
This commit is contained in:
Sasquatch 2025-07-27 17:09:11 +01:00 committed by GitHub
parent 60879fd298
commit 4a567c8d10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 4 deletions

View File

@ -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).
/

View File

@ -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",

View File

@ -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 {

View File

@ -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 {

View File

@ -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),