Skip to content

Commit

Permalink
Merge branch 'main' into add-support-storageoperation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellerbach authored Mar 12, 2024
2 parents 95a3207 + 7910510 commit 0df8206
Show file tree
Hide file tree
Showing 82 changed files with 612 additions and 616 deletions.
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.44
FROM ghcr.io/nanoframework/dev-container-all:v2.45
6 changes: 3 additions & 3 deletions .devcontainer/All/Dockerfile.All.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ RUN git clone --branch nf-build https://github.com/nanoframework/STM32CubeL4.git
&& git clone --branch chibios-21.11.x https://github.com/ChibiOS/ChibiOS-Contrib.git --depth 1 ./sources/ChibiOs-Contrib

# Clone repos for AzureRTOS
RUN git clone --branch v6.4.0_rel --recursive https://github.com/azure-rtos/threadx.git --depth 1 ./sources/AzureRTOS \
&& git clone --branch v6.3.0_rel --recursive https://github.com/azure-rtos/netxduo.git --depth 1 ./sources/NetxDuo
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)
RUN git clone --branch mbedtls-2.28.5 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
Expand All @@ -90,7 +90,7 @@ RUN git clone --branch V10.4.1-kernel-only https://github.com/FreeRTOS/FreeRTOS-
RUN git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip

# Clone ESP-IDF
RUN git clone --branch v4.4.6 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf
RUN git clone --branch v4.4.7 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf

# 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 \
Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/AzureRTOS/Dockerfile.AzureRTOS.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ 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

# Clone repos for AzureRTOS
RUN git clone --branch v6.4.0_rel --recursive https://github.com/azure-rtos/threadx.git --depth 1 ./sources/AzureRTOS \
&& git clone --branch v6.4.0_rel --recursive https://github.com/azure-rtos/netxduo.git --depth 1 ./sources/NetxDuo
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)
RUN git clone --branch mbedtls-2.28.5 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/ESP32/Dockerfile.ESP32
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/nanoframework/dev-container-esp32:v2.28
FROM ghcr.io/nanoframework/dev-container-esp32:v2.29
2 changes: 1 addition & 1 deletion .devcontainer/ESP32/Dockerfile.ESP32.SRC
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ RUN mkdir -p /usr/local/bin/gcc
RUN git clone --branch R0.15 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs

# Clone ESP-IDF
RUN git clone --branch v4.4.6 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf
RUN git clone --branch v4.4.7 https://github.com/espressif/esp-idf --depth 1 --recursive ./sources/esp-idf

# Creating static link python for pyhton3
RUN ln -fs /usr/bin/python3 /usr/bin/python \
Expand Down
6 changes: 4 additions & 2 deletions CMake/Modules/FindNF_NativeAssemblies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -448,19 +448,21 @@ include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NF_NativeAssemblies DEFAULT_MSG NF_NativeAssemblies_INCLUDE_DIRS NF_NativeAssemblies_SOURCES)

# macro to be called from binutils to add Core CLR library
# optional EXTRA_SOURCES with source files to be added to the 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_native_assemblies)

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

# add this has a library
set(LIB_NAME NF_NativeAssemblies)

add_library(
${LIB_NAME} STATIC
${NF_NativeAssemblies_SOURCES})
${NF_NativeAssemblies_SOURCES}
${NFALNA_EXTRA_SOURCES})

