Skip to content

Commit

Permalink
Add Support for Storage Operations (#2901)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellerbach authored Mar 21, 2024
1 parent aa74772 commit e79c5fa
Show file tree
Hide file tree
Showing 48 changed files with 616 additions and 149 deletions.
1 change: 1 addition & 0 deletions CMake/AzureRTOS_target_os.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define DP_FLOATINGPOINT @TARGET_DP_FLOATINGPOINT@
#define SUPPORT_ANY_BASE_CONVERSION @TARGET_SUPPORT_ANY_BASE_CONVERSION@
#define HAS_CONFIG_BLOCK @TARGET_HAS_CONFIG_BLOCK@
#define HAS_ACCESSIBLE_STORAGE @TARGET_HAS_ACCESSIBLE_STORAGE@
#define NANOCLR_REFLECTION @TARGET_NANOCLR_REFLECTION@
#define NANOCLR_SYSTEM_COLLECTIONS @TARGET_SYSTEM_COLLECTIONS@
#define TARGET_HAS_NANOBOOTER @TARGET_HAS_NANOBOOTER@
Expand Down
1 change: 1 addition & 0 deletions CMake/ChibiOS_target_os.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define DP_FLOATINGPOINT @TARGET_DP_FLOATINGPOINT@
#define SUPPORT_ANY_BASE_CONVERSION @TARGET_SUPPORT_ANY_BASE_CONVERSION@
#define HAS_CONFIG_BLOCK @TARGET_HAS_CONFIG_BLOCK@
#define HAS_ACCESSIBLE_STORAGE @TARGET_HAS_ACCESSIBLE_STORAGE@
#define NANOCLR_REFLECTION @TARGET_NANOCLR_REFLECTION@
#define NANOCLR_SYSTEM_COLLECTIONS @TARGET_SYSTEM_COLLECTIONS@
#define TARGET_HAS_NANOBOOTER @TARGET_HAS_NANOBOOTER@
Expand Down
1 change: 1 addition & 0 deletions CMake/ESP32_target_os.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define DP_FLOATINGPOINT @TARGET_DP_FLOATINGPOINT@
#define SUPPORT_ANY_BASE_CONVERSION @TARGET_SUPPORT_ANY_BASE_CONVERSION@
#define HAS_CONFIG_BLOCK @TARGET_HAS_CONFIG_BLOCK@
#define HAS_ACCESSIBLE_STORAGE @TARGET_HAS_ACCESSIBLE_STORAGE@
#define NANOCLR_REFLECTION @TARGET_NANOCLR_REFLECTION@
#define NANOCLR_SYSTEM_COLLECTIONS @TARGET_SYSTEM_COLLECTIONS@
#define TARGET_HAS_NANOBOOTER FALSE
Expand Down
1 change: 1 addition & 0 deletions CMake/FreeRTOS_target_os.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#define DP_FLOATINGPOINT @TARGET_DP_FLOATINGPOINT@
#define SUPPORT_ANY_BASE_CONVERSION @TARGET_SUPPORT_ANY_BASE_CONVERSION@
#define HAS_CONFIG_BLOCK @TARGET_HAS_CONFIG_BLOCK@
#define HAS_ACCESSIBLE_STORAGE @TARGET_HAS_ACCESSIBLE_STORAGE@
#define NANOCLR_REFLECTION @TARGET_NANOCLR_REFLECTION@
#define NANOCLR_SYSTEM_COLLECTIONS @TARGET_SYSTEM_COLLECTIONS@
#define TARGET_HAS_NANOBOOTER @TARGET_HAS_NANOBOOTER@
Expand Down
1 change: 1 addition & 0 deletions CMake/TI_SimpleLink_target_os.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define DP_FLOATINGPOINT @TARGET_DP_FLOATINGPOINT@
#define SUPPORT_ANY_BASE_CONVERSION @TARGET_SUPPORT_ANY_BASE_CONVERSION@
#define HAS_CONFIG_BLOCK @TARGET_HAS_CONFIG_BLOCK@
#define HAS_ACCESSIBLE_STORAGE @TARGET_HAS_ACCESSIBLE_STORAGE@
#define NANOCLR_REFLECTION @TARGET_NANOCLR_REFLECTION@
#define NANOCLR_SYSTEM_COLLECTIONS @TARGET_SYSTEM_COLLECTIONS@
#define TARGET_HAS_NANOBOOTER FALSE
Expand Down
3 changes: 2 additions & 1 deletion CMake/binutils.ChibiOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ macro(nf_add_platform_include_directories target)
${TARGET_CMSIS_COMMON_INCLUDE_DIRS}
${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS}
${lWIP_INCLUDE_DIRS}
${SPIFFS_INCLUDE_DIRS}

)

