Commit Graph

146 Commits

Author SHA1 Message Date
Andy Piper
c971bb6850 AP_Filesystem: allow for logical blocks bigger than physical blocks in littlefs.
optimize configured defaults on littlefs and address review comments
support lseek() in littlefs in a way that enables terrain to work
rename file and directory structures in littlefs
code in littlefs glue should be C++ rather than C
check for strdup failure on littlefs
2025-01-21 11:10:31 +11:00
Thomas Watson
90ac6bdc9e AP_Filesystem: lock littlefs between opendir and closedir
Avoids issues with (alleged) corruption if writes happen between.
2025-01-21 11:10:31 +11:00
Andy Piper
f22e1ff38b AP_Filesystem: support mutiple reads/writes in littlefs
improve performance by avoiding block validation on writes
2025-01-21 11:10:31 +11:00
Andy Piper
0c541b72fd AP_Filesystem: provide SITL implementation for littlefs 2025-01-21 11:10:31 +11:00
Andy Piper
8a992740f5 AP_Filesystem: add littlefs singleton for sync block use 2025-01-21 11:10:31 +11:00
Andy Piper
acf1b40dca AP_Filesystem: reduce metadata_max on W25N flash 2025-01-21 11:10:31 +11:00
Andy Piper
6390285598 AP_Filesystem: add littlefs based filesystem support
use correct read status for nor flash
implement format on littlefs
optimize device calls in littlefs flash usage
check for fileops allowed in littlefs
littlefs optimization and support for mtime
2025-01-21 11:10:31 +11:00
Iampete1
78d9e5a875 AP_Filesystem: Don't try and rename between backends 2025-01-05 13:33:42 +11:00
Thomas Watson
c57ac3b916 AP_Filesystem: FATFS: remove redundant delay expectations
The delays will be canceled on return by the EXPECT_DELAY_MS(3000)
destructor at the start of the function. The current behavior will
unexpectedly cancel delays from higher levels up the stack and is likely
not what was intended.
2024-12-31 11:20:21 +11:00
Simon Hancock
17f18f7fc5 AP_Filesystem: Add details of withdefaults query param to README 2024-12-15 08:43:42 +11:00
Eric Katzfey
7f4a20981a AP_Filesystem: Added conditional compiling to errno declarations. QURT HAL already has this in errno.h. 2024-11-17 20:38:25 +11:00
Richard Allen
9696081a85 AP_Filesystem: support port SITL to OpenBSD 2024-11-06 14:17:31 +11:00
Thomas Watson
380d8ca6fc AP_Filesystem: remove dependency on tmpnam
tmpnam is never linked and not necessary, and naming it/redefining it
introduces problems on platforms that do have a definition.
2024-09-24 22:49:18 +10:00
Peter Barker
a8cc071d62 AP_Filesystem: rearrange to put mission filesystem last
We're developing loops in our config files, move include to after base FILESYSTEM_READING/FILESYSTEM_WRITING defines
2024-09-24 11:59:13 +10:00
ARg
8204ff4d7c AP_Filesystem: fix esp32 function datatypes
Make them match the superclass and the header file.
2024-09-24 09:00:29 +10:00
muramura
e86d5e113f AP_Filesystem: BOOL for binary types 2024-07-26 20:12:05 +10:00
Andrew Tridgell
f8ce4183b8 AP_Filesystem: support QURT with posix filesystem
some features disabled
2024-07-12 15:56:48 +10:00
Andrew Tridgell
75ebf96adb AP_Filesystem: allow for filesystem with no dtype 2024-07-11 09:25:05 +10:00
Andrew Tridgell
c2e52af1e2 AP_Filesystem: make fgets() much more efficient
normally fgets is on a buffered FILE handle. For AP_Filesystem we use
an unbuffered file descriptor. This means we were reading one byte at
a time from the file

this uses lseek to make fgets() much more efficient by reading the max
buffer size at a time in the file
2024-07-11 09:24:38 +10:00
Andrew Tridgell
a241b13f45 AP_Filesystem: use NEW_NOTHROW for new(std::nothrow) 2024-06-04 09:20:21 +10:00
Thomas Watson
0ca37387be AP_Filesystem: guarantee load_file() data is null-terminated
Improves safety of use and clarity of users. Termination is not
included in the reported size to avoid changing user behavior or
misrepresenting the file contents.
2024-05-04 10:15:44 +10:00
Andrew Tridgell
8763084a9e AP_Filesystem: avoid decompressing in directory listing
this makes ROMFS much more efficient
2024-03-19 19:49:47 +11:00
Iampete1
8d7052887c AP_Filesystem: fixup AP_FILESYSTEM_FILE_WRITING_ENABLED comment 2024-03-12 08:52:38 +11:00
Peter Barker
2cb5f434fd AP_Filesystem: don't show directory entries for empty @ filesystems 2024-02-28 18:47:22 +11:00
Peter Barker
ac769014c4 AP_Filesystem: list virtual @SYS, @MISSION etc directories in /
Adds virtual directory entries for these virtual filesystems in /

RTL> ftp list
RTL> Listing /
 D @MISSION
 D @PARAM
 D @ROMFS
 D @SYS
 D APM
 D log
   V5_BT.dfu	10541
   bootlog.txt	297
   dataman	350216
   message-intervals-chan0.txt	7
