From 00fb357ccfd1720b572ceb3de80007973f22ca82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Mon, 16 Jul 2018 17:36:58 +0100 Subject: [PATCH] Add support for target reporting if it has nanoBooter (#785) --- src/CLR/Debugger/Debugger.cpp | 5 +++++ src/CLR/Include/nanoCLR_Debugging.h | 1 + targets/CMSIS-OS/ChibiOS/Include/targetHAL.h | 2 ++ targets/FreeRTOS/ESP32_DevKitC/Include/targetHAL.h | 2 ++ targets/os/win32/Include/targetHAL.h | 2 ++ 5 files changed, 12 insertions(+) diff --git a/src/CLR/Debugger/Debugger.cpp b/src/CLR/Debugger/Debugger.cpp index 3ff2490c45..741971bf72 100644 --- a/src/CLR/Debugger/Debugger.cpp +++ b/src/CLR/Debugger/Debugger.cpp @@ -1041,6 +1041,11 @@ bool CLR_DBG_Debugger::Debugging_Execution_QueryCLRCapabilities( WP_Message* msg reply.u_capsFlags |= CLR_DBG_Commands::Debugging_Execution_QueryCLRCapabilities::c_CapabilityFlags_ConfigBlockRequiresErase; } + if (::Target_HasNanoBooter()) + { + reply.u_capsFlags |= CLR_DBG_Commands::Debugging_Execution_QueryCLRCapabilities::c_CapabilityFlags_HasNanoBooter; + } + data = (CLR_UINT8*)&reply.u_capsFlags; size = sizeof(reply.u_capsFlags); break; diff --git a/src/CLR/Include/nanoCLR_Debugging.h b/src/CLR/Include/nanoCLR_Debugging.h index 18b0c2ae32..c96e3958e8 100644 --- a/src/CLR/Include/nanoCLR_Debugging.h +++ b/src/CLR/Include/nanoCLR_Debugging.h @@ -282,6 +282,7 @@ struct CLR_DBG_Commands static const CLR_UINT32 c_CapabilityFlags_Profiling_Calls = 0x00000100; static const CLR_UINT32 c_CapabilityFlags_ThreadCreateEx = 0x00000400; static const CLR_UINT32 c_CapabilityFlags_ConfigBlockRequiresErase = 0x00000800; + static const CLR_UINT32 c_CapabilityFlags_HasNanoBooter = 0x00001000; CLR_UINT32 m_cmd; diff --git a/targets/CMSIS-OS/ChibiOS/Include/targetHAL.h b/targets/CMSIS-OS/ChibiOS/Include/targetHAL.h index 2e97763885..64c50b56be 100644 --- a/targets/CMSIS-OS/ChibiOS/Include/targetHAL.h +++ b/targets/CMSIS-OS/ChibiOS/Include/targetHAL.h @@ -45,6 +45,8 @@ inline void HARD_Breakpoint() { }; #endif // !defined(BUILD_RTM) +inline bool Target_HasNanoBooter() { return true; }; + #define NANOCLR_STOP() CPU_Reset(); inline void HAL_AssertEx() diff --git a/targets/FreeRTOS/ESP32_DevKitC/Include/targetHAL.h b/targets/FreeRTOS/ESP32_DevKitC/Include/targetHAL.h index 45df77a335..da6332d3a7 100644 --- a/targets/FreeRTOS/ESP32_DevKitC/Include/targetHAL.h +++ b/targets/FreeRTOS/ESP32_DevKitC/Include/targetHAL.h @@ -53,6 +53,8 @@ inline void HARD_Breakpoint() { }; #endif // !defined(BUILD_RTM) +inline bool Target_HasNanoBooter() { return false; }; + #define NANOCLR_STOP() HARD_BREAKPOINT() inline void HAL_AssertEx() diff --git a/targets/os/win32/Include/targetHAL.h b/targets/os/win32/Include/targetHAL.h index 1ada5c0c88..bdd4237ca6 100644 --- a/targets/os/win32/Include/targetHAL.h +++ b/targets/os/win32/Include/targetHAL.h @@ -44,4 +44,6 @@ inline bool Target_ConfigUpdateRequiresErase() #endif // !defined(BUILD_RTM) +inline bool Target_HasNanoBooter() { return false; }; + #endif //_TARGET_HAL_H_