target_include_directories(
${LIB_NAME}
Expand Down
7 changes: 5 additions & 2 deletions CMake/Modules/FindSPIFFS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ include(FetchContent)
FetchContent_GetProperties(spiffs)

# List of the required include paths
list(APPEND SPIFFS_INCLUDE_DIRS ${spiffs_SOURCE_DIR}/src)
list(APPEND SPIFFS_INCLUDE_DIRS
${spiffs_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/targets/${RTOS}/_spiffs)

set(src_spiffs

Expand All @@ -19,7 +21,7 @@ set(src_spiffs

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

target_spiffs.c
)
Expand All @@ -32,6 +34,7 @@ foreach(SRC_FILE ${src_spiffs})
PATHS

${spiffs_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/targets/${RTOS}/_spiffs
${TARGET_BASE_LOCATION}

CMAKE_FIND_ROOT_PATH_BOTH
Expand Down
11 changes: 8 additions & 3 deletions CMake/binutils.ChibiOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ macro(nf_add_platform_dependencies target)
${CHIBIOS_HAL_INCLUDE_DIRS}
${ChibiOSnfOverlay_INCLUDE_DIRS}
${CHIBIOS_CONTRIB_INCLUDE_DIRS}
${CHIBIOS_FATFS_INCLUDE_DIRS}
${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS}
${TARGET_CHIBIOS_NANOCLR_INCLUDE_DIRS}
${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD})
Expand All @@ -137,6 +138,7 @@ macro(nf_add_platform_dependencies target)
${CHIBIOS_HAL_INCLUDE_DIRS}
${ChibiOSnfOverlay_INCLUDE_DIRS}
${CHIBIOS_CONTRIB_INCLUDE_DIRS}
${CHIBIOS_FATFS_INCLUDE_DIRS}
${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS}
${TARGET_CHIBIOS_NANOCLR_INCLUDE_DIRS}
${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD})
Expand All @@ -151,6 +153,7 @@ macro(nf_add_platform_dependencies target)
${CHIBIOS_HAL_INCLUDE_DIRS}
${ChibiOSnfOverlay_INCLUDE_DIRS}
${CHIBIOS_CONTRIB_INCLUDE_DIRS}
${CHIBIOS_FATFS_INCLUDE_DIRS}
${lWIP_INCLUDE_DIRS}
${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS}
${TARGET_CHIBIOS_NANOCLR_INCLUDE_DIRS}
Expand All @@ -165,13 +168,17 @@ macro(nf_add_platform_dependencies target)
endif()

nf_add_lib_native_assemblies(
EXTRA_SOURCES
${CHIBIOS_FATFS_SOURCES}
${SPIFFS_SOURCES}
EXTRA_INCLUDES
${CHIBIOS_INCLUDE_DIRS}
${CHIBIOS_HAL_INCLUDE_DIRS}
${${TARGET_STM32_CUBE_PACKAGE}_CubePackage_INCLUDE_DIRS}
${ChibiOSnfOverlay_INCLUDE_DIRS}
${CHIBIOS_CONTRIB_INCLUDE_DIRS}
${lWIP_INCLUDE_DIRS}
${CHIBIOS_FATFS_INCLUDE_DIRS}
${SPIFFS_INCLUDE_DIRS}
${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS}
${TARGET_CHIBIOS_NANOCLR_INCLUDE_DIRS}
Expand All @@ -196,6 +203,7 @@ macro(nf_add_platform_dependencies target)
${TARGET_CHIBIOS_NANOCLR_INCLUDE_DIRS}
${lWIP_INCLUDE_DIRS}
${ChibiOSnfOverlay_INCLUDE_DIRS}
${CHIBIOS_FATFS_INCLUDE_DIRS}
${CHIBIOS_CONTRIB_INCLUDE_DIRS}
${${TARGET_STM32_CUBE_PACKAGE}_CubePackage_INCLUDE_DIRS}
EXTRA_COMPILE_DEFINITIONS -DHAL_USE_MAC=TRUE)
Expand Down Expand Up @@ -227,7 +235,6 @@ macro(nf_add_platform_include_directories target)
${TARGET_CMSIS_COMMON_INCLUDE_DIRS}
${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS}
${lWIP_INCLUDE_DIRS}
${SPIFFS_INCLUDE_DIRS}
)

# includes specific to nanoBooter
Expand Down Expand Up @@ -314,8 +321,6 @@ macro(nf_add_platform_sources target)
target_sources(${target}.elf PUBLIC
${TARGET_CHIBIOS_NANOCLR_SOURCES}
${CHIBIOS_CONTRIB_SOURCES}
${CHIBIOS_FATFS_SOURCES}
${SPIFFS_SOURCES}
)

if(USE_NETWORKING_OPTION)
Expand Down
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,6 @@ if(RTOS_CHIBIOS_CHECK OR RTOS_TI_SIMPLELINK_CHECK)
unset(LINK_OPTIONS)
#################################################################

#################################################################
# clear other options and definitions that we want to set
unset(COMPILE_OPTIONS)
unset(C_COMPILE_OPTIONS)
unset(CXX_COMPILE_OPTIONS)
unset(COMPILE_DEFINITIONS)
unset(LINK_OPTIONS)
#################################################################

endif()

#################################################################################
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resources:
type: github
name: espressif/esp-idf
endpoint: nanoframework
ref: refs/tags/v4.4.6
ref: refs/tags/v4.4.7

# scheduled build
# the schedule is defined at the AZDO web interface because of inconsistencies with time zones
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ steps:
- task: Cache@2
displayName: Cache ESP32 tools
inputs:
key: 'esp32_tools | 4_4_6'
restoreKeys: 4_4_6
key: 'esp32_tools | 4_4_7'
restoreKeys: 4_4_7
path: $(UserProfile)\.espressif\tools
cacheHitVar: ESP32_TOOLS_CACHE_RESTORED

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ resources:
type: github
name: espressif/esp-idf
endpoint: nanoframework
ref: refs/tags/v4.4.6
ref: refs/tags/v4.4.7
- repository: mscorlib
type: github
name: nanoframework/CoreLibrary
Expand Down
4 changes: 2 additions & 2 deletions src/HAL/Include/nanoHAL_Boot.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ extern "C"

// Launches the proprietary bootloader of the platform.
// Returns false in case it's not supported (which is considered the default).
// In case of a successfull call it won't return.
// In case of a successful call it won't return.
// Implemented as "weak" to allow it to be replaced with "hard" implementation at platform level.
bool LaunchProprietaryBootloader();

Expand All @@ -81,7 +81,7 @@ extern "C"
// Returns false in case it's not supported (which is considered the default).
bool RequestToLaunchProprietaryBootloader();

// Report successfull nanoBooter execution
// Report successful nanoBooter execution
void ReportSuccessfullNanoBooter();

#ifdef __cplusplus
Expand Down
4 changes: 0 additions & 4 deletions src/HAL/Include/nanoHAL_Windows_Storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

#include <Target_Windows_Storage.h>

// FatFs define for size of file name members
// ANSI/OEM at DBCS
#define FF_LFN_BUF 255

// driver letters and paths
// drive letter for SD Card
#define INDEX0_DRIVE_LETTER "D:"
Expand Down
4 changes: 2 additions & 2 deletions src/HAL/nanoHAL_Boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ inline bool RequestToLaunchProprietaryBootloader()
return false;
}