Total size 352.60 kByte
ftp list @MISSION
RTL> Listing @MISSION
LIST: OP seq:7 sess:2 opcode:129 req_opcode:3 size:2 bc:0 ofs:0 plen=2 [2]
ftp list @ROMFS
RTL> Listing @ROMFS
   bootloader.bin	16448
   hwdef.dat	5743
   io_firmware.bin	40880
Total size 61.59 kByte

This PR also makes us *much* more lenient in what we accept for looking at virtual filesystems, so

ftp list @SYS
ftp list /@SYS
ftp list @SYS/
ftp list /@SYS/

should all work
2024-02-27 10:07:01 +11:00
Andy Piper
61dbc7a665 AP_Filesystem: remove unused variables 2024-02-22 14:40:55 +11:00
Iampete1
93d8de2834 AP_Filesystem: support full direcotry listing in ROMFS 2024-02-22 07:43:16 +11:00
Andrew Tridgell
3cb3e6feda AP_Filesystem: use gmtime_r() instead of gmtime()
using gmtime_r makes gmtime thread safe
2024-02-21 12:09:48 +11:00
Iampete1
c48759f4ba AP_Filesystem: crc32: Ensure checksum value is initialized 2024-02-15 07:36:39 +11:00
Peter Barker
3ef2139f4b AP_FileSystem: permit upload of fence/rally via ftp 2024-01-24 19:14:41 +11:00
Andrew Tridgell
c5f295e852 AP_Filesystem: allow for large file IOs
this allows for larger IOs on FATFS if the memoory is OK for DMA
2024-01-05 06:52:11 -08:00
Andrew Tridgell
867e9c6799 AP_RTC: fixed build on arm 2023-12-11 18:00:38 +11:00
Andrew Tridgell
9beea49c3c AP_Filesystem: implement stat() call for lua 2023-12-11 18:00:38 +11:00
Andrew Tridgell
c9c38300bd AP_Filesystem: expose APFS_FILE structure
allows scripting to set the fd for sendfile()
2023-12-11 18:00:38 +11:00
Andrew Tridgell
11ea2cf5c1 AP_Filesystem: added option @SYS/flash.bin
useful for speed tests
2023-12-11 18:00:38 +11:00
Andrew Tridgell
0f0aed66b7 AP_Filesystem: fixed fseek and open of directories 2023-12-11 18:00:38 +11:00
Iampete1
2c7e06dc5e AP_Filesystem: add crc 32 method 2023-12-05 11:03:58 +11:00
Mykhailo Kuznietsov
804d4446d1 AP_Filesystem: Fix some typos
Fixed some typos found in the code.
2023-10-12 18:30:42 +11:00
Peter Barker
ac2fea9766 AP_Filesystem: move AP_RTC::mktime to be ap_mktime
in preparation for AP_RTC_ENABLED
2023-06-27 11:25:11 +10:00
Peter Barker
6faa77993a AP_Filesystem: correct include problem
transitive include may fail depending on build options
2023-06-18 10:35:27 +10:00
Peter Barker
294b975335 AP_Filesystem: correct detection of feature AP_FILESYSTEM_FORMAT_ENABLED 2023-06-08 08:55:26 +10:00
Andrew Tridgell
2703928fb2 AP_Filesystem: enable filesystem format on all boards
this works in ChibiOS 21.xx
2023-06-06 15:19:00 +10:00
Andrew Tridgell
4946ce5431 HAL_ChibiOS: revert recent USB changes
these are causing some boards to crash on startup. Tested with a
QiotekZealotH743 which doesn't get out of setup_usb_strings()

once we have debugged this we can re-add the functionality
2023-06-03 16:50:30 +10:00
bugobliterator
414606ba31 AP_Filesystem: add support for blocking filesystem access 2023-05-31 18:40:17 +10:00
Peter Barker
a5c248d7a4 AP_Filesystem: enable posix compat functions if romfs compiled in
vast numbers of these otherwise:

/home/pbarker/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: lib/libArduCopter_libs.a(liolib.c.0.o): in function `read_all':
liolib.c:(.text.read_all+0x20): undefined reference to `apfs_fread'
/home/pbarker/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: lib/libArduCopter_libs.a(liolib.c.0.o): in function `read_line':
liolib.c:(.text.read_line+0x24): undefined reference to `apfs_getc'
/home/pbarker/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: lib/libArduCopter_libs.a(liolib.c.0.o): in function `io_fclose':
liolib.c:(.text.io_fclose+0xe): undefined reference to `apfs_fclose'
/home/pbarker/gcc/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: lib/libArduCopter_libs.a(liolib.c.0.o): in function `io_open':
2023-05-25 07:33:26 +10:00
Peter Barker
1c54d18672 AP_Filesystem: replace HAVE_FILESYSTEM_SUPPORT with backend defines 2023-05-17 09:40:39 +10:00
Peter Barker
26dd210be6 AP_Filesystem: remove unused header 2023-05-15 10:17:47 +10:00
Andrew Tridgell
cf79843661 AP_Filesystem: support file rename 2023-03-05 09:42:48 +11:00
Peter Barker
bee1f2785a AP_Filesystem: rename HAL_SCHEDULER_ENABLED to AP_SCHEDULER_ENABLED
there's AP_HAL::Scheduler which confuses this
2023-02-28 11:26:04 +11:00
Peter Barker
d633bd3f49 AP_Filesystem: add in-progress to formatsdcard process 2023-02-21 17:07:41 +11:00