From 28ffee0b2f6579dc0abf11cfaa7c5444adc37816 Mon Sep 17 00:00:00 2001 From: josesimoes Date: Thu, 12 Nov 2020 14:14:26 +0000 Subject: [PATCH] Add nanoBooter flag to ping flags - Following nanoframework/nf-debugger#257. --- src/CLR/Debugger/Debugger.cpp | 5 +++++ src/CLR/Include/WireProtocol.h | 3 +++ .../ChibiOS/nanoBooter/WireProtocol_MonitorCommands.c | 5 +++++ .../FreeRTOS/NXP/nanoBooter/WireProtocol_MonitorCommands.c | 4 ++++ 4 files changed, 17 insertions(+) diff --git a/src/CLR/Debugger/Debugger.cpp b/src/CLR/Debugger/Debugger.cpp index a78b64a789..86503462d7 100644 --- a/src/CLR/Debugger/Debugger.cpp +++ b/src/CLR/Debugger/Debugger.cpp @@ -404,6 +404,11 @@ bool CLR_DBG_Debugger::Monitor_Ping(WP_Message *msg) #endif // capability flags + if (::Target_HasNanoBooter()) + { + cmdReply.Flags |= Monitor_Ping_c_HasNanoBooter; + } + if (::Target_HasProprietaryBooter()) { cmdReply.Flags |= Monitor_Ping_c_HasProprietaryBooter; diff --git a/src/CLR/Include/WireProtocol.h b/src/CLR/Include/WireProtocol.h index c79fda34eb..deebd81865 100644 --- a/src/CLR/Include/WireProtocol.h +++ b/src/CLR/Include/WireProtocol.h @@ -185,6 +185,9 @@ typedef enum Monitor_Ping_Source_Flags // This flag indicates that the device requires that the configuration block to be erased before updating it. Monitor_Ping_c_ConfigBlockRequiresErase = 0x00040000, + // This flag indicates that the device has nanoBooter. + Monitor_Ping_c_HasNanoBooter = 0x00080000, + }Monitor_Ping_Source_Flags; // structure to hold nanoFramework release information diff --git a/targets/CMSIS-OS/ChibiOS/nanoBooter/WireProtocol_MonitorCommands.c b/targets/CMSIS-OS/ChibiOS/nanoBooter/WireProtocol_MonitorCommands.c index 1557f4091d..238744efee 100644 --- a/targets/CMSIS-OS/ChibiOS/nanoBooter/WireProtocol_MonitorCommands.c +++ b/targets/CMSIS-OS/ChibiOS/nanoBooter/WireProtocol_MonitorCommands.c @@ -92,6 +92,11 @@ int Monitor_Ping(WP_Message *message) cmdReply.Flags |= Monitor_Ping_c_PacketSize_1024; #endif + if (Target_HasNanoBooter()) + { + cmdReply.Flags |= Monitor_Ping_c_HasNanoBooter; + } + if (Target_HasProprietaryBooter()) { cmdReply.Flags |= Monitor_Ping_c_HasProprietaryBooter; diff --git a/targets/FreeRTOS/NXP/nanoBooter/WireProtocol_MonitorCommands.c b/targets/FreeRTOS/NXP/nanoBooter/WireProtocol_MonitorCommands.c index ad1de888da..892ab99764 100644 --- a/targets/FreeRTOS/NXP/nanoBooter/WireProtocol_MonitorCommands.c +++ b/targets/FreeRTOS/NXP/nanoBooter/WireProtocol_MonitorCommands.c @@ -87,6 +87,10 @@ int Monitor_Ping(WP_Message *message) #elif (WP_PACKET_SIZE == 1024) cmdReply.Flags |= Monitor_Ping_c_PacketSize_1024; #endif + if (Target_HasNanoBooter()) + { + cmdReply.Flags |= Monitor_Ping_c_HasNanoBooter; + } if (Target_HasProprietaryBooter()) {