diff --git a/.devcontainer/All/Dockerfile.All b/.devcontainer/All/Dockerfile.All index a3eda3aa3a..8b688d51f0 100644 --- a/.devcontainer/All/Dockerfile.All +++ b/.devcontainer/All/Dockerfile.All @@ -1 +1 @@ -FROM ghcr.io/nanoframework/dev-container-all:v2.44 +FROM ghcr.io/nanoframework/dev-container-all:v2.45 diff --git a/.devcontainer/All/Dockerfile.All.SRC b/.devcontainer/All/Dockerfile.All.SRC index b6349fb2a4..d65afa85cb 100644 --- a/.devcontainer/All/Dockerfile.All.SRC +++ b/.devcontainer/All/Dockerfile.All.SRC @@ -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 \ @@ -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 \ diff --git a/.devcontainer/AzureRTOS/Dockerfile.AzureRTOS.SRC b/.devcontainer/AzureRTOS/Dockerfile.AzureRTOS.SRC index e302fba7c9..af043f112f 100644 --- a/.devcontainer/AzureRTOS/Dockerfile.AzureRTOS.SRC +++ b/.devcontainer/AzureRTOS/Dockerfile.AzureRTOS.SRC @@ -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 \ diff --git a/.devcontainer/ESP32/Dockerfile.ESP32 b/.devcontainer/ESP32/Dockerfile.ESP32 index 71bde7bad9..0915cc7bab 100644 --- a/.devcontainer/ESP32/Dockerfile.ESP32 +++ b/.devcontainer/ESP32/Dockerfile.ESP32 @@ -1 +1 @@ -FROM ghcr.io/nanoframework/dev-container-esp32:v2.28 +FROM ghcr.io/nanoframework/dev-container-esp32:v2.29 diff --git a/.devcontainer/ESP32/Dockerfile.ESP32.SRC b/.devcontainer/ESP32/Dockerfile.ESP32.SRC index 7a1716ce92..8f6ae2ba39 100644 --- a/.devcontainer/ESP32/Dockerfile.ESP32.SRC +++ b/.devcontainer/ESP32/Dockerfile.ESP32.SRC @@ -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 \ diff --git a/CMake/Modules/FindNF_NativeAssemblies.cmake b/CMake/Modules/FindNF_NativeAssemblies.cmake index f28d519574..30d13ee7a6 100644 --- a/CMake/Modules/FindNF_NativeAssemblies.cmake +++ b/CMake/Modules/FindNF_NativeAssemblies.cmake @@ -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} diff --git a/CMake/Modules/FindSPIFFS.cmake b/CMake/Modules/FindSPIFFS.cmake index 6ee14f0614..dde04cf4c4 100644 --- a/CMake/Modules/FindSPIFFS.cmake +++ b/CMake/Modules/FindSPIFFS.cmake @@ -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 @@ -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 ) @@ -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 diff --git a/CMake/binutils.ChibiOS.cmake b/CMake/binutils.ChibiOS.cmake index 726f7e8d67..a5d74426ed 100644 --- a/CMake/binutils.ChibiOS.cmake +++ b/CMake/binutils.ChibiOS.cmake @@ -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}) @@ -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}) @@ -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} @@ -165,6 +168,9 @@ 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} @@ -172,6 +178,7 @@ macro(nf_add_platform_dependencies target) ${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} @@ -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) @@ -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 @@ -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) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b49e3e9b4..d6e5a5a663 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() ################################################################################# diff --git a/azure-pipelines-nightly.yml b/azure-pipelines-nightly.yml index 6f003730c1..744aae7615 100644 --- a/azure-pipelines-nightly.yml +++ b/azure-pipelines-nightly.yml @@ -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 diff --git a/azure-pipelines-templates/download-install-esp32-build-components.yml b/azure-pipelines-templates/download-install-esp32-build-components.yml index 476a5553e7..d5affb328f 100644 --- a/azure-pipelines-templates/download-install-esp32-build-components.yml +++ b/azure-pipelines-templates/download-install-esp32-build-components.yml @@ -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 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 353cfa367a..fdf34a51a3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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 diff --git a/src/HAL/Include/nanoHAL_Boot.h b/src/HAL/Include/nanoHAL_Boot.h index 69be53c3e2..a503c5f6ed 100644 --- a/src/HAL/Include/nanoHAL_Boot.h +++ b/src/HAL/Include/nanoHAL_Boot.h @@ -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(); @@ -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 diff --git a/src/HAL/Include/nanoHAL_Windows_Storage.h b/src/HAL/Include/nanoHAL_Windows_Storage.h index 11dd3e4b2d..df35443bb9 100644 --- a/src/HAL/Include/nanoHAL_Windows_Storage.h +++ b/src/HAL/Include/nanoHAL_Windows_Storage.h @@ -7,10 +7,6 @@ #include -// 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:" diff --git a/src/HAL/nanoHAL_Boot.c b/src/HAL/nanoHAL_Boot.c index 73549508f8..644493f48f 100644 --- a/src/HAL/nanoHAL_Boot.c +++ b/src/HAL/nanoHAL_Boot.c @@ -92,7 +92,7 @@ inline bool RequestToLaunchProprietaryBootloader() return false; } -// Report successfull nanoBooter execution +// Report successful nanoBooter execution void ReportSuccessfullNanoBooter() { #if (TARGET_HAS_NANOBOOTER == TRUE) @@ -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() { diff --git a/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_Directory.cpp b/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_Directory.cpp index 74e4f97df5..367621c28f 100644 --- a/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_Directory.cpp +++ b/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_Directory.cpp @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_File.cpp b/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_File.cpp index 2df378c86f..1bb8065dab 100644 --- a/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_File.cpp +++ b/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_File.cpp @@ -27,9 +27,9 @@ 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 @@ -37,7 +37,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_File::ExistsNative___STATIC__BOOL } // 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); diff --git a/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_FileStream.cpp b/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_FileStream.cpp index c033a7f451..0aaf5f5e7b 100644 --- a/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_FileStream.cpp +++ b/src/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_FileStream.cpp @@ -38,9 +38,9 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::OpenFileNative___VOID 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 @@ -48,7 +48,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::OpenFileNative___VOID } // 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); @@ -165,9 +165,9 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::ReadNative___I4__STRI buffer = pArray->GetFirstElement(); // 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 @@ -175,7 +175,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::ReadNative___I4__STRI } // 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); @@ -269,9 +269,9 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::WriteNative___VOID__S buffer = pArray->GetFirstElement(); // 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 @@ -279,7 +279,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::WriteNative___VOID__S } // 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); @@ -362,9 +362,9 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::GetLengthNative___I8_ 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 @@ -372,7 +372,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::GetLengthNative___I8_ } // 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); diff --git a/targets/AzureRTOS/CMakeLists.txt b/targets/AzureRTOS/CMakeLists.txt index b3e595d392..cbfca05874 100644 --- a/targets/AzureRTOS/CMakeLists.txt +++ b/targets/AzureRTOS/CMakeLists.txt @@ -87,7 +87,7 @@ if(NO_AZURERTOS_SOURCE_FOLDER) FetchContent_Declare( azure_rtos - GIT_REPOSITORY https://github.com/azure-rtos/threadx.git + GIT_REPOSITORY https://github.com/eclipse-threadx/threadx.git GIT_TAG ${RTOS_VERSION} ) @@ -146,7 +146,7 @@ if(AZURERTOS_USBX_REQUIRED) FetchContent_Declare( azure_rtos_usbx - GIT_REPOSITORY https://github.com/azure-rtos/usbx.git + GIT_REPOSITORY https://github.com/eclipse-threadx/usbx.git GIT_TAG ${RTOS_VERSION} ) @@ -207,7 +207,7 @@ if(AZURERTOS_FILEX_REQUIRED) FetchContent_Declare( azure_rtos_filex - GIT_REPOSITORY https://github.com/azure-rtos/filex.git + GIT_REPOSITORY https://github.com/eclipse-threadx/filex.git GIT_TAG ${FILEX_VERSION} ) @@ -268,7 +268,7 @@ if(AZURERTOS_NETXDUO_REQUIRED) FetchContent_Declare( azure_rtos_netxduo - GIT_REPOSITORY https://github.com/azure-rtos/netxduo.git + GIT_REPOSITORY https://github.com/eclipse-threadx/netxduo.git GIT_TAG ${NETXDUO_VERSION} ) diff --git a/targets/AzureRTOS/Maxim/MAX78000_FTHR/nanoBooter/main.c b/targets/AzureRTOS/Maxim/MAX78000_FTHR/nanoBooter/main.c index d90fa1e23d..6b006e4c81 100644 --- a/targets/AzureRTOS/Maxim/MAX78000_FTHR/nanoBooter/main.c +++ b/targets/AzureRTOS/Maxim/MAX78000_FTHR/nanoBooter/main.c @@ -130,7 +130,7 @@ int main(void) // init boot clipboard InitBootClipboard(); - // report successfull nanoBooter execution + // report successful nanoBooter execution ReportSuccessfullNanoBooter(); // the following IF is not mandatory, it's just providing a way for a user to 'force' diff --git a/targets/AzureRTOS/Maxim/_common/targetHAL_ConfigurationManager.cpp b/targets/AzureRTOS/Maxim/_common/targetHAL_ConfigurationManager.cpp index 0db20948a7..8586764784 100644 --- a/targets/AzureRTOS/Maxim/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/AzureRTOS/Maxim/_common/targetHAL_ConfigurationManager.cpp @@ -395,7 +395,7 @@ __nfweak bool ConfigurationManager_UpdateConfigurationBlock( // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return TRUE; } @@ -426,7 +426,7 @@ __nfweak bool ConfigurationManager_UpdateConfigurationBlock( // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return TRUE; } @@ -455,7 +455,7 @@ __nfweak bool ConfigurationManager_UpdateConfigurationBlock( // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return TRUE; } diff --git a/targets/AzureRTOS/ST/ORGPAL_PALTHREE/ffconf.h b/targets/AzureRTOS/ST/ORGPAL_PALTHREE/ffconf.h index 4bf2bd319f..6c2658e3fd 100644 --- a/targets/AzureRTOS/ST/ORGPAL_PALTHREE/ffconf.h +++ b/targets/AzureRTOS/ST/ORGPAL_PALTHREE/ffconf.h @@ -80,7 +80,7 @@ / Locale and Namespace Configurations /---------------------------------------------------------------------------*/ -#define FF_CODE_PAGE 850 +#define FF_CODE_PAGE 437 /* This option specifies the OEM code page to be used on the target system. / Incorrect code page setting can cause a file open failure. / diff --git a/targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoBooter/main.c b/targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoBooter/main.c index bfa0b9a3e7..0e34e0bad1 100644 --- a/targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoBooter/main.c +++ b/targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoBooter/main.c @@ -120,7 +120,7 @@ void tx_application_define(void *first_unused_memory) // for nanoBooter we have to init it here to have access to network configuration blocks ConfigurationManager_Initialize(); - // report successfull nanoBooter execution + // report successful nanoBooter execution ReportSuccessfullNanoBooter(); } diff --git a/targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoCLR/main.c b/targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoCLR/main.c index ed5034e6bf..2be4458890 100644 --- a/targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoCLR/main.c +++ b/targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoCLR/main.c @@ -12,7 +12,7 @@ #include #include -extern uint8_t hal_spiffs_config(); +extern int32_t hal_spiffs_config(); extern CLR_SETTINGS clrSettings; @@ -97,7 +97,7 @@ void tx_application_define(void *first_unused_memory) // Create NetX Duo thread status = tx_thread_create( - & netxDuoThread, + &netxDuoThread, "NetXDuo Thread", NetXDuoThread_entry, 0, diff --git a/targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoBooter/main.c b/targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoBooter/main.c index 298ab14073..c1e330532d 100644 --- a/targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoBooter/main.c +++ b/targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoBooter/main.c @@ -115,7 +115,7 @@ void tx_application_define(void *first_unused_memory) } } - // report successfull nanoBooter execution + // report successful nanoBooter execution ReportSuccessfullNanoBooter(); } diff --git a/targets/AzureRTOS/ST/_common/LaunchCLR.c b/targets/AzureRTOS/ST/_common/LaunchCLR.c index c8b3a44583..d63570caa3 100644 --- a/targets/AzureRTOS/ST/_common/LaunchCLR.c +++ b/targets/AzureRTOS/ST/_common/LaunchCLR.c @@ -14,7 +14,7 @@ void LaunchCLR(uint32_t address) // function pointer to load nanoCLR ResetHandler address irq_vector_t JumpToNanoCLR; - // report successfull nanoBooter execution + // report successful nanoBooter execution ReportSuccessfullNanoBooter(); // load nanoCLR vector table diff --git a/targets/AzureRTOS/ST/_common/targetHAL_ConfigurationManager.cpp b/targets/AzureRTOS/ST/_common/targetHAL_ConfigurationManager.cpp index 9cc112070c..8746cdb2e6 100644 --- a/targets/AzureRTOS/ST/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/AzureRTOS/ST/_common/targetHAL_ConfigurationManager.cpp @@ -549,7 +549,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return UpdateConfigurationResult_NoChanges; } @@ -580,7 +580,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return UpdateConfigurationResult_NoChanges; } @@ -609,7 +609,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return UpdateConfigurationResult_NoChanges; } @@ -640,7 +640,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return UpdateConfigurationResult_NoChanges; } diff --git a/targets/AzureRTOS/ST/_nanoCLR/System.Device.Spi/cpu_spi.cpp b/targets/AzureRTOS/ST/_nanoCLR/System.Device.Spi/cpu_spi.cpp index 906b208212..28975d2093 100644 --- a/targets/AzureRTOS/ST/_nanoCLR/System.Device.Spi/cpu_spi.cpp +++ b/targets/AzureRTOS/ST/_nanoCLR/System.Device.Spi/cpu_spi.cpp @@ -6,7 +6,7 @@ #include ///////////////////////////////////////////////////// -// SPI PAL strucs declared in win_dev_spi_native.h // +// SPI PAL structs declared in win_dev_spi_native.h // ///////////////////////////////////////////////////// #if STM32_SPI_USE_SPI1 NF_PAL_SPI SPI1_PAL; diff --git a/targets/AzureRTOS/ST/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h b/targets/AzureRTOS/ST/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h index 544cb35549..58690f6606 100644 --- a/targets/AzureRTOS/ST/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h +++ b/targets/AzureRTOS/ST/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h @@ -32,7 +32,7 @@ typedef struct } NF_PAL_UART; //////////////////////////////////////////// -// declaration of the the UART PAL strucs // +// declaration of the the UART PAL structs // //////////////////////////////////////////// #if defined(NF_SERIAL_COMM_STM32_UART_USE_USART1) && (NF_SERIAL_COMM_STM32_UART_USE_USART1 == TRUE) extern NF_PAL_UART Uart1_PAL; diff --git a/targets/AzureRTOS/SiliconLabs/SL_STK3701A/nanoBooter/main.c b/targets/AzureRTOS/SiliconLabs/SL_STK3701A/nanoBooter/main.c index 45b18d583c..0c67d69304 100644 --- a/targets/AzureRTOS/SiliconLabs/SL_STK3701A/nanoBooter/main.c +++ b/targets/AzureRTOS/SiliconLabs/SL_STK3701A/nanoBooter/main.c @@ -171,7 +171,7 @@ void tx_application_define(void *first_unused_memory) usb_device_cdc_acm_app_init(); #endif - // report successfull nanoBooter execution + // report successful nanoBooter execution ReportSuccessfullNanoBooter(); } diff --git a/targets/AzureRTOS/SiliconLabs/_common/LaunchCLR.c b/targets/AzureRTOS/SiliconLabs/_common/LaunchCLR.c index 94dd0486f1..92f5571c13 100644 --- a/targets/AzureRTOS/SiliconLabs/_common/LaunchCLR.c +++ b/targets/AzureRTOS/SiliconLabs/_common/LaunchCLR.c @@ -15,7 +15,7 @@ void LaunchCLR(uint32_t address) // function pointer to load nanoCLR ResetHandler address irq_vector_t JumpToNanoCLR; - // report successfull nanoBooter execution + // report successful nanoBooter execution ReportSuccessfullNanoBooter(); // load nanoCLR vector table diff --git a/targets/AzureRTOS/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp b/targets/AzureRTOS/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp index b6a6d04900..da8eb29692 100644 --- a/targets/AzureRTOS/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/AzureRTOS/SiliconLabs/_common/targetHAL_ConfigurationManager.cpp @@ -560,7 +560,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return UpdateConfigurationResult_NoChanges; } @@ -591,7 +591,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return UpdateConfigurationResult_NoChanges; } @@ -620,7 +620,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return UpdateConfigurationResult_NoChanges; } @@ -651,7 +651,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return UpdateConfigurationResult_NoChanges; } diff --git a/targets/AzureRTOS/SiliconLabs/_nanoCLR/System.Device.Spi/cpu_spi.cpp b/targets/AzureRTOS/SiliconLabs/_nanoCLR/System.Device.Spi/cpu_spi.cpp index 0ccec5c4f7..458bec7023 100644 --- a/targets/AzureRTOS/SiliconLabs/_nanoCLR/System.Device.Spi/cpu_spi.cpp +++ b/targets/AzureRTOS/SiliconLabs/_nanoCLR/System.Device.Spi/cpu_spi.cpp @@ -6,7 +6,7 @@ #include ///////////////////////////////////////////////////// -// SPI PAL strucs declared in sys_dev_spi_native.h // +// SPI PAL structs declared in sys_dev_spi_native.h // ///////////////////////////////////////////////////// #if GECKO_USE_SPI0 == TRUE NF_PAL_SPI SPI0_PAL; diff --git a/targets/AzureRTOS/SiliconLabs/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h b/targets/AzureRTOS/SiliconLabs/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h index e6952c319c..6168b5bc72 100644 --- a/targets/AzureRTOS/SiliconLabs/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h +++ b/targets/AzureRTOS/SiliconLabs/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h @@ -84,7 +84,7 @@ typedef struct } NF_PAL_UART; //////////////////////////////////////////// -// declaration of the the UART PAL strucs // +// declaration of the the UART PAL structs // //////////////////////////////////////////// #if defined(GECKO_USE_USART0) && (GECKO_USE_USART0 == TRUE) extern NF_PAL_UART Uart0_PAL; diff --git a/targets/ChibiOS/CMakeLists.txt b/targets/ChibiOS/CMakeLists.txt index 97d210d153..73c2b8efe4 100644 --- a/targets/ChibiOS/CMakeLists.txt +++ b/targets/ChibiOS/CMakeLists.txt @@ -1,386 +1,384 @@ -# -# Copyright (c) .NET Foundation and Contributors -# See LICENSE file in the project root for full license information. -# - -include(FetchContent) -include(binutils.common) -include(binutils.arm-none-eabi) -include(binutils.ChibiOS) -include(STM32_CubePackage) - -# Set target series -nf_set_stm32_target_series() - -# Define PLATFORM base path -set(BASE_PATH_FOR_PLATFORM ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE) - -######################################################## -# check availability of hex2dfu tool if specified -if(DEFINED TOOL_HEX2DFU_PREFIX) - if(NOT EXISTS ${TOOL_HEX2DFU_PREFIX}/hex2dfu.exe AND NOT EXISTS ${TOOL_HEX2DFU_PREFIX}/hex2dfu) - message(STATUS "") - message(STATUS "Couldn't find the hex2dfu tool at the specified path: ${TOOL_HEX2DFU_PREFIX}/hex2dfu.exe or ${TOOL_HEX2DFU_PREFIX}/hex2dfu") - message(STATUS "Make sure that the CMake option TOOL_HEX2DFU_PREFIX has the correct path.") - message(STATUS "If you don't have this tool download it from https://github.com/nanoframework/nf-tools/releases") - message(STATUS "") - message(FATAL_ERROR "hex2dfu tool not found") - else() - set(HEX2DFU_TOOL_AVAILABLE TRUE CACHE INTERNAL "hex2dfu tool available") - endif() -endif() - -######################################################## -# check availability of SRecord tool, if specified -if(DEFINED TOOL_SRECORD_PREFIX) - if(NOT EXISTS ${TOOL_SRECORD_PREFIX}/srec_cat.exe AND NOT EXISTS ${TOOL_SRECORD_PREFIX}/srec_cat) - message(STATUS "") - message(STATUS "Couldn't find the srec_cat tool at the specified path: ${TOOL_SRECORD_PREFIX}/srec_cat.exe") - message(STATUS "Make sure that the CMake option TOOL_SRECORD_PREFIX has the correct path.") - message(STATUS "If you don't have this tool download it from https://sourceforge.net/projects/srecord/files/srecord-win32/") - message(STATUS "") - message(FATAL_ERROR "srec_cat tool not found") - else() - set(SRECORD_TOOL_AVAILABLE TRUE CACHE INTERNAL "srec_cat tool available") - endif() -endif() - -# check if CHIBIOS_SOURCE_FOLDER was specified or if it's empty (default is empty) -set(NO_CHIBIOS_SOURCE_FOLDER TRUE) -if(CHIBIOS_SOURCE_FOLDER) - if(NOT ${CHIBIOS_SOURCE_FOLDER} STREQUAL "") - set(NO_CHIBIOS_SOURCE_FOLDER FALSE) - endif() -endif() - -# check if CHIBIOS-Contrib_SOURCE was specified or if it's empty (default is empty) -set(NO_CHIBIOS_CONTRIB_SOURCE TRUE) -if(CHIBIOS_CONTRIB_SOURCE) - if(NOT ${CHIBIOS_CONTRIB_SOURCE} STREQUAL "") - set(NO_CHIBIOS_CONTRIB_SOURCE FALSE) - endif() -endif() - -# ChibiOS version -set(RTOS_VERSION_EMPTY TRUE) - -# check if build was requested with a specifc ChibiOS version -if(DEFINED RTOS_VERSION) - if(NOT "${RTOS_VERSION}" STREQUAL "") - set(RTOS_VERSION_EMPTY FALSE) - endif() -endif() - -# check if build was requested with a specifc ChibiOS version -if(RTOS_VERSION_EMPTY) - # no ChibiOS version actualy specified, must be empty which is fine, we'll default to a known good version - # WHEN CHANGING THIS MAKE SURE TO UPDATE THE DEV CONTAINERS - # WHEN CHANGING THIS MAKE SURE TO UPDATE AzureRTOS\ST\CMakeLists.txt - set(RTOS_VERSION "stable_21.11.x") -endif() - -if(NO_CHIBIOS_SOURCE_FOLDER) - # no CHIBIOS source specified, download it from it's repo - message(STATUS "RTOS is: ChibiOS ${RTOS_VERSION} from SVN official repo") - - FetchContent_Declare( - chibios - SVN_REPOSITORY http://svn.code.sf.net/p/chibios/code/branches/${RTOS_VERSION} - SVN_REVISION -rHEAD - ) - -else() - # ChibiOS source was specified - - - message(STATUS "RTOS is: ChibiOS ${RTOS_VERSION} (source from: ${CHIBIOS_SOURCE_FOLDER})") - FetchContent_Declare( - chibios - SOURCE_DIR ${CHIBIOS_SOURCE_FOLDER} - ) - - -endif() - -# Check if population has already been performed -FetchContent_GetProperties(chibios) -if(NOT chibios_POPULATED) - # Fetch the content using previously declared details - FetchContent_Populate(chibios) -endif() - -if(CHIBIOS_CONTRIB_REQUIRED) - if(NO_CHIBIOS_CONTRIB_SOURCE) - # no CHIBIOS_CONTRIB source specified, download it from it's repo - - FetchContent_Declare( - chibios-contrib - GIT_REPOSITORY https://github.com/ChibiOS/ChibiOS-Contrib.git - GIT_TAG chibios-21.11.x - ) - - message(STATUS "ChibiOS-Contrib from GitHub repo") - - else() - # ChibiOS-Contrib source was specified - - message(STATUS "ChibiOS-Contrib (source from: ${CHIBIOS_CONTRIB_SOURCE})") - - FetchContent_Declare( - chibios-contrib - SOURCE_DIR ${CHIBIOS_CONTRIB_SOURCE} - ) - - endif() - - # Check if population has already been performed - FetchContent_GetProperties(chibios-contrib) - if(NOT chibios-contrib_POPULATED) - # Fetch the content using previously declared details - FetchContent_Populate(chibios-contrib) - endif() - -endif() - - -# include FatFS if SDCard or USB MSD are ON -if(NF_FEATURE_HAS_SDCARD OR NF_FEATURE_HAS_USB_MSD) - - # check if FATFS_SOURCE was specified or if it's empty (default is empty) - set(NO_FATFS_SOURCE TRUE) - if(FATFS_SOURCE) - if(NOT ${FATFS_SOURCE} STREQUAL "") - set(NO_FATFS_SOURCE FALSE) - endif() - endif() - - # FatFS version - set(FATFS_VERSION_EMPTY TRUE) - - # check if build was requested with a specifc FatFS version - if(DEFINED FATFS_VERSION) - if(NOT ${FATFS_VERSION} STREQUAL "") - set(FATFS_VERSION_EMPTY FALSE) - endif() - endif() - - # check if build was requested with a specifc FatFS version - if(FATFS_VERSION_EMPTY) - # no FatFS version actualy specified, must be empty which is fine, we'll default to a known good version - # WHEN CHANGING THIS MAKE SURE TO UPDATE THE DEV CONTAINERS - set(FATFS_VERSION_TAG "R0.15") - else() - # set version - set(FATFS_VERSION_TAG ${FATFS_VERSION}) - endif() - - if(NO_FATFS_SOURCE) - message(STATUS "FatFS ${FATFS_VERSION_TAG} from GitHub repo") - - FetchContent_Declare( - fatfs - GIT_REPOSITORY https://github.com/abbrev/fatfs.git - GIT_TAG ${FATFS_VERSION_TAG} - ) - - else() - # FatFS source was specified - - message(STATUS "FatFS ${FATFS_VERSION_TAG} source from: ${FATFS_SOURCE})") - - FetchContent_Declare( - fatfs - SOURCE_DIR ${FATFS_SOURCE} - ) - - endif() - - # Check if population has already been performed - FetchContent_GetProperties(fatfs) - if(NOT fatfs_POPULATED) - # Fetch the content using previously declared details - FetchContent_Populate(fatfs) - endif() - - # have to delete the ffconf.h template from the repo - execute_process( - COMMAND ${CMAKE_COMMAND} -E remove ${fatfs_SOURCE_DIR}/source/ffconf.h - ) - -endif() - -# if networking is enabled add lwIP to the build -if(USE_NETWORKING_OPTION) - - nf_add_lwip_library() - -endif() - - -# if Mbed TLS is enabled add it to the build -if(USE_SECURITY_MBEDTLS_OPTION OR NF_REQUIRES_MBEDTLS) - - nf_add_mbedtls_library() - -endif() - -# set target base location -# this has to be set before the class library modules are pulled in -if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/targets/ChibiOS/${TARGET_BOARD}) - # set target base location - set(TARGET_BASE_LOCATION ${CMAKE_SOURCE_DIR}/targets/ChibiOS/${TARGET_BOARD} CACHE INTERNAL "make global") -else() - # try to find board in the Community targets folder - if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}) - # set target base location - set(TARGET_BASE_LOCATION ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD} CACHE INTERNAL "make global") - else() - # board NOT found in targets folder - # can't continue - message(FATAL_ERROR "\n\nSorry but support for ${TARGET_BOARD} target is not available...\n\nYou can wait for that to be added or you might want to contribute and start working on a PR for that.\n\n") - endif() -endif() - -# set CMSIS RTOS include directory -include_directories( ${CMSIS_RTOS_INCLUDE_DIR}) - -# need to find board definition files (board.c and board.h) - -# start search in nanoFramework ChibiOS 'overlay' folder -if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/boards/${TARGET_BOARD}) - # board found - # if it's on nF overlay board.c and board.h exist there for sure - set(CHIBIOS_BOARD_DEFINITIONS_LOCATION "Board definition files taken from nanoFramework overlay" CACHE INTERNAL "Location of board definition files") - set(CHIBIOS_BOARD_DEFINITIONS_PATH ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/boards/${TARGET_BOARD} CACHE INTERNAL "Path of board definition files") -else() - # board NOT found in ChibiOS 'overlay' - - # try to find it in the target boards - if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/targets/ChibiOS/${TARGET_BOARD}) - # board found - # check if the board definition files are available at the target folder - if( EXISTS ${CMAKE_SOURCE_DIR}/targets/ChibiOS/${TARGET_BOARD}/board.c AND - EXISTS ${CMAKE_SOURCE_DIR}/targets/ChibiOS/${TARGET_BOARD}/board.h) - # definition files found - set(CHIBIOS_BOARD_DEFINITIONS_LOCATION "Board definition files taken from target folder" CACHE INTERNAL "Location of board definition files") - set(CHIBIOS_BOARD_DEFINITIONS_PATH ${CMAKE_SOURCE_DIR}/targets/ChibiOS/${TARGET_BOARD} CACHE INTERNAL "Path of board definition files") - - else() - # board.c and board.h are NOT in the target folder, try to find them in the official distribution - - if(IS_DIRECTORY ${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD}) - # board found - # if it's on the ChibiOS official distribution board.c and board.h exist here for sure - set(CHIBIOS_BOARD_DEFINITIONS_LOCATION "Board definition files taken from official ChibiOS distribution" CACHE INTERNAL "Location of board definition files") - set(CHIBIOS_BOARD_DEFINITIONS_PATH ${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD} CACHE INTERNAL "Path of board definition files") - - else() - # board NOT found in official distribution - # quit now as there is no were else to search for these - message(FATAL_ERROR "\n\nSorry but couldn't find definition files for ${TARGET_BOARD} in the available list of ChibiOS supported boards...\n\n") - - endif() - endif() - - else() - - # try to find board in the Community targets folder - if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}) - # set flag for this being a community board - set(IS_COMMUNITY_TARGET TRUE CACHE INTERNAL "Community target flag") - - - # check if the board definition files are available at the target folder - if( EXISTS ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}/board.c AND - EXISTS ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}/board.h) - - # definition files found - set(CHIBIOS_BOARD_DEFINITIONS_LOCATION "Board definition files taken from Community Targets" CACHE INTERNAL "Location of board definition files") - set(CHIBIOS_BOARD_DEFINITIONS_PATH ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD} CACHE INTERNAL "Path of board definition files") - - else() - - # board.c and board.h are NOT in the target folder, try to find them in the official distribution - if(IS_DIRECTORY ${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD}) - # board found - # if it's on the ChibiOS official distribution board.c and board.h exist here for sure - set(CHIBIOS_BOARD_DEFINITIONS_LOCATION "Board definition files taken from official ChibiOS distribution" CACHE INTERNAL "Location of board definition files") - set(CHIBIOS_BOARD_DEFINITIONS_PATH ${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD} CACHE INTERNAL "Path of board definition files") - - else() - # board NOT found in official distribution - # quit now as there is no were else to search for these - message(FATAL_ERROR "\n\nSorry but couldn't find definition files for ${TARGET_BOARD} in the available list of ChibiOS supported boards...\n\n") - - endif() - - endif() - - else() - # board NOT found in official distribution - # quit now as there is no were else to search for these - message(FATAL_ERROR "\n\nSorry but couldn't find definition files for ${TARGET_BOARD} in the available list of ChibiOS supported boards...\n\n") - endif() - - endif() - -endif() - -# (default is OFF so STM Cube package is NOT included) -option(STM32_CUBE_PACKAGE_REQUIRED "option to include STM Cube pcakge in the build") -if(STM32_CUBE_PACKAGE_REQUIRED) - ProcessSTM32CubePackage() -endif() - -# if support for SPIFFS is enabled add it to the build -if(NF_FEATURE_USE_SPIFFS) - - # check if SPIFFS_SOURCE was specified or if it's empty (default is empty) - set(NO_SPIFFS_SOURCE TRUE) - - if(SPIFFS_SOURCE) - if(NOT ${SPIFFS_SOURCE} STREQUAL "") - set(NO_SPIFFS_SOURCE FALSE) - endif() - endif() - - if(NO_SPIFFS_SOURCE) - # no SPIFFS source specified, download it from it's repo - message(STATUS "SPIFFS source from from GitHub repo") - - FetchContent_Declare( - spiffs - GIT_REPOSITORY https://github.com/nanoframework/spiffs - GIT_TAG "nf-build" - ) - - else() - # SPIFFS source was specified - - message(STATUS "SPIFFS source from: ${SPIFFS_SOURCE}") - - FetchContent_Declare( - spiffs - SOURCE_DIR ${SPIFFS_SOURCE} - ) - - endif() - - # Check if population has already been performed - FetchContent_GetProperties(spiffs) - if(NOT spiffs_POPULATED) - # Fetch the content using previously declared details - FetchContent_Populate(spiffs) - endif() - - add_subdirectory(_spiffs) - -endif() - -# add target ChibiOS dirs -add_subdirectory(_include) -add_subdirectory(_common) -add_subdirectory(_nanoBooter) -add_subdirectory(_nanoCLR) - -# board folder will be added in main CMakeList +# +# Copyright (c) .NET Foundation and Contributors +# See LICENSE file in the project root for full license information. +# + +include(FetchContent) +include(binutils.common) +include(binutils.arm-none-eabi) +include(binutils.ChibiOS) +include(STM32_CubePackage) + +# Set target series +nf_set_stm32_target_series() + +# Define PLATFORM base path +set(BASE_PATH_FOR_PLATFORM ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE) + +######################################################## +# check availability of hex2dfu tool if specified +if(DEFINED TOOL_HEX2DFU_PREFIX) + if(NOT EXISTS ${TOOL_HEX2DFU_PREFIX}/hex2dfu.exe AND NOT EXISTS ${TOOL_HEX2DFU_PREFIX}/hex2dfu) + message(STATUS "") + message(STATUS "Couldn't find the hex2dfu tool at the specified path: ${TOOL_HEX2DFU_PREFIX}/hex2dfu.exe or ${TOOL_HEX2DFU_PREFIX}/hex2dfu") + message(STATUS "Make sure that the CMake option TOOL_HEX2DFU_PREFIX has the correct path.") + message(STATUS "If you don't have this tool download it from https://github.com/nanoframework/nf-tools/releases") + message(STATUS "") + message(FATAL_ERROR "hex2dfu tool not found") + else() + set(HEX2DFU_TOOL_AVAILABLE TRUE CACHE INTERNAL "hex2dfu tool available") + endif() +endif() + +######################################################## +# check availability of SRecord tool, if specified +if(DEFINED TOOL_SRECORD_PREFIX) + if(NOT EXISTS ${TOOL_SRECORD_PREFIX}/srec_cat.exe AND NOT EXISTS ${TOOL_SRECORD_PREFIX}/srec_cat) + message(STATUS "") + message(STATUS "Couldn't find the srec_cat tool at the specified path: ${TOOL_SRECORD_PREFIX}/srec_cat.exe") + message(STATUS "Make sure that the CMake option TOOL_SRECORD_PREFIX has the correct path.") + message(STATUS "If you don't have this tool download it from https://sourceforge.net/projects/srecord/files/srecord-win32/") + message(STATUS "") + message(FATAL_ERROR "srec_cat tool not found") + else() + set(SRECORD_TOOL_AVAILABLE TRUE CACHE INTERNAL "srec_cat tool available") + endif() +endif() + +# check if CHIBIOS_SOURCE_FOLDER was specified or if it's empty (default is empty) +set(NO_CHIBIOS_SOURCE_FOLDER TRUE) +if(CHIBIOS_SOURCE_FOLDER) + if(NOT ${CHIBIOS_SOURCE_FOLDER} STREQUAL "") + set(NO_CHIBIOS_SOURCE_FOLDER FALSE) + endif() +endif() + +# check if CHIBIOS-Contrib_SOURCE was specified or if it's empty (default is empty) +set(NO_CHIBIOS_CONTRIB_SOURCE TRUE) +if(CHIBIOS_CONTRIB_SOURCE) + if(NOT ${CHIBIOS_CONTRIB_SOURCE} STREQUAL "") + set(NO_CHIBIOS_CONTRIB_SOURCE FALSE) + endif() +endif() + +# ChibiOS version +set(RTOS_VERSION_EMPTY TRUE) + +# check if build was requested with a specifc ChibiOS version +if(DEFINED RTOS_VERSION) + if(NOT "${RTOS_VERSION}" STREQUAL "") + set(RTOS_VERSION_EMPTY FALSE) + endif() +endif() + +# check if build was requested with a specifc ChibiOS version +if(RTOS_VERSION_EMPTY) + # no ChibiOS version actualy specified, must be empty which is fine, we'll default to a known good version + # WHEN CHANGING THIS MAKE SURE TO UPDATE THE DEV CONTAINERS + # WHEN CHANGING THIS MAKE SURE TO UPDATE AzureRTOS\ST\CMakeLists.txt + set(RTOS_VERSION "stable_21.11.x") +endif() + +if(NO_CHIBIOS_SOURCE_FOLDER) + # no CHIBIOS source specified, download it from it's repo + message(STATUS "RTOS is: ChibiOS ${RTOS_VERSION} from SVN official repo") + + FetchContent_Declare( + chibios + SVN_REPOSITORY http://svn.code.sf.net/p/chibios/code/branches/${RTOS_VERSION} + SVN_REVISION -rHEAD + ) + +else() + # ChibiOS source was specified + + + message(STATUS "RTOS is: ChibiOS ${RTOS_VERSION} (source from: ${CHIBIOS_SOURCE_FOLDER})") + FetchContent_Declare( + chibios + SOURCE_DIR ${CHIBIOS_SOURCE_FOLDER} + ) + + +endif() + +# Check if population has already been performed +FetchContent_GetProperties(chibios) +if(NOT chibios_POPULATED) + # Fetch the content using previously declared details + FetchContent_Populate(chibios) +endif() + +if(CHIBIOS_CONTRIB_REQUIRED) + if(NO_CHIBIOS_CONTRIB_SOURCE) + # no CHIBIOS_CONTRIB source specified, download it from it's repo + + FetchContent_Declare( + chibios-contrib + GIT_REPOSITORY https://github.com/ChibiOS/ChibiOS-Contrib.git + GIT_TAG chibios-21.11.x + ) + + message(STATUS "ChibiOS-Contrib from GitHub repo") + + else() + # ChibiOS-Contrib source was specified + + message(STATUS "ChibiOS-Contrib (source from: ${CHIBIOS_CONTRIB_SOURCE})") + + FetchContent_Declare( + chibios-contrib + SOURCE_DIR ${CHIBIOS_CONTRIB_SOURCE} + ) + + endif() + + # Check if population has already been performed + FetchContent_GetProperties(chibios-contrib) + if(NOT chibios-contrib_POPULATED) + # Fetch the content using previously declared details + FetchContent_Populate(chibios-contrib) + endif() + +endif() + + +# include FatFS if SDCard or USB MSD are ON +if(NF_FEATURE_HAS_SDCARD OR NF_FEATURE_HAS_USB_MSD) + + # check if FATFS_SOURCE was specified or if it's empty (default is empty) + set(NO_FATFS_SOURCE TRUE) + if(FATFS_SOURCE) + if(NOT ${FATFS_SOURCE} STREQUAL "") + set(NO_FATFS_SOURCE FALSE) + endif() + endif() + + # FatFS version + set(FATFS_VERSION_EMPTY TRUE) + + # check if build was requested with a specifc FatFS version + if(DEFINED FATFS_VERSION) + if(NOT ${FATFS_VERSION} STREQUAL "") + set(FATFS_VERSION_EMPTY FALSE) + endif() + endif() + + # check if build was requested with a specifc FatFS version + if(FATFS_VERSION_EMPTY) + # no FatFS version actualy specified, must be empty which is fine, we'll default to a known good version + # WHEN CHANGING THIS MAKE SURE TO UPDATE THE DEV CONTAINERS + set(FATFS_VERSION_TAG "R0.15") + else() + # set version + set(FATFS_VERSION_TAG ${FATFS_VERSION}) + endif() + + if(NO_FATFS_SOURCE) + message(STATUS "FatFS ${FATFS_VERSION_TAG} from GitHub repo") + + FetchContent_Declare( + fatfs + GIT_REPOSITORY https://github.com/abbrev/fatfs.git + GIT_TAG ${FATFS_VERSION_TAG} + ) + + else() + # FatFS source was specified + + message(STATUS "FatFS ${FATFS_VERSION_TAG} source from: ${FATFS_SOURCE})") + + FetchContent_Declare( + fatfs + SOURCE_DIR ${FATFS_SOURCE} + ) + + endif() + + # Check if population has already been performed + FetchContent_GetProperties(fatfs) + if(NOT fatfs_POPULATED) + # Fetch the content using previously declared details + FetchContent_Populate(fatfs) + endif() + + # have to delete the ffconf.h template from the repo + execute_process( + COMMAND ${CMAKE_COMMAND} -E remove ${fatfs_SOURCE_DIR}/source/ffconf.h + ) + +endif() + +# if networking is enabled add lwIP to the build +if(USE_NETWORKING_OPTION) + + nf_add_lwip_library() + +endif() + + +# if Mbed TLS is enabled add it to the build +if(USE_SECURITY_MBEDTLS_OPTION OR NF_REQUIRES_MBEDTLS) + + nf_add_mbedtls_library() + +endif() + +# set target base location +# this has to be set before the class library modules are pulled in +if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/targets/ChibiOS/${TARGET_BOARD}) + # set target base location + set(TARGET_BASE_LOCATION ${CMAKE_SOURCE_DIR}/targets/ChibiOS/${TARGET_BOARD} CACHE INTERNAL "make global") +else() + # try to find board in the Community targets folder + if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}) + # set target base location + set(TARGET_BASE_LOCATION ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD} CACHE INTERNAL "make global") + else() + # board NOT found in targets folder + # can't continue + message(FATAL_ERROR "\n\nSorry but support for ${TARGET_BOARD} target is not available...\n\nYou can wait for that to be added or you might want to contribute and start working on a PR for that.\n\n") + endif() +endif() + +# set CMSIS RTOS include directory +include_directories( ${CMSIS_RTOS_INCLUDE_DIR}) + +# need to find board definition files (board.c and board.h) + +# start search in nanoFramework ChibiOS 'overlay' folder +if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/boards/${TARGET_BOARD}) + # board found + # if it's on nF overlay board.c and board.h exist there for sure + set(CHIBIOS_BOARD_DEFINITIONS_LOCATION "Board definition files taken from nanoFramework overlay" CACHE INTERNAL "Location of board definition files") + set(CHIBIOS_BOARD_DEFINITIONS_PATH ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/boards/${TARGET_BOARD} CACHE INTERNAL "Path of board definition files") +else() + # board NOT found in ChibiOS 'overlay' + + # try to find it in the target boards + if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/targets/ChibiOS/${TARGET_BOARD}) + # board found + # check if the board definition files are available at the target folder + if( EXISTS ${CMAKE_SOURCE_DIR}/targets/ChibiOS/${TARGET_BOARD}/board.c AND + EXISTS ${CMAKE_SOURCE_DIR}/targets/ChibiOS/${TARGET_BOARD}/board.h) + # definition files found + set(CHIBIOS_BOARD_DEFINITIONS_LOCATION "Board definition files taken from target folder" CACHE INTERNAL "Location of board definition files") + set(CHIBIOS_BOARD_DEFINITIONS_PATH ${CMAKE_SOURCE_DIR}/targets/ChibiOS/${TARGET_BOARD} CACHE INTERNAL "Path of board definition files") + + else() + # board.c and board.h are NOT in the target folder, try to find them in the official distribution + + if(IS_DIRECTORY ${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD}) + # board found + # if it's on the ChibiOS official distribution board.c and board.h exist here for sure + set(CHIBIOS_BOARD_DEFINITIONS_LOCATION "Board definition files taken from official ChibiOS distribution" CACHE INTERNAL "Location of board definition files") + set(CHIBIOS_BOARD_DEFINITIONS_PATH ${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD} CACHE INTERNAL "Path of board definition files") + + else() + # board NOT found in official distribution + # quit now as there is no were else to search for these + message(FATAL_ERROR "\n\nSorry but couldn't find definition files for ${TARGET_BOARD} in the available list of ChibiOS supported boards...\n\n") + + endif() + endif() + + else() + + # try to find board in the Community targets folder + if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}) + # set flag for this being a community board + set(IS_COMMUNITY_TARGET TRUE CACHE INTERNAL "Community target flag") + + + # check if the board definition files are available at the target folder + if( EXISTS ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}/board.c AND + EXISTS ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD}/board.h) + + # definition files found + set(CHIBIOS_BOARD_DEFINITIONS_LOCATION "Board definition files taken from Community Targets" CACHE INTERNAL "Location of board definition files") + set(CHIBIOS_BOARD_DEFINITIONS_PATH ${CMAKE_SOURCE_DIR}/targets-community/ChibiOS/${TARGET_BOARD} CACHE INTERNAL "Path of board definition files") + + else() + + # board.c and board.h are NOT in the target folder, try to find them in the official distribution + if(IS_DIRECTORY ${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD}) + # board found + # if it's on the ChibiOS official distribution board.c and board.h exist here for sure + set(CHIBIOS_BOARD_DEFINITIONS_LOCATION "Board definition files taken from official ChibiOS distribution" CACHE INTERNAL "Location of board definition files") + set(CHIBIOS_BOARD_DEFINITIONS_PATH ${chibios_SOURCE_DIR}/os/hal/boards/${TARGET_BOARD} CACHE INTERNAL "Path of board definition files") + + else() + # board NOT found in official distribution + # quit now as there is no were else to search for these + message(FATAL_ERROR "\n\nSorry but couldn't find definition files for ${TARGET_BOARD} in the available list of ChibiOS supported boards...\n\n") + + endif() + + endif() + + else() + # board NOT found in official distribution + # quit now as there is no were else to search for these + message(FATAL_ERROR "\n\nSorry but couldn't find definition files for ${TARGET_BOARD} in the available list of ChibiOS supported boards...\n\n") + endif() + + endif() + +endif() + +# (default is OFF so STM Cube package is NOT included) +option(STM32_CUBE_PACKAGE_REQUIRED "option to include STM Cube pcakge in the build") +if(STM32_CUBE_PACKAGE_REQUIRED) + ProcessSTM32CubePackage() +endif() + +# if support for SPIFFS is enabled add it to the build +if(NF_FEATURE_USE_SPIFFS) + + # check if SPIFFS_SOURCE was specified or if it's empty (default is empty) + set(NO_SPIFFS_SOURCE TRUE) + + if(SPIFFS_SOURCE) + if(NOT ${SPIFFS_SOURCE} STREQUAL "") + set(NO_SPIFFS_SOURCE FALSE) + endif() + endif() + + if(NO_SPIFFS_SOURCE) + # no SPIFFS source specified, download it from it's repo + message(STATUS "SPIFFS source from from GitHub repo") + + FetchContent_Declare( + spiffs + GIT_REPOSITORY https://github.com/nanoframework/spiffs + GIT_TAG "nf-build" + ) + + else() + # SPIFFS source was specified + + message(STATUS "SPIFFS source from: ${SPIFFS_SOURCE}") + + FetchContent_Declare( + spiffs + SOURCE_DIR ${SPIFFS_SOURCE} + ) + + endif() + + # Check if population has already been performed + FetchContent_GetProperties(spiffs) + if(NOT spiffs_POPULATED) + # Fetch the content using previously declared details + FetchContent_Populate(spiffs) + endif() + +endif() + +# add target ChibiOS dirs +add_subdirectory(_include) +add_subdirectory(_common) +add_subdirectory(_nanoBooter) +add_subdirectory(_nanoCLR) + +# board folder will be added in main CMakeList diff --git a/targets/ChibiOS/ORGPAL_PALTHREE/ffconf.h b/targets/ChibiOS/ORGPAL_PALTHREE/ffconf.h index 4bf2bd319f..6b5b16b213 100644 --- a/targets/ChibiOS/ORGPAL_PALTHREE/ffconf.h +++ b/targets/ChibiOS/ORGPAL_PALTHREE/ffconf.h @@ -80,7 +80,7 @@ / Locale and Namespace Configurations /---------------------------------------------------------------------------*/ -#define FF_CODE_PAGE 850 +#define FF_CODE_PAGE 437 /* This option specifies the OEM code page to be used on the target system. / Incorrect code page setting can cause a file open failure. / @@ -127,7 +127,7 @@ / memory for the working buffer, memory management functions, ff_memalloc() and / ff_memfree() exemplified in ffsystem.c, need to be added to the project. */ -#define FF_LFN_UNICODE 0 +#define FF_LFN_UNICODE 2 /* This option switches the character encoding on the API when LFN is enabled. / / 0: ANSI/OEM in current CP (TCHAR = char) @@ -138,8 +138,8 @@ / Also behavior of string I/O functions will be affected by this option. / When LFN is not enabled, this option has no effect. */ -#define FF_LFN_BUF 255 -#define FF_SFN_BUF 12 +#define FF_LFN_BUF 765 +#define FF_SFN_BUF 34 /* This set of options defines size of file name members in the FILINFO structure / which is used to read out directory items. These values should be suffcient for / the file names to read. The maximum possible length of the read file name depends diff --git a/targets/ChibiOS/ORGPAL_PALTHREE/nanoBooter/main.c b/targets/ChibiOS/ORGPAL_PALTHREE/nanoBooter/main.c index 55c7f00eef..9fc107bcd6 100644 --- a/targets/ChibiOS/ORGPAL_PALTHREE/nanoBooter/main.c +++ b/targets/ChibiOS/ORGPAL_PALTHREE/nanoBooter/main.c @@ -101,7 +101,7 @@ int main(void) // for nanoBooter we have to init it here to have access to network configuration blocks ConfigurationManager_Initialize(); - // report successfull nanoBooter execution + // report successful nanoBooter execution ReportSuccessfullNanoBooter(); // Normal main() thread diff --git a/targets/ChibiOS/ORGPAL_PALTHREE/nanoCLR/main.c b/targets/ChibiOS/ORGPAL_PALTHREE/nanoCLR/main.c index 631a4370fe..13f73ac955 100644 --- a/targets/ChibiOS/ORGPAL_PALTHREE/nanoCLR/main.c +++ b/targets/ChibiOS/ORGPAL_PALTHREE/nanoCLR/main.c @@ -17,7 +17,7 @@ #include #include -extern uint8_t hal_spiffs_config(); +extern int32_t hal_spiffs_config(); // need to declare the Receiver thread here osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread"); diff --git a/targets/ChibiOS/ST_NUCLEO64_F091RC/nanoBooter/main.c b/targets/ChibiOS/ST_NUCLEO64_F091RC/nanoBooter/main.c index 1b3670960b..b095499dcc 100644 --- a/targets/ChibiOS/ST_NUCLEO64_F091RC/nanoBooter/main.c +++ b/targets/ChibiOS/ST_NUCLEO64_F091RC/nanoBooter/main.c @@ -71,7 +71,7 @@ int main(void) BlockStorageList_Initialize(); BlockStorage_AddDevices(); - // report successfull nanoBooter execution + // report successful nanoBooter execution ReportSuccessfullNanoBooter(); // Normal main() thread diff --git a/targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoBooter/main.c b/targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoBooter/main.c index 0570e276ab..e00b0de7e0 100644 --- a/targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoBooter/main.c +++ b/targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoBooter/main.c @@ -87,7 +87,7 @@ int main(void) BlockStorageList_Initialize(); BlockStorage_AddDevices(); - // report successfull nanoBooter execution + // report successful nanoBooter execution ReportSuccessfullNanoBooter(); // Normal main() thread diff --git a/targets/ChibiOS/ST_STM32F769I_DISCOVERY/ffconf.h b/targets/ChibiOS/ST_STM32F769I_DISCOVERY/ffconf.h index 4bf2bd319f..6b5b16b213 100644 --- a/targets/ChibiOS/ST_STM32F769I_DISCOVERY/ffconf.h +++ b/targets/ChibiOS/ST_STM32F769I_DISCOVERY/ffconf.h @@ -80,7 +80,7 @@ / Locale and Namespace Configurations /---------------------------------------------------------------------------*/ -#define FF_CODE_PAGE 850 +#define FF_CODE_PAGE 437 /* This option specifies the OEM code page to be used on the target system. / Incorrect code page setting can cause a file open failure. / @@ -127,7 +127,7 @@ / memory for the working buffer, memory management functions, ff_memalloc() and / ff_memfree() exemplified in ffsystem.c, need to be added to the project. */ -#define FF_LFN_UNICODE 0 +#define FF_LFN_UNICODE 2 /* This option switches the character encoding on the API when LFN is enabled. / / 0: ANSI/OEM in current CP (TCHAR = char) @@ -138,8 +138,8 @@ / Also behavior of string I/O functions will be affected by this option. / When LFN is not enabled, this option has no effect. */ -#define FF_LFN_BUF 255 -#define FF_SFN_BUF 12 +#define FF_LFN_BUF 765 +#define FF_SFN_BUF 34 /* This set of options defines size of file name members in the FILINFO structure / which is used to read out directory items. These values should be suffcient for / the file names to read. The maximum possible length of the read file name depends diff --git a/targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoBooter/main.c b/targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoBooter/main.c index 55a305b4c5..241824b8a1 100644 --- a/targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoBooter/main.c +++ b/targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoBooter/main.c @@ -90,7 +90,7 @@ int main(void) // for nanoBooter we have to init it here to have access to network configuration blocks ConfigurationManager_Initialize(); - // report successfull nanoBooter execution + // report successful nanoBooter execution ReportSuccessfullNanoBooter(); // Normal main() thread diff --git a/targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoCLR/main.c b/targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoCLR/main.c index f4b3d4ea75..fcd425bdad 100644 --- a/targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoCLR/main.c +++ b/targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoCLR/main.c @@ -18,7 +18,7 @@ #include #include -extern uint8_t hal_spiffs_config(); +extern int32_t hal_spiffs_config(); // need to declare the Receiver thread here osThreadDef(ReceiverThread, osPriorityHigh, 2048, "ReceiverThread"); diff --git a/targets/ChibiOS/_FatFS/fatfs_diskio.c b/targets/ChibiOS/_FatFS/fatfs_diskio.c index 5c7c30afbf..8146eb5aa9 100644 --- a/targets/ChibiOS/_FatFS/fatfs_diskio.c +++ b/targets/ChibiOS/_FatFS/fatfs_diskio.c @@ -41,7 +41,7 @@ extern RTCDriver RTCD1; #define SDC 0 /*-----------------------------------------------------------------------*/ -/* Inidialize a Drive */ +/* Initialize a Drive */ DSTATUS disk_initialize(BYTE pdrv /* Physical drive number (0..) */ ) diff --git a/targets/ChibiOS/_FatFS/fatfs_syscall.c b/targets/ChibiOS/_FatFS/fatfs_syscall.c index b185d51dfe..7d5bdde6d0 100644 --- a/targets/ChibiOS/_FatFS/fatfs_syscall.c +++ b/targets/ChibiOS/_FatFS/fatfs_syscall.c @@ -1,9 +1,9 @@ // clang-format off -// chibios version can be found at: +// ChibiOs version can be found at: // https://github.com/ArduPilot/ChibiOS.svn/blob/master/os/various/fatfs_bindings/fatfs_syscall.c // but currently locked to R0.14b. -// This file aligns with comaptibility with R0.15+ +// This file aligns with compatibility with R0.15+ // And also allows use of nF specific capabilities. /*------------------------------------------------------------------------*/ diff --git a/targets/ChibiOS/_common/LaunchCLR.c b/targets/ChibiOS/_common/LaunchCLR.c index ba8c2cebaf..f5b051726a 100644 --- a/targets/ChibiOS/_common/LaunchCLR.c +++ b/targets/ChibiOS/_common/LaunchCLR.c @@ -15,7 +15,7 @@ void LaunchCLR(uint32_t address) // function pointer to load nanoCLR ResetHandler address irq_vector_t JumpToNanoCLR; - // report successfull nanoBooter execution + // report successful nanoBooter execution ReportSuccessfullNanoBooter(); // load nanoCLR vector table diff --git a/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp b/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp index 8efbbf895c..680d2f4f69 100644 --- a/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp +++ b/targets/ChibiOS/_common/targetHAL_ConfigurationManager.cpp @@ -476,7 +476,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return UpdateConfigurationResult_NoChanges; } @@ -507,7 +507,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return UpdateConfigurationResult_NoChanges; } @@ -536,7 +536,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return UpdateConfigurationResult_NoChanges; } @@ -567,7 +567,7 @@ __nfweak UpdateConfigurationResult ConfigurationManager_UpdateConfigurationBlock // free memory platform_free(configSectorCopy); - // operation is successfull (nothing to update) + // operation is successful (nothing to update) return UpdateConfigurationResult_NoChanges; } diff --git a/targets/ChibiOS/_include/Target_Windows_Storage.h b/targets/ChibiOS/_include/Target_Windows_Storage.h index 3c80d92d1a..c3daadb003 100644 --- a/targets/ChibiOS/_include/Target_Windows_Storage.h +++ b/targets/ChibiOS/_include/Target_Windows_Storage.h @@ -8,6 +8,13 @@ #include +#if (HAL_USE_SDC == TRUE) +#include +#else +// use copy of FATFS define ANSI/OEM at DBCS +#define FF_LFN_BUF 765 +#endif + #if defined(HAL_USBH_USE_MSD) && (HAL_USBH_USE_MSD == TRUE) #include "usbh/dev/msd.h" #endif diff --git a/targets/ChibiOS/_nanoCLR/System.Device.Dac/sys_dev_dac_native_System_Device_Dac_DacController.cpp b/targets/ChibiOS/_nanoCLR/System.Device.Dac/sys_dev_dac_native_System_Device_Dac_DacController.cpp index cfdeb6b9c8..6fddb94c65 100644 --- a/targets/ChibiOS/_nanoCLR/System.Device.Dac/sys_dev_dac_native_System_Device_Dac_DacController.cpp +++ b/targets/ChibiOS/_nanoCLR/System.Device.Dac/sys_dev_dac_native_System_Device_Dac_DacController.cpp @@ -7,7 +7,7 @@ #include "sys_dev_dac_native_target.h" //////////////////////////////////////////////////////////// -// DAC PAL strucs delcared in sys_dev_dac_native_target.h // +// DAC PAL structs declared in sys_dev_dac_native_target.h // //////////////////////////////////////////////////////////// #if STM32_DAC_USE_DAC1_CH1 NF_PAL_DAC Dac1_1_PAL; diff --git a/targets/ChibiOS/_nanoCLR/System.Device.Dac/sys_dev_dac_native_target.h b/targets/ChibiOS/_nanoCLR/System.Device.Dac/sys_dev_dac_native_target.h index 40b8877b35..c928431594 100644 --- a/targets/ChibiOS/_nanoCLR/System.Device.Dac/sys_dev_dac_native_target.h +++ b/targets/ChibiOS/_nanoCLR/System.Device.Dac/sys_dev_dac_native_target.h @@ -35,7 +35,7 @@ struct NF_PAL_DAC }; //////////////////////////////////////////// -// declaration of the the DAC PAL strucs // +// declaration of the the DAC PAL structs // //////////////////////////////////////////// #if STM32_DAC_USE_DAC1_CH1 extern NF_PAL_DAC Dac1_1_PAL; diff --git a/targets/ChibiOS/_nanoCLR/System.Device.I2c/sys_dev_i2c_native_System_Device_I2c_I2cDevice.cpp b/targets/ChibiOS/_nanoCLR/System.Device.I2c/sys_dev_i2c_native_System_Device_I2c_I2cDevice.cpp index 89945e8695..9c4fc0ff98 100644 --- a/targets/ChibiOS/_nanoCLR/System.Device.I2c/sys_dev_i2c_native_System_Device_I2c_I2cDevice.cpp +++ b/targets/ChibiOS/_nanoCLR/System.Device.I2c/sys_dev_i2c_native_System_Device_I2c_I2cDevice.cpp @@ -648,7 +648,7 @@ HRESULT Library_sys_dev_i2c_native_System_Device_I2c_I2cDevice:: } else { - // successfull transaction + // successful transaction // set the result field result[I2cTransferResult::FIELD___status].SetInteger((CLR_UINT32)I2cTransferStatus_FullTransfer); diff --git a/targets/ChibiOS/_nanoCLR/System.Device.Pwm/sys_dev_pwm_native_System_Device_Pwm_PwmChannel.cpp b/targets/ChibiOS/_nanoCLR/System.Device.Pwm/sys_dev_pwm_native_System_Device_Pwm_PwmChannel.cpp index 3de3efcf99..e561d827c2 100644 --- a/targets/ChibiOS/_nanoCLR/System.Device.Pwm/sys_dev_pwm_native_System_Device_Pwm_PwmChannel.cpp +++ b/targets/ChibiOS/_nanoCLR/System.Device.Pwm/sys_dev_pwm_native_System_Device_Pwm_PwmChannel.cpp @@ -219,8 +219,9 @@ int GetChannelPwm(int pin, int timerId) case 1 * 16 + 4: channel = 0; break; - case 7: // PA7, PB5 + case 7: // PA7, PB5, PC7 case 1 * 16 + 5: + case 2 * 16 + 7: channel = 1; break; case 1 * 16 + 0: // PB0 diff --git a/targets/ChibiOS/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h b/targets/ChibiOS/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h index 544cb35549..58690f6606 100644 --- a/targets/ChibiOS/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h +++ b/targets/ChibiOS/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h @@ -32,7 +32,7 @@ typedef struct } NF_PAL_UART; //////////////////////////////////////////// -// declaration of the the UART PAL strucs // +// declaration of the the UART PAL structs // //////////////////////////////////////////// #if defined(NF_SERIAL_COMM_STM32_UART_USE_USART1) && (NF_SERIAL_COMM_STM32_UART_USE_USART1 == TRUE) extern NF_PAL_UART Uart1_PAL; diff --git a/targets/ChibiOS/_nanoCLR/Windows.Storage/win_storage_native_Windows_Storage_StorageFolder.cpp b/targets/ChibiOS/_nanoCLR/Windows.Storage/win_storage_native_Windows_Storage_StorageFolder.cpp index 3b4054d0b9..5bb432c606 100644 --- a/targets/ChibiOS/_nanoCLR/Windows.Storage/win_storage_native_Windows_Storage_StorageFolder.cpp +++ b/targets/ChibiOS/_nanoCLR/Windows.Storage/win_storage_native_Windows_Storage_StorageFolder.cpp @@ -417,7 +417,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: { // 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 successful malloc if (stringBuffer == NULL || workingBuffer == NULL) @@ -460,7 +460,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: fileInfo.fname)); // clear working buffer - memset(workingBuffer, 0, 2 * FF_LFN_BUF + 1); + memset(workingBuffer, 0, FF_LFN_BUF + 1); // compose directory path CombinePath(workingBuffer, workingPath, fileInfo.fname); @@ -625,7 +625,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: // allocate memory for buffer, if not already done if (workingBuffer == NULL) { - workingBuffer = (char *)platform_malloc(2 * FF_LFN_BUF + 1); + workingBuffer = (char *)platform_malloc(FF_LFN_BUF + 1); // sanity check for successful malloc if (workingBuffer == NULL) @@ -659,7 +659,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: (const char *)pe->name)); // clear working buffer - memset(workingBuffer, 0, 2 * FF_LFN_BUF + 1); + memset(workingBuffer, 0, FF_LFN_BUF + 1); // compose file path CombinePath(workingBuffer, workingPath, (const char *)pe->name); @@ -743,7 +743,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: { // 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 successful malloc if (stringBuffer == NULL || workingBuffer == NULL) @@ -793,7 +793,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: fileInfo.fname)); // clear working buffer - memset(workingBuffer, 0, 2 * FF_LFN_BUF + 1); + memset(workingBuffer, 0, FF_LFN_BUF + 1); // compose file path CombinePath(workingBuffer, workingPath, fileInfo.fname); @@ -885,7 +885,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: if (fileCount > 0) { // allocate memory for buffer - workingBuffer = (char *)platform_malloc(2 * FF_LFN_BUF + 1); + workingBuffer = (char *)platform_malloc(FF_LFN_BUF + 1); // sanity check for successful malloc if (workingBuffer == NULL) @@ -916,7 +916,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: (const char *)pe->name)); // clear working buffer - memset(workingBuffer, 0, 2 * FF_LFN_BUF + 1); + memset(workingBuffer, 0, FF_LFN_BUF + 1); // compose file path CombinePath(workingBuffer, workingPath, (const char *)pe->name); @@ -1011,7 +1011,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: fileName = stack.Arg1().DereferenceString()->StringText(); // setup file path - filePath = (char *)platform_malloc(2 * FF_LFN_BUF + 1); + filePath = (char *)platform_malloc(FF_LFN_BUF + 1); // sanity check for successful malloc if (filePath == NULL) @@ -1021,7 +1021,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: } // clear working buffer - memset(filePath, 0, 2 * FF_LFN_BUF + 1); + memset(filePath, 0, FF_LFN_BUF + 1); // compose file path CombinePath(filePath, workingPath, fileName); @@ -1244,7 +1244,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: fileName = stack.Arg1().DereferenceString()->StringText(); // setup file path - filePath = (char *)platform_malloc(2 * FF_LFN_BUF + 1); + filePath = (char *)platform_malloc(FF_LFN_BUF + 1); // sanity check for successful malloc if (filePath == NULL) @@ -1254,7 +1254,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: } // clear working buffer - memset(filePath, 0, 2 * FF_LFN_BUF + 1); + memset(filePath, 0, FF_LFN_BUF + 1); // compose file path CombinePath(filePath, workingPath, fileName); @@ -1385,7 +1385,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: // get a pointer to the desired folder name folderName = stack.Arg1().DereferenceString()->StringText(); - folderPath = (char *)platform_malloc(2 * FF_LFN_BUF + 1); + folderPath = (char *)platform_malloc(FF_LFN_BUF + 1); // sanity check for successful malloc if (folderPath == NULL) @@ -1395,7 +1395,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: } // clear working buffer - memset(folderPath, 0, 2 * FF_LFN_BUF + 1); + memset(folderPath, 0, FF_LFN_BUF + 1); // compose folder path CombinePath(folderPath, workingPath, folderName); @@ -1687,7 +1687,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder::GetFolderNativ // get a pointer to the desired folder name folderName = stack.Arg1().DereferenceString()->StringText(); - folderPath = (char *)platform_malloc(2 * FF_LFN_BUF + 1); + folderPath = (char *)platform_malloc(FF_LFN_BUF + 1); // sanity check for successful malloc if (folderPath == NULL) @@ -1697,7 +1697,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder::GetFolderNativ } // clear working buffer - memset(folderPath, 0, 2 * FF_LFN_BUF + 1); + memset(folderPath, 0, FF_LFN_BUF + 1); // compose folder path CombinePath(folderPath, workingPath, folderName); diff --git a/targets/ChibiOS/_nanoCLR/nanoFramework.Device.Can/nf_device_can_native_nanoFramework_Device_Can_CanController.cpp b/targets/ChibiOS/_nanoCLR/nanoFramework.Device.Can/nf_device_can_native_nanoFramework_Device_Can_CanController.cpp index ab6d38883e..470ecaef0e 100644 --- a/targets/ChibiOS/_nanoCLR/nanoFramework.Device.Can/nf_device_can_native_nanoFramework_Device_Can_CanController.cpp +++ b/targets/ChibiOS/_nanoCLR/nanoFramework.Device.Can/nf_device_can_native_nanoFramework_Device_Can_CanController.cpp @@ -57,7 +57,7 @@ static void RxMessage(CANDriver *canp, uint32_t flags) } ///////////////////////////////////////////////////////// -// CAN PAL strucs delcared in nf_device_can_native.h // +// CAN PAL structs declared in nf_device_can_native.h // ///////////////////////////////////////////////////////// #if defined(STM32_CAN_USE_CAN1) && (STM32_CAN_USE_CAN1 == TRUE) NF_PAL_CAN Can1_PAL; @@ -101,7 +101,7 @@ HRESULT Library_nf_device_can_native_nanoFramework_Device_Can_CanController:: .NumericByRefConst() .u1); - // get message to transmite + // get message to transmit message = pMessage[Library_nf_device_can_native_nanoFramework_Device_Can_CanMessage::FIELD___message] .DereferenceArray(); @@ -109,7 +109,7 @@ HRESULT Library_nf_device_can_native_nanoFramework_Device_Can_CanController:: if (message->m_numOfElements > 8) NANOCLR_SET_AND_LEAVE(CLR_E_OUT_OF_RANGE); - // compose the transmite packet to send + // compose the transmit packet to send if (message != NULL) { // copy message to structure diff --git a/targets/ChibiOS/_nanoCLR/nanoFramework.Device.Can/nf_device_can_native_target.h b/targets/ChibiOS/_nanoCLR/nanoFramework.Device.Can/nf_device_can_native_target.h index 9930ebbd91..c310bbf337 100644 --- a/targets/ChibiOS/_nanoCLR/nanoFramework.Device.Can/nf_device_can_native_target.h +++ b/targets/ChibiOS/_nanoCLR/nanoFramework.Device.Can/nf_device_can_native_target.h @@ -22,7 +22,7 @@ typedef struct } NF_PAL_CAN; /////////////////////////////////////////// -// declaration of the CAN PAL strucs // +// declaration of the CAN PAL structs // /////////////////////////////////////////// #if defined(STM32_CAN_USE_CAN1) && (STM32_CAN_USE_CAN1 == TRUE) extern NF_PAL_CAN Can1_PAL; diff --git a/targets/ChibiOS/_spiffs/CMakeLists.txt b/targets/ChibiOS/_spiffs/CMakeLists.txt deleted file mode 100644 index ee87b10f2d..0000000000 --- a/targets/ChibiOS/_spiffs/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -# -# Copyright (c) .NET Foundation and Contributors -# See LICENSE file in the project root for full license information. -# - -# include SPIFFS sources, if feature is enabled -if(NF_FEATURE_USE_SPIFFS) - list(APPEND TARGET_CHIBIOS_COMMON_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/hal_spiffs.c) - list(APPEND TARGET_CHIBIOS_COMMON_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}) -endif() - -# make var global -set(TARGET_CHIBIOS_COMMON_SOURCES ${TARGET_CHIBIOS_COMMON_SOURCES} CACHE INTERNAL "make global") -set(TARGET_CHIBIOS_COMMON_INCLUDE_DIRS ${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS} CACHE INTERNAL "make global") diff --git a/targets/ChibiOS/_spiffs/hal_spiffs.c b/targets/ChibiOS/_spiffs/hal_spiffs.c index 27776059d0..77f08ee8ab 100644 --- a/targets/ChibiOS/_spiffs/hal_spiffs.c +++ b/targets/ChibiOS/_spiffs/hal_spiffs.c @@ -50,9 +50,9 @@ int32_t hal_spiffs_format(int32_t index) } // initialization of SPIFFS: configurations, data structures, drivers and lock -uint8_t hal_spiffs_config() +int32_t hal_spiffs_config() { - uint8_t mountResult; + int32_t mountResult = 0; // low level hardware and drivers initializations target_spiffs_init(); @@ -99,7 +99,7 @@ uint8_t hal_spiffs_config() if (mountResult != SPIFFS_OK && SPIFFS_errno(&fs[i]) == SPIFFS_ERR_NOT_A_FS) { // looks like SPIFFS is not formated - hal_spiffs_format(i); + mountResult = hal_spiffs_format(i); } #if !defined(BUILD_RTM) diff --git a/targets/ChibiOS/_spiffs/hal_spiffs.h b/targets/ChibiOS/_spiffs/hal_spiffs.h index 09471ff24c..44e8b91031 100644 --- a/targets/ChibiOS/_spiffs/hal_spiffs.h +++ b/targets/ChibiOS/_spiffs/hal_spiffs.h @@ -70,7 +70,7 @@ extern "C" int32_t hal_spiffs_get_instances_count(); // declarations of hal/target implementations - uint8_t hal_spiffs_config(); + int32_t hal_spiffs_config(); int32_t hal_spiffs_format(int32_t index); #if SPIFFS_SINGLETON diff --git a/targets/ESP32/CMakeLists.txt b/targets/ESP32/CMakeLists.txt index 9e3c02aa73..06bfda5ab7 100644 --- a/targets/ESP32/CMakeLists.txt +++ b/targets/ESP32/CMakeLists.txt @@ -60,7 +60,7 @@ endif() # WHEN CHANGING THIS MAKE SURE TO UPDATE: # 1. the dev containers # 2. ref in AZDO pipeline yaml in Community Targets repo -set(ESP32_IDF_TAG "4.4.6" CACHE INTERNAL "ESP32 IDF tag") +set(ESP32_IDF_TAG "4.4.7" CACHE INTERNAL "ESP32 IDF tag") if(NO_ESP32_IDF_PATH) # no ESP32 IDF source specified, download it from official repo diff --git a/targets/ESP32/ESP32/ffconf.h b/targets/ESP32/ESP32/ffconf.h index 0dbd625ead..7c30107e42 100644 --- a/targets/ESP32/ESP32/ffconf.h +++ b/targets/ESP32/ESP32/ffconf.h @@ -134,7 +134,7 @@ / 3: Enable LFN with dynamic working buffer on the HEAP. / / To enable the LFN, ffunicode.c needs to be added to the project. The LFN function -/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and +/ requires certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and / additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled. / The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can / be in range of 12 to 255. It is recommended to be set 255 to fully support LFN @@ -277,7 +277,7 @@ #define FF_NORTC_MON 1 #define FF_NORTC_MDAY 1 #define FF_NORTC_YEAR 2018 -/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have +/* The option FF_FS_NORTC switches timestamp function. If the system does not have / any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable / the timestamp function. Every object modified by FatFs will have a fixed timestamp / defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time. diff --git a/targets/ESP32/ESP32_C3/ffconf.h b/targets/ESP32/ESP32_C3/ffconf.h index 0dbd625ead..7c30107e42 100644 --- a/targets/ESP32/ESP32_C3/ffconf.h +++ b/targets/ESP32/ESP32_C3/ffconf.h @@ -134,7 +134,7 @@ / 3: Enable LFN with dynamic working buffer on the HEAP. / / To enable the LFN, ffunicode.c needs to be added to the project. The LFN function -/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and +/ requires certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and / additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled. / The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can / be in range of 12 to 255. It is recommended to be set 255 to fully support LFN @@ -277,7 +277,7 @@ #define FF_NORTC_MON 1 #define FF_NORTC_MDAY 1 #define FF_NORTC_YEAR 2018 -/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have +/* The option FF_FS_NORTC switches timestamp function. If the system does not have / any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable / the timestamp function. Every object modified by FatFs will have a fixed timestamp / defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time. diff --git a/targets/ESP32/ESP32_S2/ffconf.h b/targets/ESP32/ESP32_S2/ffconf.h index 0dbd625ead..7c30107e42 100644 --- a/targets/ESP32/ESP32_S2/ffconf.h +++ b/targets/ESP32/ESP32_S2/ffconf.h @@ -134,7 +134,7 @@ / 3: Enable LFN with dynamic working buffer on the HEAP. / / To enable the LFN, ffunicode.c needs to be added to the project. The LFN function -/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and +/ requires certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and / additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled. / The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can / be in range of 12 to 255. It is recommended to be set 255 to fully support LFN @@ -277,7 +277,7 @@ #define FF_NORTC_MON 1 #define FF_NORTC_MDAY 1 #define FF_NORTC_YEAR 2018 -/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have +/* The option FF_FS_NORTC switches timestamp function. If the system does not have / any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable / the timestamp function. Every object modified by FatFs will have a fixed timestamp / defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time. diff --git a/targets/ESP32/ESP32_S3/ffconf.h b/targets/ESP32/ESP32_S3/ffconf.h index 0dbd625ead..7c30107e42 100644 --- a/targets/ESP32/ESP32_S3/ffconf.h +++ b/targets/ESP32/ESP32_S3/ffconf.h @@ -134,7 +134,7 @@ / 3: Enable LFN with dynamic working buffer on the HEAP. / / To enable the LFN, ffunicode.c needs to be added to the project. The LFN function -/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and +/ requires certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and / additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled. / The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can / be in range of 12 to 255. It is recommended to be set 255 to fully support LFN @@ -277,7 +277,7 @@ #define FF_NORTC_MON 1 #define FF_NORTC_MDAY 1 #define FF_NORTC_YEAR 2018 -/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have +/* The option FF_FS_NORTC switches timestamp function. If the system does not have / any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable / the timestamp function. Every object modified by FatFs will have a fixed timestamp / defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time. diff --git a/targets/ESP32/_nanoCLR/System.Device.Adc/sys_dev_adc_native_System_Device_Adc_AdcController.cpp b/targets/ESP32/_nanoCLR/System.Device.Adc/sys_dev_adc_native_System_Device_Adc_AdcController.cpp index b63a4f72be..5dd018ef9f 100644 --- a/targets/ESP32/_nanoCLR/System.Device.Adc/sys_dev_adc_native_System_Device_Adc_AdcController.cpp +++ b/targets/ESP32/_nanoCLR/System.Device.Adc/sys_dev_adc_native_System_Device_Adc_AdcController.cpp @@ -39,7 +39,7 @@ HRESULT Library_sys_dev_adc_native_System_Device_Adc_AdcController::NativeOpenCh esp_err_t result; // default to MAX bit width for SoC adc_bits_width_t width_bit = (adc_bits_width_t)SOC_ADC_MAX_BITWIDTH; - adc_atten_t atten = ADC_ATTEN_DB_11; + adc_atten_t atten = ADC_ATTEN_DB_12; // get a pointer to the managed object instance and check that it's not NULL CLR_RT_HeapBlock *pThis = stack.This(); diff --git a/targets/ESP32/_nanoCLR/System.Device.I2s/sys_dev_i2s_native_System_Device_I2s_I2sDevice.cpp b/targets/ESP32/_nanoCLR/System.Device.I2s/sys_dev_i2s_native_System_Device_I2s_I2sDevice.cpp index 95b6d9ae7c..16c77526fd 100644 --- a/targets/ESP32/_nanoCLR/System.Device.I2s/sys_dev_i2s_native_System_Device_I2s_I2sDevice.cpp +++ b/targets/ESP32/_nanoCLR/System.Device.I2s/sys_dev_i2s_native_System_Device_I2s_I2sDevice.cpp @@ -239,7 +239,7 @@ HRESULT SetI2sConfig(i2s_port_t bus, CLR_RT_HeapBlock *config) if (mode & I2S_MODE_ADC_BUILT_IN) { // TODO - make attenuation configurable? - adc_atten_t atten = ADC_ATTEN_DB_11; + adc_atten_t atten = ADC_ATTEN_DB_12; // TODO Re-use logic in ADC? int channelNumber = -1; diff --git a/targets/ESP32/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_Directory.cpp b/targets/ESP32/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_Directory.cpp index 4a558ba646..177491bb0e 100644 --- a/targets/ESP32/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_Directory.cpp +++ b/targets/ESP32/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_Directory.cpp @@ -236,9 +236,9 @@ HRESULT BuildPathsArray(const char *vfsFolderPath, const char *folderPath, CLR_R // 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 @@ -269,7 +269,7 @@ HRESULT BuildPathsArray(const char *vfsFolderPath, const char *folderPath, CLR_R if ((fileInfo->d_type & entryType) && (strcmp(get_filename_ext(fileInfo->d_name), "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->d_name); diff --git a/targets/ESP32/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_File.cpp b/targets/ESP32/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_File.cpp index 45e4071568..a9b2ecbcd9 100644 --- a/targets/ESP32/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_File.cpp +++ b/targets/ESP32/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_File.cpp @@ -38,9 +38,9 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_File::ExistsNative___STATIC__BOOL // TODO don't really need to pass in path & filename, whole path would have been OK for ESP32 // 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 @@ -48,7 +48,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_File::ExistsNative___STATIC__BOOL } // clear working buffer - filePath[0] = 0; + memset(filePath, 0, FF_LFN_BUF + 1); // compose file path CombinePathAndName(filePath, workingPath, fileName); diff --git a/targets/ESP32/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_FileStream.cpp b/targets/ESP32/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_FileStream.cpp index a2b248ff2a..e76c480625 100644 --- a/targets/ESP32/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_FileStream.cpp +++ b/targets/ESP32/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_System_IO_FileStream.cpp @@ -3,7 +3,7 @@ // See LICENSE file in the project root for full license information. // -#include "nf_sys_io_filesystem.h" +#include #include #include @@ -28,9 +28,9 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::OpenFileNative___VOID 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 @@ -38,7 +38,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::OpenFileNative___VOID } // clear working buffer - filePath[0] = 0; + memset(filePath, 0, FF_LFN_BUF + 1); // compose file path CombinePathAndName(filePath, workingPath, fileName); @@ -164,9 +164,9 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::ReadNative___I4__STRI buffer = pArray->GetFirstElement(); // 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 @@ -174,7 +174,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::ReadNative___I4__STRI } // clear working buffer - filePath[0] = 0; + memset(filePath, 0, FF_LFN_BUF + 1); // combine file path & file name CombinePathAndName(filePath, workingPath, fileName); @@ -256,9 +256,9 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::WriteNative___VOID__S buffer = pArray->GetFirstElement(); // setup file path - filePath = (char *)platform_malloc(2 * FF_LFN_BUF + 1); + filePath = (char *)platform_malloc(FF_LFN_BUF + 1); - // sanity check for successfull mallocs + // sanity check for successful mallocs if (filePath == NULL) { // failed to allocate memory @@ -266,7 +266,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::WriteNative___VOID__S } // clear working buffer - filePath[0] = 0; + memset(filePath, 0, FF_LFN_BUF + 1); // compose file path CombinePathAndName(filePath, workingPath, fileName); @@ -338,9 +338,9 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::GetLengthNative___I8_ 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 @@ -348,7 +348,7 @@ HRESULT Library_nf_sys_io_filesystem_System_IO_FileStream::GetLengthNative___I8_ } // clear working buffer - filePath[0] = 0; + memset(filePath, 0, FF_LFN_BUF + 1); // compose file path CombinePathAndName(filePath, workingPath, fileName); diff --git a/targets/ESP32/_nanoCLR/Windows.Storage/win_storage_native_Windows_Storage_StorageFolder.cpp b/targets/ESP32/_nanoCLR/Windows.Storage/win_storage_native_Windows_Storage_StorageFolder.cpp index 8c5c6e3f5d..e7c8d73a68 100644 --- a/targets/ESP32/_nanoCLR/Windows.Storage/win_storage_native_Windows_Storage_StorageFolder.cpp +++ b/targets/ESP32/_nanoCLR/Windows.Storage/win_storage_native_Windows_Storage_StorageFolder.cpp @@ -9,6 +9,13 @@ #include #include +#if (HAL_USE_SDC == TRUE) || (HAL_USBH_USE_MSD == TRUE) +#include +#else +// use copy of FATFS define ANSI/OEM at DBCS +#define FF_LFN_BUF 765 +#endif + // // Converts from windows type path "c:\folder\folder\file.ext" // to linux type path used in ESP32 VFS "/c/folder/folder/file.exe @@ -390,7 +397,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: { // 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 successful malloc if (stringBuffer == NULL || workingBuffer == NULL) @@ -431,7 +438,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: dirInfo->d_name)); // clear working buffer - memset(workingBuffer, 0, 2 * FF_LFN_BUF + 1); + memset(workingBuffer, 0, FF_LFN_BUF + 1); // compose return directory path CombinePath(workingBuffer, managedPath, (const char *)dirInfo->d_name); @@ -575,7 +582,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: { // 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 successful malloc if (stringBuffer == NULL || workingBuffer == NULL) @@ -623,7 +630,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: dirInfo->d_name)); // clear working buffer - memset(workingBuffer, 0, 2 * FF_LFN_BUF + 1); + memset(workingBuffer, 0, FF_LFN_BUF + 1); // compose file path CombinePath(workingBuffer, managedPath, (const char *)dirInfo->d_name); @@ -729,7 +736,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: fileName = stack.Arg1().DereferenceString()->StringText(); // setup file path - filePath = (char *)platform_malloc(2 * FF_LFN_BUF + 1); + filePath = (char *)platform_malloc(FF_LFN_BUF + 1); // sanity check for successful malloc if (filePath == NULL) @@ -739,7 +746,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: } // clear working buffer - memset(filePath, 0, 2 * FF_LFN_BUF + 1); + memset(filePath, 0, FF_LFN_BUF + 1); // compose file path CombinePath(filePath, managedPath, fileName); @@ -887,7 +894,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: // get a pointer to the desired folder name folderName = stack.Arg1().DereferenceString()->StringText(); - folderPath = (char *)platform_malloc(2 * FF_LFN_BUF + 1); + folderPath = (char *)platform_malloc(FF_LFN_BUF + 1); // sanity check for successful malloc if (folderPath == NULL) @@ -897,7 +904,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: } // clear working buffer - memset(folderPath, 0, 2 * FF_LFN_BUF + 1); + memset(folderPath, 0, FF_LFN_BUF + 1); // compose folder path CombinePath(folderPath, managedPath, folderName); @@ -1140,7 +1147,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder::GetFolderNativ // get a pointer to the desired folder name folderName = stack.Arg1().DereferenceString()->StringText(); - folderPath = (char *)platform_malloc(2 * FF_LFN_BUF + 1); + folderPath = (char *)platform_malloc(FF_LFN_BUF + 1); // sanity check for successful malloc if (folderPath == NULL) @@ -1150,7 +1157,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder::GetFolderNativ } // clear working buffer - memset(folderPath, 0, 2 * FF_LFN_BUF + 1); + memset(folderPath, 0, FF_LFN_BUF + 1); // compose folder path CombinePath(folderPath, managedPath, folderName); diff --git a/targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/nanoBooter/main.c b/targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/nanoBooter/main.c index 7a3c35bec7..c7a4e703c4 100644 --- a/targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/nanoBooter/main.c +++ b/targets/FreeRTOS/NXP/NXP_MIMXRT1060_EVK/nanoBooter/main.c @@ -98,7 +98,7 @@ int main(void) // for nanoBooter we have to init it here to have access to network configuration blocks ConfigurationManager_Initialize(); - // report successfull nanoBooter execution + // report successful nanoBooter execution ReportSuccessfullNanoBooter(); xTaskCreate(blink_task, "blink_task", configMINIMAL_STACK_SIZE + 10, NULL, configMAX_PRIORITIES - 1, NULL); diff --git a/targets/FreeRTOS/NXP/_fatfs/diskio.c b/targets/FreeRTOS/NXP/_fatfs/diskio.c index 3ae6366413..e4b756f158 100644 --- a/targets/FreeRTOS/NXP/_fatfs/diskio.c +++ b/targets/FreeRTOS/NXP/_fatfs/diskio.c @@ -24,7 +24,7 @@ /*-----------------------------------------------------------------------*/ DSTATUS disk_status ( - BYTE pdrv /* Physical drive nmuber to identify the drive */ + BYTE pdrv /* Physical drive number to identify the drive */ ) { DSTATUS stat; @@ -37,11 +37,11 @@ DSTATUS disk_status ( /*-----------------------------------------------------------------------*/ -/* Inidialize a Drive */ +/* Initialize a Drive */ /*-----------------------------------------------------------------------*/ DSTATUS disk_initialize ( - BYTE pdrv /* Physical drive nmuber to identify the drive */ + BYTE pdrv /* Physical drive number to identify the drive */ ) { DSTATUS stat; @@ -57,7 +57,7 @@ DSTATUS disk_initialize ( /*-----------------------------------------------------------------------*/ DRESULT disk_read ( - BYTE pdrv, /* Physical drive nmuber to identify the drive */ + BYTE pdrv, /* Physical drive number to identify the drive */ BYTE *buff, /* Data buffer to store read data */ DWORD sector, /* Start sector in LBA */ UINT count /* Number of sectors to read */ @@ -78,7 +78,7 @@ DRESULT disk_read ( #if FF_FS_READONLY == 0 DRESULT disk_write ( - BYTE pdrv, /* Physical drive nmuber to identify the drive */ + BYTE pdrv, /* Physical drive number to identify the drive */ const BYTE *buff, /* Data to be written */ DWORD sector, /* Start sector in LBA */ UINT count /* Number of sectors to write */ @@ -98,7 +98,7 @@ DRESULT disk_write ( /*-----------------------------------------------------------------------*/ DRESULT disk_ioctl ( - BYTE pdrv, /* Physical drive nmuber (0..) */ + BYTE pdrv, /* Physical drive number (0..) */ BYTE cmd, /* Control code */ void *buff /* Buffer to send/receive control data */ ) diff --git a/targets/FreeRTOS/NXP/_fatfs/ffconf.h b/targets/FreeRTOS/NXP/_fatfs/ffconf.h index 303f98640a..53457dcf1c 100644 --- a/targets/FreeRTOS/NXP/_fatfs/ffconf.h +++ b/targets/FreeRTOS/NXP/_fatfs/ffconf.h @@ -82,7 +82,7 @@ / Locale and Namespace Configurations /---------------------------------------------------------------------------*/ -#define FF_CODE_PAGE 850 +#define FF_CODE_PAGE 437 /* This option specifies the OEM code page to be used on the target system. / Incorrect code page setting can cause a file open failure. / @@ -120,7 +120,7 @@ / 3: Enable LFN with dynamic working buffer on the HEAP. / / To enable the LFN, ffunicode.c needs to be added to the project. The LFN function -/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and +/ requires certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and / additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled. / The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can / be in range of 12 to 255. It is recommended to be set it 255 to fully support LFN @@ -129,7 +129,7 @@ / memory for the working buffer, memory management functions, ff_memalloc() and / ff_memfree() exemplified in ffsystem.c, need to be added to the project. */ -#define FF_LFN_UNICODE 0 +#define FF_LFN_UNICODE 2 /* This option switches the character encoding on the API when LFN is enabled. / / 0: ANSI/OEM in current CP (TCHAR = char) @@ -140,8 +140,8 @@ / Also behavior of string I/O functions will be affected by this option. / When LFN is not enabled, this option has no effect. */ -#define FF_LFN_BUF 255 -#define FF_SFN_BUF 12 +#define FF_LFN_BUF 765 +#define FF_SFN_BUF 34 /* This set of options defines size of file name members in the FILINFO structure / which is used to read out directory items. These values should be suffcient for / the file names to read. The maximum possible length of the read file name depends diff --git a/targets/FreeRTOS/NXP/_fatfs/ffsystem.c b/targets/FreeRTOS/NXP/_fatfs/ffsystem.c index 604887da02..5c918214a4 100644 --- a/targets/FreeRTOS/NXP/_fatfs/ffsystem.c +++ b/targets/FreeRTOS/NXP/_fatfs/ffsystem.c @@ -1,6 +1,6 @@ // clang-format off -// This file aligns with comaptibility with R0.15+ +// This file aligns with compatibility with R0.15+ // It currently includes commented out code which would allow a fully // platform independent solution. diff --git a/targets/FreeRTOS/NXP/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp b/targets/FreeRTOS/NXP/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp index 53a1f863d4..1909318ed3 100644 --- a/targets/FreeRTOS/NXP/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp +++ b/targets/FreeRTOS/NXP/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp @@ -6,7 +6,7 @@ #include "sys_io_ser_native_target.h" ///////////////////////////////////////////////////////// -// UART PAL strucs delcared in win_dev_serial_native.h // +// UART PAL structs declared in win_dev_serial_native.h // ///////////////////////////////////////////////////////// static LPUART_Type *const lpuart_bases[] = LPUART_BASE_PTRS; diff --git a/targets/FreeRTOS/NXP/_nanoCLR/Windows.Storage/win_storage_native_Windows_Storage_StorageFolder.cpp b/targets/FreeRTOS/NXP/_nanoCLR/Windows.Storage/win_storage_native_Windows_Storage_StorageFolder.cpp index e8158630e8..4a2c7b20c8 100644 --- a/targets/FreeRTOS/NXP/_nanoCLR/Windows.Storage/win_storage_native_Windows_Storage_StorageFolder.cpp +++ b/targets/FreeRTOS/NXP/_nanoCLR/Windows.Storage/win_storage_native_Windows_Storage_StorageFolder.cpp @@ -126,7 +126,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: // malloc stringBuffer to work with FS char *stringBuffer = (char *)platform_malloc(FF_LFN_BUF + 1); - // sanity check for successfull malloc + // sanity check for successful malloc if (stringBuffer == NULL) { // failed to allocate memory @@ -275,9 +275,9 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: { // 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 @@ -318,7 +318,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: fileInfo.fname)); // clear working buffer - memset(workingBuffer, 0, 2 * FF_LFN_BUF + 1); + memset(workingBuffer, 0, FF_LFN_BUF + 1); // compose directory path CombinePath(workingBuffer, workingPath, fileInfo.fname); @@ -468,9 +468,9 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: { // 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 @@ -518,7 +518,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: fileInfo.fname)); // clear working buffer - memset(workingBuffer, 0, 2 * FF_LFN_BUF + 1); + memset(workingBuffer, 0, FF_LFN_BUF + 1); // compose file path CombinePath(workingBuffer, workingPath, fileInfo.fname); @@ -672,9 +672,9 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: { // 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 @@ -682,7 +682,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: } // clear working buffer - memset(filePath, 0, 2 * FF_LFN_BUF + 1); + memset(filePath, 0, FF_LFN_BUF + 1); // compose file path CombinePath(filePath, workingPath, fileName); @@ -780,9 +780,9 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: storageFile = stack.TopValue().Dereference(); // 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 @@ -790,7 +790,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: } // clear working buffer - memset(filePath, 0, 2 * FF_LFN_BUF + 1); + memset(filePath, 0, FF_LFN_BUF + 1); // compose file path CombinePath(filePath, workingPath, fileName); @@ -857,9 +857,9 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: // get a pointer to the desired folder name folderName = stack.Arg1().DereferenceString()->StringText(); - folderPath = (char *)platform_malloc(2 * FF_LFN_BUF + 1); + folderPath = (char *)platform_malloc(FF_LFN_BUF + 1); - // sanity check for successfull malloc + // sanity check for successful malloc if (folderPath == NULL) { // failed to allocate memory @@ -867,7 +867,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder:: } // clear working buffer - memset(folderPath, 0, 2 * FF_LFN_BUF + 1); + memset(folderPath, 0, FF_LFN_BUF + 1); // compose folder path CombinePath(folderPath, workingPath, folderName); @@ -1109,9 +1109,9 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder::GetFolderNativ // get a pointer to the desired folder name folderName = stack.Arg1().DereferenceString()->StringText(); - folderPath = (char *)platform_malloc(2 * FF_LFN_BUF + 1); + folderPath = (char *)platform_malloc(FF_LFN_BUF + 1); - // sanity check for successfull malloc + // sanity check for successful malloc if (folderPath == NULL) { // failed to allocate memory @@ -1119,7 +1119,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder::GetFolderNativ } // clear working buffer - memset(folderPath, 0, 2 * FF_LFN_BUF + 1); + memset(folderPath, 0, FF_LFN_BUF + 1); // compose folder path CombinePath(folderPath, workingPath, folderName); diff --git a/targets/TI_SimpleLink/_nanoCLR/System.Device.I2c/sys_dev_i2c_native_System_Device_I2c_I2cDevice.cpp b/targets/TI_SimpleLink/_nanoCLR/System.Device.I2c/sys_dev_i2c_native_System_Device_I2c_I2cDevice.cpp index b48ddf46ec..035fe906bf 100644 --- a/targets/TI_SimpleLink/_nanoCLR/System.Device.I2c/sys_dev_i2c_native_System_Device_I2c_I2cDevice.cpp +++ b/targets/TI_SimpleLink/_nanoCLR/System.Device.I2c/sys_dev_i2c_native_System_Device_I2c_I2cDevice.cpp @@ -10,7 +10,7 @@ typedef Library_sys_dev_i2c_native_System_Device_I2c_I2cTransferResult I2cTransf typedef Library_corlib_native_System_SpanByte SpanByte; ///////////////////////////////////////////////////// -// I2C PAL strucs declared in sys_dev_i2c_native.h // +// I2C PAL structs declared in sys_dev_i2c_native.h // ///////////////////////////////////////////////////// NF_PAL_I2C I2C1_PAL; @@ -263,7 +263,7 @@ HRESULT Library_sys_dev_i2c_native_System_Device_I2c_I2cDevice:: result = top.Dereference(); FAULT_ON_NULL(result); - // successfull transaction + // successful transaction // set the result field result[Library_win_dev_i2c_native_Windows_Devices_I2c_I2cTransferResult::FIELD___status].SetInteger( (CLR_UINT32)I2cTransferStatus_FullTransfer); diff --git a/targets/TI_SimpleLink/_nanoCLR/System.Device.I2c/sys_dev_i2c_native_target.h b/targets/TI_SimpleLink/_nanoCLR/System.Device.I2c/sys_dev_i2c_native_target.h index 5333ed39e1..5c27480489 100644 --- a/targets/TI_SimpleLink/_nanoCLR/System.Device.I2c/sys_dev_i2c_native_target.h +++ b/targets/TI_SimpleLink/_nanoCLR/System.Device.I2c/sys_dev_i2c_native_target.h @@ -20,7 +20,7 @@ typedef struct } NF_PAL_I2C; /////////////////////////////////////////// -// declaration of the the I2C PAL strucs // +// declaration of the the I2C PAL structs // /////////////////////////////////////////// extern NF_PAL_I2C I2C1_PAL; diff --git a/targets/TI_SimpleLink/_nanoCLR/System.Device.Spi/cpu_spi.cpp b/targets/TI_SimpleLink/_nanoCLR/System.Device.Spi/cpu_spi.cpp index f4c3b8bb22..310f1e0487 100644 --- a/targets/TI_SimpleLink/_nanoCLR/System.Device.Spi/cpu_spi.cpp +++ b/targets/TI_SimpleLink/_nanoCLR/System.Device.Spi/cpu_spi.cpp @@ -30,7 +30,7 @@ struct NF_PAL_SPI }; ///////////////////////////////////////////////////// -// SPI PAL strucs declared in win_dev_spi_native.h // +// SPI PAL structs declared in win_dev_spi_native.h // ///////////////////////////////////////////////////// NF_PAL_SPI SPI1_PAL; diff --git a/targets/TI_SimpleLink/_nanoCLR/System.Device.Spi/sys_dev_spi_native_target.h b/targets/TI_SimpleLink/_nanoCLR/System.Device.Spi/sys_dev_spi_native_target.h index a4b1caeb0d..0bcd04c7ec 100644 --- a/targets/TI_SimpleLink/_nanoCLR/System.Device.Spi/sys_dev_spi_native_target.h +++ b/targets/TI_SimpleLink/_nanoCLR/System.Device.Spi/sys_dev_spi_native_target.h @@ -22,7 +22,7 @@ struct NF_PAL_SPI }; /////////////////////////////////////////// -// declaration of the the SPI PAL strucs // +// declaration of the the SPI PAL structs // /////////////////////////////////////////// extern NF_PAL_SPI SPI1_PAL; diff --git a/targets/TI_SimpleLink/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp b/targets/TI_SimpleLink/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp index 1751c76214..67df09b097 100644 --- a/targets/TI_SimpleLink/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp +++ b/targets/TI_SimpleLink/_nanoCLR/System.IO.Ports/sys_io_ser_native_System_IO_Ports_SerialPort.cpp @@ -7,7 +7,7 @@ #include "sys_io_ser_native_target.h" //////////////////////////////////////////////////////////// -// UART PAL strucs delcared in sys_io_ser_native_target.h // +// UART PAL structs declared in sys_io_ser_native_target.h // //////////////////////////////////////////////////////////// #if defined(NF_SERIAL_COMM_TI_USE_UART1) && (NF_SERIAL_COMM_TI_USE_UART1 == TRUE) NF_PAL_UART Uart1_PAL; diff --git a/targets/TI_SimpleLink/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h b/targets/TI_SimpleLink/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h index 5be1c825e7..0954408b3d 100644 --- a/targets/TI_SimpleLink/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h +++ b/targets/TI_SimpleLink/_nanoCLR/System.IO.Ports/sys_io_ser_native_target.h @@ -37,7 +37,7 @@ typedef struct } NF_PAL_UART; //////////////////////////////////////////// -// declaration of the the UART PAL strucs // +// declaration of the the UART PAL structs // //////////////////////////////////////////// #if defined(NF_SERIAL_COMM_TI_USE_UART1) && (NF_SERIAL_COMM_TI_USE_UART1 == TRUE) extern NF_PAL_UART Uart1_PAL;