# includes specific to nanoBooter
Expand All @@ -243,7 +245,6 @@ macro(nf_add_platform_include_directories target)
target_include_directories(${target}.elf PUBLIC

${TARGET_CHIBIOS_NANOBOOTER_INCLUDE_DIRS}

)

endif()
Expand Down
1 change: 1 addition & 0 deletions CMake/xtensa-esp32.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"TARGET_SERIES": "ESP32",
"TARGET_BOARD": "ESP32",
"NF_FEATURE_HAS_CONFIG_BLOCK": "ON",
"NF_FEATURE_HAS_ACCESSIBLE_STORAGE": "ON",
"SUPPORT_ANY_BASE_CONVERSION": "ON",
"API_System.Net": "ON",
"API_System.Math": "ON",
Expand Down
1 change: 1 addition & 0 deletions CMake/xtensa-esp32c3.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"TARGET_SERIES": "ESP32_C3",
"TARGET_BOARD": "ESP32_C3",
"NF_FEATURE_HAS_CONFIG_BLOCK": "ON",
"NF_FEATURE_HAS_ACCESSIBLE_STORAGE": "ON",
"SUPPORT_ANY_BASE_CONVERSION": "ON",
"API_System.Net": "ON",
"API_System.Math": "ON",
Expand Down
1 change: 1 addition & 0 deletions CMake/xtensa-esp32s2.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"TARGET_SERIES": "ESP32_S2",
"TARGET_BOARD": "ESP32_S2",
"NF_FEATURE_HAS_CONFIG_BLOCK": "ON",
"NF_FEATURE_HAS_ACCESSIBLE_STORAGE": "ON",
"SUPPORT_ANY_BASE_CONVERSION": "ON",
"API_System.Net": "ON",
"API_System.Math": "ON",
Expand Down
1 change: 1 addition & 0 deletions CMake/xtensa-esp32s3.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"TARGET_SERIES": "ESP32_S3",
"TARGET_BOARD": "ESP32_S3",
"NF_FEATURE_HAS_CONFIG_BLOCK": "ON",
"NF_FEATURE_HAS_ACCESSIBLE_STORAGE": "ON",
"SUPPORT_ANY_BASE_CONVERSION": "ON",
"API_System.Net": "ON",
"API_System.Math": "ON",
Expand Down
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,19 @@ else()
message(STATUS "Configuration block storage **IS NOT** included")
endif()

#################################################################
# enables internal storage support
# (default is OFF so Accessible Storage Feature is NOT supported)
option(NF_FEATURE_HAS_ACCESSIBLE_STORAGE "option to enable accessible storage")

if(NF_FEATURE_HAS_ACCESSIBLE_STORAGE)
set(TARGET_HAS_ACCESSIBLE_STORAGE TRUE CACHE INTERNAL "Option for accessible storage")
message(STATUS "Accessible Storage feature is included")
else()
set(TARGET_HAS_ACCESSIBLE_STORAGE FALSE CACHE INTERNAL "Option for accessible storage")
message(STATUS "Accessible Storage feature **IS NOT** included")
endif()

#################################################################
# enables support for SD Card
# (default is OFF so SD Card is NOT supported)
Expand Down
22 changes: 22 additions & 0 deletions src/CLR/Debugger/Debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "Debugger.h"
#include <corlib_native.h>
#include <target_common.h>
#include <nanoHAL_StorageOperation.h>

#define __min(a, b) (((a) < (b)) ? (a) : (b))

Expand Down Expand Up @@ -1335,6 +1336,27 @@ bool CLR_DBG_Debugger::Monitor_UpdateConfiguration(WP_Message *message)
#endif
}

bool CLR_DBG_Debugger::Monitor_StorageOperation(WP_Message *message)
{
NATIVE_PROFILE_CLR_DEBUGGER();

#if (HAS_ACCESSIBLE_STORAGE == TRUE)

Monitor_StorageOperation_Command *cmd = (Monitor_StorageOperation_Command *)message->m_payload;
Monitor_StorageOperation_Reply cmdReply;

cmdReply.ErrorCode = HAL_StorageOperation(cmd->Operation, cmd->NameLength, cmd->DataLength, cmd->Offset, cmd->Data);

WP_ReplyToCommand(message, true, false, &cmdReply, sizeof(cmdReply));

return true;

#endif

(void)message;
return false;
}

//--//

bool CLR_DBG_Debugger::Debugging_Execution_BasePtr(WP_Message *msg)
Expand Down
Loading

0 comments on commit e79c5fa

Please sign in to comment.