// Report successfull nanoBooter execution
// Report successful nanoBooter execution
void ReportSuccessfullNanoBooter()
{
#if (TARGET_HAS_NANOBOOTER == TRUE)
Expand All @@ -107,7 +107,7 @@ void ReportSuccessfullNanoBooter()

// Calls the proprietary bootloader of the platform.
// Returns false in case it's not supported (which is considered the default).
// In case of a successfull call it won't return.
// In case of a successful call it won't return.
// Implemented as "weak" to allow it to be replaced with "hard" implementation at platform level.
__nfweak bool LaunchProprietaryBootloader()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_Directory::GetFilesNative___STATI
{
// allocate memory for buffers
stringBuffer = (char *)platform_malloc(FF_LFN_BUF + 1);
workingBuffer = (char *)platform_malloc(2 * FF_LFN_BUF + 1);
workingBuffer = (char *)platform_malloc(FF_LFN_BUF + 1);

// sanity check for successfull malloc
// sanity check for successful malloc
if (stringBuffer == NULL || workingBuffer == NULL)
{
// failed to allocate memory
Expand Down Expand Up @@ -234,7 +234,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_Directory::GetFilesNative___STATI
strcmp(get_filename_ext(fileInfo.fname), "sys"))
{
// clear working buffer
memset(workingBuffer, 0, 2 * FF_LFN_BUF + 1);
memset(workingBuffer, 0, FF_LFN_BUF + 1);
// compose file path
CombinePathAndName(workingBuffer, folderPath, fileInfo.fname);
// set file full path in array of strings
Expand Down Expand Up @@ -335,9 +335,9 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_Directory::GetDirectoriesNative__
{
// allocate memory for buffers
stringBuffer = (char *)platform_malloc(FF_LFN_BUF + 1);
workingBuffer = (char *)platform_malloc(2 * FF_LFN_BUF + 1);
workingBuffer = (char *)platform_malloc(FF_LFN_BUF + 1);

// sanity check for successfull malloc
// sanity check for successful malloc
if (stringBuffer == NULL || workingBuffer == NULL)
{
// failed to allocate memory
Expand Down Expand Up @@ -366,7 +366,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_Directory::GetDirectoriesNative__
if ((fileInfo.fattrib & AM_DIR) && !(fileInfo.fattrib & AM_SYS) && !(fileInfo.fattrib & AM_HID))
{
// clear working buffer
memset(workingBuffer, 0, 2 * FF_LFN_BUF + 1);
memset(workingBuffer, 0, FF_LFN_BUF + 1);
// compose directory path
CombinePathAndName(workingBuffer, folderPath, fileInfo.fname);
// set directory full path in array of strings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_File::ExistsNative___STATIC__BOOL
FAULT_ON_NULL(fileName);

// setup file path
filePath = (char *)platform_malloc(2 * FF_LFN_BUF + 1);
filePath = (char *)platform_malloc(FF_LFN_BUF + 1);

// sanity check for successfull malloc
// sanity check for successful malloc
if (filePath == NULL)
{
// failed to allocate memory
NANOCLR_SET_AND_LEAVE(CLR_E_OUT_OF_MEMORY);
}

// clear working buffer
memset(filePath, 0, 2 * FF_LFN_BUF + 1);
memset(filePath, 0, FF_LFN_BUF + 1);

// compose file path
CombinePathAndName(filePath, workingPath, fileName);
Expand Down
Loading

0 comments on commit 0df8206

Please sign in to comment.