Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add littlefs file system and update Sys.IO.FileSystem and stream #2911

Merged
merged 336 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 93 commits
Commits
Show all changes
336 commits
Select commit Hold shift + click to select a range
dc427e0
Add implementation for CreateDirectory in littlefs driver
josesimoes Apr 23, 2024
814925a
Experimenting with using forward slash for directory separator
josesimoes Apr 24, 2024
9c808fb
Add implementation for NativeFindFile
josesimoes Apr 24, 2024
efef209
Merge branch 'networkfusion-patch-fix-chibios' of https://github.com/…
josesimoes Apr 24, 2024
844c799
Remove common Sys.IO.drive info as that requires platform implementation
josesimoes Apr 26, 2024
b44bfd9
Remove unrelated change
josesimoes May 2, 2024
ed68140
Bump littlefs version
josesimoes May 2, 2024
6d25475
More fixes from code review
josesimoes May 3, 2024
9e6bf01
Fix open file by using proper path var
josesimoes May 3, 2024
d896336
Fix get attributes to properly handle DIR entries
josesimoes May 3, 2024
4a3479c
Fix create directory
josesimoes May 3, 2024
8c5bf32
Fix NativeFindFile::GetNext
josesimoes May 3, 2024
041b967
More fixes in dev container from code review
josesimoes May 3, 2024
9ee9543
Fix access to NativeFileInfo fields
josesimoes May 3, 2024
8ca5e6d
CreateFilenameString now joins path and file name
josesimoes May 3, 2024
ae06ea8
Fix FS_Driver::FindNext
josesimoes May 3, 2024
c2e2e89
Fix path construction for file file
josesimoes May 3, 2024
f683079
Extract function to normalize path
josesimoes May 3, 2024
d3ea183
NativeIO Delete now honours recursive parameter
josesimoes May 3, 2024
17780b3
Improve NormalizePath
josesimoes May 3, 2024
1cc933b
Improvements in SPI flash chip drivers
josesimoes May 3, 2024
d82e60f
Fix return type
josesimoes May 3, 2024
9368512
Rework path creation to simplify code
josesimoes May 3, 2024
1c74dd0
Fix return from SPI driver prog handler
josesimoes May 3, 2024
7fdb5cb
Add debug code to hal_lfs_prog_1
josesimoes May 3, 2024
4437b11
Revert wrong change with return size from program handlers
josesimoes May 6, 2024
e76950b
Another attempt to create directories with long paths
josesimoes May 6, 2024
6531bf3
Comment out lfsFileSystemReady and usage
josesimoes May 6, 2024
a888f55
Update assembly declarations
josesimoes May 7, 2024
5531570
Fix Driver::GetAttributes
josesimoes May 7, 2024
eb064bd
Fix Driver::SetAttributes
josesimoes May 7, 2024
8549544
NormalizePath now removes trailing slash
josesimoes May 7, 2024
591edd7
Fix Driver::Move to return false on dir not empty
josesimoes May 7, 2024
924b256
Fix CLR_RT_FindFile::CreateInstance
josesimoes May 7, 2024
4d2cafc
Disable inline files in littlefs configuration
josesimoes May 7, 2024
4ba5e60
Code style fixes
josesimoes May 7, 2024
06b7fb2
Rewrite QSPI_Write
josesimoes May 8, 2024
c6b7bb0
Add implementation of QSPI driver using ChibiOS HAL
josesimoes May 8, 2024
5c7ecb0
Rename data buffer for LFS_SPI1
josesimoes May 8, 2024
5c41ca3
Fix write size parameter
josesimoes May 8, 2024
45d27ad
Improve write handlers to deal with full page write
josesimoes May 8, 2024
655c6a6
Fix WSPI_WaitOnBusy
josesimoes May 8, 2024
b3d0eb9
Code clean-up
josesimoes May 8, 2024
b9ce03b
Create directory doesn't add leading slash anymore
josesimoes May 8, 2024
9823eb3
More changes in default config
josesimoes May 8, 2024
7032fa8
Fix compiler error
josesimoes May 8, 2024
9451035
Change config for LFS1
josesimoes May 8, 2024
5090d7d
Fix file attribute creation
josesimoes May 9, 2024
4d68446
Fix System.IO.FileSystem vcxproj
josesimoes May 9, 2024
954925b
Improve vcxproj files to include additional incudes from nf.props file
josesimoes May 9, 2024
d7aa51b
Include System.IO.FileSystem and littlfs in nanoCLR virtual device
josesimoes May 9, 2024
48e49a8
Fix several declarations
josesimoes May 9, 2024
0c51f8e
Fix declarations and formatting
josesimoes May 9, 2024
7cf7845
Remove unused include
josesimoes May 9, 2024
dce4a2d
Clean up includes
josesimoes May 9, 2024
bbe19df
Add debug helper code
josesimoes May 9, 2024
c5538f0
Remove unused include
josesimoes May 9, 2024
6c7039e
Fix include order
josesimoes May 9, 2024
4d1ef9c
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes May 9, 2024
045bc4e
Fix declaration
josesimoes May 9, 2024
2c2e449
Add remaining implementation of littlefs for nanoCLR
josesimoes May 10, 2024
d0a1809
Change type of file system handles to support both 32 and 64 bits arch
josesimoes May 10, 2024
c27515f
Remove unused usings
josesimoes May 10, 2024
8330f54
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes May 13, 2024
01f262f
Fix issues with declarations
josesimoes May 13, 2024
fc251ef
Remove CLR_RT_FindFile
josesimoes May 13, 2024
4ba2394
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes May 14, 2024
91b4d3c
Replace SPIFFs with littlefs in ORGPALX
josesimoes May 14, 2024
7ffbe58
Change QSPI driver back to nano QSPI version
josesimoes May 14, 2024
0edf7d1
More fixes in declarations and by ref params
josesimoes May 15, 2024
50b7540
Clean-up code and fix code style
josesimoes May 15, 2024
ae593ff
Don't create root dir at format
josesimoes May 15, 2024
60132da
More clean-up
josesimoes May 15, 2024
247120c
Fix return flow on QSPI read
josesimoes May 15, 2024
f35d812
Move temp buffer for write check to global memory
josesimoes May 15, 2024
469d3c2
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes May 15, 2024
24b420a
Remove unused code
josesimoes May 16, 2024
aea599e
Fix command to erase sub-sector
josesimoes May 16, 2024
33d9c05
Fix multiple locals inits
josesimoes May 16, 2024
5c03c0b
Fix buffer size
josesimoes May 16, 2024
693358f
Code style fix
josesimoes May 16, 2024
53ad066
Revert littlefs config to use single byte for read and program
josesimoes May 16, 2024
21b6083
Remove unused commands
josesimoes May 16, 2024
90c80f7
Remove unnecessary DSB instruction
josesimoes May 16, 2024
103e1cf
Implement littlefs sync handler
josesimoes May 16, 2024
18a7811
Add sleep to wait for W25Q128 to become available
josesimoes May 16, 2024
cc4f082
Remove unused declarations
josesimoes May 16, 2024
5755b03
Migrating littlefs implementation from ORGPALX
josesimoes May 16, 2024
e7d35cd
Adjust block storage
josesimoes May 16, 2024
3e5a2e1
Add check for existing index in fs
josesimoes May 16, 2024
76992d1
Rename directory for coherence with original name
josesimoes May 17, 2024
097b7c6
Fix case in path
josesimoes May 17, 2024
b405681
Move declaration of g_LITTLEFS_FILE_SYSTEM_DriverInterface to driver …
josesimoes May 17, 2024
e0513f4
Fix FS inits for ORGPALX
josesimoes May 17, 2024
722ba3b
Add missing external declaration for FS interfaces
josesimoes May 17, 2024
7403363
Fix CMake to add include to fat FS path
josesimoes May 23, 2024
2b55663
Fix GetSizeInfo for littlefs
josesimoes May 23, 2024
b0a68aa
Fix declaration of some APIs
josesimoes May 23, 2024
c8045f6
Add correct implementation for ChibiOS GetDrivesNative
josesimoes May 23, 2024
e7ffd9b
Fix declaration of FS_MountVolume
josesimoes May 23, 2024
028fb07
Fix declaration for GetVolumeLabel
josesimoes May 23, 2024
7524339
InitializeVolume now take path parameter
josesimoes May 23, 2024
7b08e74
Add FindVolume and GetNextFreeVolumeId
josesimoes May 23, 2024
ba91f8e
Rework implementation of FS_MountVolume and UnMountVolume
josesimoes May 23, 2024
e21f98e
Add FAT FS driver for ChibiOS
josesimoes May 23, 2024
91df29d
Fix FS_AddVolumes for ChibiOS
josesimoes May 23, 2024
a35f507
Migrate USB MSD and SDCard code
josesimoes May 23, 2024
3ddb347
Enable back SDCard support
josesimoes May 23, 2024
2a6bef2
Add back m_label item to FileSystemVolum struct
josesimoes May 23, 2024
a425fd6
Update assembly declaration
josesimoes May 24, 2024
b9cbd47
Implement FS_MountRemovableVolumes in ORGPAL
josesimoes May 24, 2024
3c59a60
Add implementation for Format in littlefs anf FATFS drivers
josesimoes May 24, 2024
67b4ca5
Remove static declaration to allow calling it from target level code
josesimoes May 24, 2024
ffa5183
Remove unused code
josesimoes May 24, 2024
7fdda27
Fix Format declaration for netcore
josesimoes May 24, 2024
08eb009
Fix implementation for Format and GetAttributes
josesimoes May 24, 2024
bab76e3
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes May 24, 2024
2ac97c9
AddVolume now returns true if the volume already exists
josesimoes May 24, 2024
8e3c5fd
Fixes in NativeGetChildren
josesimoes May 24, 2024
a9e4ec5
Better handling of call to Move in FS driver
josesimoes May 24, 2024
1a14035
Global fix for create directory in all drivers
josesimoes May 24, 2024
0a76c32
Various fixes in FAFFS driver
josesimoes May 27, 2024
3e49144
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes May 27, 2024
f276213
Fix init SDCard with real default config
josesimoes May 28, 2024
057c2d1
Remove cache invalidate from FATFS driver
josesimoes May 28, 2024
562cd8b
Fix SetLength
josesimoes May 28, 2024
6c75827
Bringing FATFS disk IO in sync with ChibiOS implementation
josesimoes May 28, 2024
16d21bb
Change FatFS config to use LFN 2 to better use memory
josesimoes May 29, 2024
b54e17f
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes May 31, 2024
b701250
FATFS driver now implements internal driver
josesimoes Jun 3, 2024
acb0fd4
Add struct to map assigned FAT volumes
josesimoes Jun 3, 2024
f1adf30
Write and SetLength now sync file to media
josesimoes Jun 3, 2024
64eeeec
GetSizeInfo now returns -1 for total and free size
josesimoes Jun 3, 2024
bc47fd6
Remove assert as this call can fail on occasions
josesimoes Jun 3, 2024
4b80f32
Config MPU for cache free memory
josesimoes Jun 3, 2024
2f552b2
Clean-up code in read and write handlers
josesimoes Jun 3, 2024
eb9c4c6
FATFS array is now in nocache memory
josesimoes Jun 3, 2024
58cac2d
Porting last changes to ORGPALX
josesimoes Jun 3, 2024
5140e2b
Fix GetAttributes to properly deal with home directory
josesimoes Jun 4, 2024
2f460f4
Migration to W25Q512 chip
josesimoes Jun 4, 2024
617282d
Fix FatFS config to deal with different volume configs
josesimoes Jun 4, 2024
2ec8242
Fix define checks
josesimoes Jun 4, 2024
29f33f4
More fixes in FatFS configuration
josesimoes Jun 4, 2024
90e1c97
Remove unused define
josesimoes Jun 4, 2024
2cdaa89
Adjust FatFS config for ST_STM32F769I_DISCOVERY
josesimoes Jun 4, 2024
e68b27d
More fixes in FatFS and related for target without storage
josesimoes Jun 4, 2024
587d954
Fix FielStream stubs
josesimoes Jun 4, 2024
357fee0
Remove unused file
josesimoes Jun 4, 2024
004edc4
Fix compiler def usage
josesimoes Jun 4, 2024
64a8fe7
Fix File System stubs
josesimoes Jun 4, 2024
cdf813e
Add missing unmount
josesimoes Jun 4, 2024
62a7de6
Add implementation to mount USB MSD
josesimoes Jun 4, 2024
4b05839
ORGPALX littlefs config now uses wear levelling
josesimoes Jun 4, 2024
ae8a9f5
Move littlefs buffers to nocache region
josesimoes Jun 4, 2024
879924c
Enable nocache region for ORGPAL targets
josesimoes Jun 4, 2024
4dd7751
Move all littlefs variables to nocache region
josesimoes Jun 4, 2024
058e2ff
Add delay to wait for AT25SF641to become fully operational
josesimoes Jun 4, 2024
b80eca9
Remove unused command
josesimoes Jun 4, 2024
ba7853c
Fix comment
josesimoes Jun 5, 2024
a6e792e
Fix project property
josesimoes Jun 5, 2024
34cbfdb
Update STM cube packages
josesimoes Jun 5, 2024
59cbce2
Rename flash commands and memory organization
josesimoes Jun 5, 2024
979a039
Fix GetSizeInfo for littlefs
josesimoes Jun 6, 2024
8796206
Fix GetAttributes for littlefs
josesimoes Jun 6, 2024
7ad546a
Fix ChibiOS cache definition for OSGPALX
josesimoes Jun 6, 2024
0c522d7
Buffers for littlefs are no longer in no cache region
josesimoes Jun 6, 2024
65b8ca0
QSPI_Write now used simple prog instruction
josesimoes Jun 6, 2024
1e951f0
Setting up MPU for QSPI region
josesimoes Jun 6, 2024
3390740
Improvement in workaround for unwanted busy flag in QSPI when reading
josesimoes Jun 6, 2024
6c2ecbd
Remove unnecessary call to watchdog reset
josesimoes Jun 6, 2024
5b5ffbc
Add CORTEX to STM32F7 Cube package
josesimoes Jun 6, 2024
70f5433
littlefs common structs and vars are not longer stored in no cache re…
josesimoes Jun 6, 2024
81dcdc8
littlefs driver now using own buffers to allow setting those from tar…
josesimoes Jun 6, 2024
c8bd0a3
littlefs sync handlers are now implemented in ORGPAL3
josesimoes Jun 6, 2024
d1e12bf
Remove unused comments
josesimoes Jun 6, 2024
77f8025
Fix ChibiOS HAL config for no cache RAM
josesimoes Jun 6, 2024
d23079c
Add target provided buffers for littlefs driver
josesimoes Jun 6, 2024
5c2a9cc
Remove unnecessary call to watchdog reset
josesimoes Jun 6, 2024
5a0f9bf
Port changes from littlefs driver in ORGPALX
josesimoes Jun 6, 2024
e3aa9a8
Fix unmount volume for FATFS
josesimoes Jun 6, 2024
8ababce
Rename buffers for FATFS driver for consistency
josesimoes Jun 6, 2024
5d8253d
FATFS_FileHandle are now allocated from it's own memory pool
josesimoes Jun 6, 2024
c4bb769
Clear buffers processing file names and paths
josesimoes Jun 7, 2024
c0846ff
Add code to change drive on all handlers taking a volumeID
josesimoes Jun 7, 2024
b91fec8
Fix parameter for storage events
josesimoes Jun 7, 2024
903b70a
Update declaration of sys io filesystem
josesimoes Jun 7, 2024
bf9387c
Add implementation for FindVolume
josesimoes Jun 7, 2024
a3190e0
Fix implementation for DriveInfo in ChibiOS implementation
josesimoes Jun 7, 2024
d108fe2
Update declaration for sys io filesystem
josesimoes Jun 7, 2024
f64e0c9
Work CI-CD
josesimoes Jun 7, 2024
e46cf55
Add missing header file
josesimoes Jun 7, 2024
3bf220c
Update declaration of sys io filesystem
josesimoes Jun 7, 2024
8594574
Add implementation for Format at file system library
josesimoes Jun 7, 2024
a078263
Update declaration
josesimoes Jun 7, 2024
d520294
System_IO_DriveInfo is now common
josesimoes Jun 7, 2024
4585282
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes Jun 7, 2024
f6452e8
Fix sys io file system vcxp project
josesimoes Jun 7, 2024
08697e4
Fix declarations of littlefs driver in netcore target
josesimoes Jun 7, 2024
a3f1535
Fix build job for AZDO
josesimoes Jun 7, 2024
d792c7a
Fix build of nanoCLR WIN32 and netcore solutions
josesimoes Jun 7, 2024
ed5ebb0
Add implementation of DriveInfo::Refresh
josesimoes Jun 7, 2024
59a11ba
Add back nuget restore for nanoCLR
josesimoes Jun 7, 2024
87b4015
Add header file to all platforms
josesimoes Jun 7, 2024
ffea6bb
Fix implementation of DriveInfo::Refresh
josesimoes Jun 7, 2024
45e512d
Remove unused files from ChibiOS
josesimoes Jun 7, 2024
7c5a5af
First pass migrating ESP32 to new file system
josesimoes Jun 7, 2024
33a0646
Improve comment
josesimoes Jun 7, 2024
d19722d
Another stab at fixing nanoCLR build in AZDO
josesimoes Jun 7, 2024
1dc560a
Fix NXP build on AZDO
josesimoes Jun 7, 2024
d319f9b
Comment wrong include
josesimoes Jun 7, 2024
d3e211f
More fixes to AZDO build
josesimoes Jun 7, 2024
0a4e50a
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes Jun 12, 2024
9e6dec4
Fix forced inclusion of Sys.IO.FileSystem for NXP
josesimoes Jun 12, 2024
25d5093
Comment more fatfs stuff in ESP32 targets
josesimoes Jun 12, 2024
98df075
Fix build for NXP
josesimoes Jun 12, 2024
b4bc9bf
Fix declaration for ESP32 build
josesimoes Jun 12, 2024
5e7ed27
Include file system header is now dependent of build option
josesimoes Jun 12, 2024
556b68f
Fix dummy declarations
josesimoes Jun 12, 2024
945d9de
Update declaration of FS_MountVolume
josesimoes Jun 12, 2024
146664e
Working on ESP32 FATFS driver
josesimoes Jun 12, 2024
a9dc8b0
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes Jun 13, 2024
327c588
Update SDMMC inits following IDF 5.x
josesimoes Jun 14, 2024
3c1beaa
Fix line end
josesimoes Jun 25, 2024
beb74b4
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes Jun 25, 2024
19c48e0
Don't change the default sdcard host flags and clock anymore
josesimoes Jun 27, 2024
dc5c187
Fix formatting
josesimoes Jun 27, 2024
d7ea326
Add littlefs as IDF component
josesimoes Jun 28, 2024
2ab120a
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes Jun 28, 2024
cd0b415
Normalize line endings
josesimoes Jun 28, 2024
1e3fca3
Fix merge
josesimoes Jun 28, 2024
e5760f0
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes Jun 28, 2024
1a79655
Fix wrong merge
josesimoes Jun 28, 2024
c9c917c
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes Jun 28, 2024
d4fd381
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes Jun 28, 2024
8733042
Fix dev containers versions
josesimoes Jun 28, 2024
ea1986c
Fix index in file system driver
josesimoes Jun 28, 2024
685c77a
Rework inclusion of littlefs CMake option
josesimoes Jun 28, 2024
68789da
Adding littlefs driver
josesimoes Jul 1, 2024
806d478
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes Jul 15, 2024
a5ef29a
Fix call in release build
josesimoes Jul 15, 2024
acaf6c3
Merge branch 'main' of https://github.com/nanoframework/nf-interprete…
josesimoes Jul 22, 2024
2d003cc
Fix FS_Driver::Delete to properly handle files and directories (recur…
josesimoes Jul 22, 2024
3074545
Fix FS_Driver::FindNext
josesimoes Jul 22, 2024
10e63b1
Fix FS_Driver::GetAttributes
josesimoes Jul 22, 2024
9eee366
Fix FS_Driver::FindNext
josesimoes Jul 22, 2024
cde34d9
Fix FS_Driver::FindOpen and FindNext
josesimoes Jul 22, 2024
3dc3b6b
Fix NativeGetChildren to handle situations when volume isn't' found
josesimoes Jul 22, 2024
4c8a528
Remove unused code
josesimoes Jul 23, 2024
3a49985
Removing unnecessary checks
josesimoes Jul 23, 2024
340d9b1
Final clean-up on sys io filesystem
josesimoes Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/All/Dockerfile.All
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-all:v2.45
FROM ghcr.io/nanoframework/dev-container-all:v2.47
4 changes: 2 additions & 2 deletions .devcontainer/All/Dockerfile.All.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ RUN git clone --branch nf-build https://github.com/nanoframework/STM32CubeL4.git
RUN git clone --branch v6.4.0_rel --recursive https://github.com/eclipse-threadx/threadx.git --depth 1 ./sources/AzureRTOS \
&& git clone --branch v6.3.0_rel --recursive https://github.com/eclipse-threadx/netxduo.git --depth 1 ./sources/NetxDuo

# Clone dependent repos (mbedtls, fatfs and spiffs)
# Clone dependent repos (mbedtls, fatfs and littlefs)
RUN git clone --branch mbedtls-2.28.5 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
&& git clone --branch R0.15 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \
&& git clone --branch nf-build https://github.com/nanoframework/spiffs.git --depth 1 ./sources/spiffs
&& git clone --branch v2.9.3, https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs
josesimoes marked this conversation as resolved.
Show resolved Hide resolved

# Clone FreeRTOS and what is needed for ESP32
RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-Kernel.git --depth 1 ./sources/FreeRTOS \
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/All/scripts/git-pull-repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd /sources/CMSIS_5
git pull origin 5.5.1
cd /sources/lwip
git pull origin STABLE-2_1_3_RELEASE
cd /sources/spiffs
cd /sources/littlefs
git pull origin nf-build
josesimoes marked this conversation as resolved.
Show resolved Hide resolved
cd /sources/SimpleLinkCC32
git pull origin 4.10.00.07
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/AzureRTOS/Dockerfile.AzureRTOS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-azure-rtos:v1.26
FROM ghcr.io/nanoframework/dev-container-azure-rtos:v1.28
4 changes: 2 additions & 2 deletions .devcontainer/AzureRTOS/Dockerfile.AzureRTOS.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ RUN git clone --branch nf-build https://github.com/nanoframework/STM32CubeL4.git
RUN git clone --branch v6.4.0_rel --recursive https://github.com/eclipse-threadx/threadx.git --depth 1 ./sources/AzureRTOS \
&& git clone --branch v6.4.0_rel --recursive https://github.com/eclipse-threadx/netxduo.git --depth 1 ./sources/NetxDuo

# Clone dependent repos (mbedtls, fatfs and spiffs)
# Clone dependent repos (mbedtls, fatfs and littlefs)
RUN git clone --branch mbedtls-2.28.5 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
&& git clone --branch R0.15 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \
&& git clone --branch nf-build https://github.com/nanoframework/spiffs.git --depth 1 ./sources/spiffs
&& git clone --branch v2.9.3 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs

# set gcc location
ARG TMP_GCC_PATH=/usr/local/bin/gcc
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/ChibiOS/Dockerfile.ChibiOS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-chibios:v1.27
FROM ghcr.io/nanoframework/dev-container-chibios:v1.30
4 changes: 2 additions & 2 deletions .devcontainer/ChibiOS/Dockerfile.ChibiOS.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ RUN git clone --branch nf-build https://github.com/nanoframework/STM32CubeL4.git
&& git clone --branch nf-build https://github.com/nanoframework/STM32CubeH7.git --depth 1 ./sources/STM32CubeH7 \
&& git clone --branch chibios-21.11.x https://github.com/ChibiOS/ChibiOS-Contrib.git --depth 1 ./sources/ChibiOs-Contrib

# Clone dependent repos (mbedtls, fatfs and spiffs etc.)
# Clone dependent repos (mbedtls, fatfs and littlefs etc.)
RUN git clone --branch mbedtls-2.28.5 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
&& git clone --branch R0.15 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \
&& git clone --branch nf-build https://github.com/nanoframework/spiffs.git --depth 1 ./sources/spiffs \
&& git clone --branch v2.9.3 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs \
&& git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip

# set gcc location
Expand Down
5 changes: 2 additions & 3 deletions .devcontainer/TI/Dockerfile.TI.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ RUN wget $CMAKE_SCRIPT \
&& /tmp/dc-downloads/cmake-install.sh --skip-license --prefix=/tmp/dc-extracted/cmake \
&& rm /tmp/dc-downloads/cmake-install.sh

# This is TI XDC tools for linux. Check all versions here: https://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/index.html
# This is TI XDC tools for linux. Cheack all versions here: https://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/index.html
josesimoes marked this conversation as resolved.
Show resolved Hide resolved
ARG TI_TOOL_URL=https://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/rtsc/3_62_00_08/exports/xdccore/xdctools_3_62_00_08_core_linux.zip
RUN mkdir -p /tmp/dc-extracted/titools \
&& curl -o /tmp/dc-downloads/titools.zip $TI_TOOL_URL -L \
&& unzip -d /tmp/dc-extracted/titools /tmp/dc-downloads/titools.zip


FROM ubuntu:latest AS devcontainer

# Avoid warnings by switching to noninteractive
Expand Down Expand Up @@ -61,7 +60,7 @@ RUN mkdir -p /usr/local/bin/gcc \
# Clone what is needed for TI
RUN git clone --branch 4.10.00.07 https://github.com/nanoframework/SimpleLink_CC32xx_SDK.git --depth 1 ./sources/SimpleLinkCC32 \
# you can't use the nanoFramework repository as it's Windows only
# && git clone --branch 3.62.01.15 https://github.com/nanoframework/TI_XDCTools.git --depth 1 ./sources/TI_XDCTools \
# && git clone --branch 3.61.00.16 https://github.com/nanoframework/TI_XDCTools.git --depth 1 ./sources/TI_XDCTools \
josesimoes marked this conversation as resolved.
Show resolved Hide resolved
&& git clone --branch 5.40.00.40 https://github.com/nanoframework/SimpleLink_CC13xx_26xx_SDK.git --depth 1 ./sources/SimpleLinkCC13 \
&& git clone --branch 1.10.0 https://github.com/nanoframework/TI_SysConfig.git --depth 1 ./sources/TI_SysConfig \
&& chmod +x ./sources/TI_SysConfig/sysconfig_cli.sh
Expand Down
52 changes: 52 additions & 0 deletions CMake/Modules/FindLITTLEFS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
#

include(FetchContent)
FetchContent_GetProperties(littlefs)

# List of the required include paths
list(APPEND littlefs_INCLUDE_DIRS
${littlefs_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/targets/${RTOS}/_littlefs)

set(src_LITTLEFS

lfs.c
lfs_util.c

# HAL implementation specific to a platform
# has to be included at platform level
hal_littlefs.c

target_littlefs.c
)

foreach(SRC_FILE ${src_LITTLEFS})

set(LITTLEFS_SRC_FILE SRC_FILE -NOTFOUND)

find_file(LITTLEFS_SRC_FILE ${SRC_FILE}
PATHS

${littlefs_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/targets/${RTOS}/_littlefs
${TARGET_BASE_LOCATION}

CMAKE_FIND_ROOT_PATH_BOTH
)

if (BUILD_VERBOSE)
message("${SRC_FILE} >> ${LITTLEFS_SRC_FILE}")
endif()

list(APPEND littlefs_SOURCES ${LITTLEFS_SRC_FILE})
josesimoes marked this conversation as resolved.
Show resolved Hide resolved

endforeach()

set_source_files_properties(${littlefs_SOURCE_DIR}/lfs.c PROPERTIES COMPILE_FLAGS -Wno-shadow)

include(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(littlefs DEFAULT_MSG littlefs_INCLUDE_DIRS littlefs_SOURCES)
150 changes: 77 additions & 73 deletions CMake/Modules/FindNF_CoreCLR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ list(APPEND NF_CoreCLR_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/PAL/Include)
list(APPEND NF_CoreCLR_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/CLR/CorLib)

# CLR startup
list(APPEND NF_CoreCLR_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/CLR/Startup)
list(APPEND NF_CoreCLR_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/CLR/Startup)

# others
list(APPEND NF_CoreCLR_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/targets/${RTOS}/_include)
Expand Down Expand Up @@ -134,7 +134,7 @@ set(NF_CoreCLR_SRCS
nf_rt_native_nanoFramework_Runtime_Native_Power.cpp
nf_rt_native_nanoFramework_Runtime_Native_Rtc_stubs.cpp
nf_rt_native_System_Environment.cpp

# Core stubs
RPC_stub.cpp

Expand All @@ -151,9 +151,10 @@ set(NF_CoreCLR_SRCS
nanoHAL_Time.cpp
nanoHAL_Watchdog.c
nanoHAL_SystemEvents.c

# PAL
nanoPAL_Events.cpp
nanoPAL_FileSystem_stubs.cpp
nanoPAL_NativeDouble.cpp
nanoPAL_Network_stubs.cpp
nanoPAL_PerformanceCounters_stubs.cpp
Expand Down Expand Up @@ -192,15 +193,15 @@ if(NF_FEATURE_SUPPORT_REFLECTION)

# should we include binary serialization support?
if(NF_FEATURE_BINARY_SERIALIZATION)
list(APPEND NF_CoreCLR_SRCS BinaryFormatter.cpp)
list(APPEND NF_CoreCLR_SRCS BinaryFormatter.cpp)
else()
# binary serialization stubs because we're not supporting reflection
list(APPEND NF_CoreCLR_SRCS BinaryFormatter_stub.cpp)
list(APPEND NF_CoreCLR_SRCS BinaryFormatter_stub.cpp)
endif()

else()
# binary serialization stubs because we're not supporting reflection
list(APPEND NF_CoreCLR_SRCS BinaryFormatter_stub.cpp)
list(APPEND NF_CoreCLR_SRCS BinaryFormatter_stub.cpp)
endif()

# include Collection support files depending on build option
Expand All @@ -209,7 +210,14 @@ if(API_nanoFramework.System.Collections)
list(APPEND NF_CoreCLR_SRCS CLR_RT_HeapBlock_Stack.cpp)
endif()

# need a conditional include because of ESP32 building network as a library
# file system support?
if(API_System.IO.FileSystem)
list(APPEND NF_CoreCLR_SRCS FileStream.cpp)
else()
list(APPEND NF_CoreCLR_SRCS FileStream_stub.cpp)
endif()

# need a conditional include because of ESP32 building network as a library
if(NOT USE_SECURITY_MBEDTLS_OPTION)
list(APPEND NF_CoreCLR_SRCS base64.c)
endif()
Expand All @@ -229,103 +237,100 @@ if(EXISTS ${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/nanoFramework.Runtime.Native/
endif()

foreach(SRC_FILE ${NF_CoreCLR_SRCS})

set(NF_CoreCLR_SRC_FILE SRC_FILE-NOTFOUND)

find_file(NF_CoreCLR_SRC_FILE ${SRC_FILE}
PATHS

# Core
${CMAKE_SOURCE_DIR}/src/CLR/Core

# CoreLib
${CMAKE_SOURCE_DIR}/src/CLR/CorLib

# CLR startup
${CMAKE_SOURCE_DIR}/src/CLR/Startup

# Runtime.Native
${CMAKE_SOURCE_DIR}/src/nanoFramework.Runtime.Native

# Core stubs
${CMAKE_SOURCE_DIR}/src/CLR/Core/Hardware
${CMAKE_SOURCE_DIR}/src/CLR/Core/InterruptHandler
${CMAKE_SOURCE_DIR}/src/CLR/Core/NativeEventDispatcher
${CMAKE_SOURCE_DIR}/src/CLR/Core/RPC
${CMAKE_SOURCE_DIR}/src/CLR/Core/Serialization

# CLR stubs
${CMAKE_SOURCE_DIR}/src/CLR/Debugger
${CMAKE_SOURCE_DIR}/src/CLR/Diagnostics
${CMAKE_SOURCE_DIR}/src/CLR/Messaging

# Helpers
${CMAKE_SOURCE_DIR}/src/CLR/Helpers/nanoprintf
${CMAKE_SOURCE_DIR}/src/CLR/Helpers/NanoRingBuffer
${CMAKE_SOURCE_DIR}/src/CLR/Helpers/Base64
${CMAKE_SOURCE_DIR}/src/CLR/Diagnostics

# HAL
${CMAKE_SOURCE_DIR}/src/HAL

# PAL
${CMAKE_SOURCE_DIR}/src/PAL
${CMAKE_SOURCE_DIR}/src/PAL/BlockStorage
${CMAKE_SOURCE_DIR}/src/PAL/Double
${CMAKE_SOURCE_DIR}/src/PAL/Events

# PAL stubs
${CMAKE_SOURCE_DIR}/src/PAL/AsyncProcCall
${CMAKE_SOURCE_DIR}/src/PAL/COM
${CMAKE_SOURCE_DIR}/src/PAL/Profiler

# platform specific implementations
${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/nanoFramework.Runtime.Native

# target
${TARGET_BASE_LOCATION}
PATHS

# Core
${CMAKE_SOURCE_DIR}/src/CLR/Core

# CoreLib
${CMAKE_SOURCE_DIR}/src/CLR/CorLib

# CLR startup
${CMAKE_SOURCE_DIR}/src/CLR/Startup

# Runtime.Native
${CMAKE_SOURCE_DIR}/src/nanoFramework.Runtime.Native

# Core stubs
${CMAKE_SOURCE_DIR}/src/CLR/Core/Hardware
${CMAKE_SOURCE_DIR}/src/CLR/Core/InterruptHandler
${CMAKE_SOURCE_DIR}/src/CLR/Core/NativeEventDispatcher
${CMAKE_SOURCE_DIR}/src/CLR/Core/RPC
${CMAKE_SOURCE_DIR}/src/CLR/Core/Serialization
${CMAKE_SOURCE_DIR}/src/CLR/Core/FileStream

# CLR stubs
${CMAKE_SOURCE_DIR}/src/CLR/Debugger
${CMAKE_SOURCE_DIR}/src/CLR/Diagnostics
${CMAKE_SOURCE_DIR}/src/CLR/Messaging

# Helpers
${CMAKE_SOURCE_DIR}/src/CLR/Helpers/nanoprintf
${CMAKE_SOURCE_DIR}/src/CLR/Helpers/NanoRingBuffer
${CMAKE_SOURCE_DIR}/src/CLR/Helpers/Base64
${CMAKE_SOURCE_DIR}/src/CLR/Diagnostics

# HAL
${CMAKE_SOURCE_DIR}/src/HAL

# PAL
${CMAKE_SOURCE_DIR}/src/PAL
${CMAKE_SOURCE_DIR}/src/PAL/BlockStorage
${CMAKE_SOURCE_DIR}/src/PAL/Double
${CMAKE_SOURCE_DIR}/src/PAL/Events
${CMAKE_SOURCE_DIR}/src/PAL/FileSystem

# PAL stubs
${CMAKE_SOURCE_DIR}/src/PAL/AsyncProcCall
${CMAKE_SOURCE_DIR}/src/PAL/COM
${CMAKE_SOURCE_DIR}/src/PAL/Profiler

# platform specific implementations
${BASE_PATH_FOR_CLASS_LIBRARIES_MODULES}/nanoFramework.Runtime.Native

# target
${TARGET_BASE_LOCATION}

CMAKE_FIND_ROOT_PATH_BOTH
)

if (BUILD_VERBOSE)
if(BUILD_VERBOSE)
message("${SRC_FILE} >> ${NF_CoreCLR_SRC_FILE}")
endif()

list(APPEND NF_CoreCLR_SOURCES ${NF_CoreCLR_SRC_FILE})

endforeach()

include(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(NF_CoreCLR DEFAULT_MSG NF_CoreCLR_INCLUDE_DIRS NF_CoreCLR_SOURCES)


# macro to be called from binutils to add Core CLR library
# optional EXTRA_INCLUDES with include paths to be added to the library
# optional EXTRA_COMPILE_DEFINITIONS with compiler definitions to be added to the library
macro(nf_add_lib_coreclr)

# parse arguments
cmake_parse_arguments(NFALC "" "" "EXTRA_INCLUDES;EXTRA_COMPILE_DEFINITIONS" ${ARGN})

# add this has a library
set(LIB_NAME NF_CoreCLR)

add_library(
${LIB_NAME} STATIC
${NF_CoreCLR_SOURCES}
${NF_Diagnostics_SOURCES})
${LIB_NAME} STATIC
${NF_CoreCLR_SOURCES}
${NF_Diagnostics_SOURCES})

target_include_directories(
${LIB_NAME}
PUBLIC
${NF_CoreCLR_INCLUDE_DIRS}
${NFALC_EXTRA_INCLUDES})
${LIB_NAME}
PUBLIC
${NF_CoreCLR_INCLUDE_DIRS}
${NFALC_EXTRA_INCLUDES})

# TODO can be removed later
if(RTOS_ESP32_CHECK)

nf_common_compiler_definitions(TARGET ${LIB_NAME} BUILD_TARGET ${NANOCLR_PROJECT_NAME})

# this is the only one different
Expand All @@ -335,13 +340,12 @@ macro(nf_add_lib_coreclr)
${NFALC_EXTRA_COMPILER_DEFINITIONS}
)

else()
else()
nf_set_compile_options(TARGET ${LIB_NAME})
nf_set_compile_definitions(TARGET ${LIB_NAME} EXTRA_COMPILE_DEFINITIONS ${NFALC_EXTRA_COMPILE_DEFINITIONS} BUILD_TARGET ${NANOCLR_PROJECT_NAME})
nf_set_link_options(TARGET ${LIB_NAME})
endif()

# add alias
add_library("nano::${LIB_NAME}" ALIAS ${LIB_NAME})

endmacro()
Loading
Loading