Added support for flash memory inspection
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
|
||||
#include "src/Exceptions/Exception.hpp"
|
||||
|
||||
namespace Bloom
|
||||
{
|
||||
using Services::TargetControllerService;
|
||||
@@ -11,6 +13,10 @@ namespace Bloom
|
||||
void WriteTargetMemory::run(TargetControllerService& targetControllerService) {
|
||||
using Targets::TargetMemorySize;
|
||||
|
||||
if (!this->memoryDescriptor.access.writeableDuringDebugSession) {
|
||||
throw Exceptions::Exception("Invalid request - cannot write to this memory type during a debug session.");
|
||||
}
|
||||
|
||||
/*
|
||||
* To prevent locking up the TargetController for too long, we split the write operation into numerous
|
||||
* operations.
|
||||
@@ -20,7 +26,7 @@ namespace Bloom
|
||||
*/
|
||||
const auto maxBlockSize = std::max(
|
||||
TargetMemorySize(256),
|
||||
memoryDescriptor.pageSize.value_or(TargetMemorySize(0))
|
||||
this->memoryDescriptor.pageSize.value_or(TargetMemorySize(0))
|
||||
);
|
||||
|
||||
const TargetMemorySize totalBytesToWrite = std::accumulate(
|
||||
|
||||
Reference in New Issue
Block a user