Output EDBG parameter values in debug logs

This commit is contained in:
Nav
2023-01-21 13:54:40 +00:00
parent b5dfa4a842
commit 05832839f0
2 changed files with 8 additions and 2 deletions

View File

@@ -14,8 +14,8 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::CommandFrames
* The set param command consists of value.size() + 5 bytes. The first five bytes consist of:
* 1. Command ID (0x01)
* 2. Version (0x00)
* 3. Param context (Avr8Parameter::context)
* 4. Param ID (Avr8Parameter::id)
* 3. Param context (Avr8EdbgParameter::context)
* 4. Param ID (Avr8EdbgParameter::id)
* 5. Param value length (value.size()) - this is only one byte in size, so its value should
* never exceed 255.
*/

View File

@@ -5,6 +5,7 @@
#include "src/Logger/Logger.hpp"
#include "src/Helpers/Paths.hpp"
#include "src/Helpers/String.hpp"
#include "src/Exceptions/InvalidConfig.hpp"
#include "src/TargetController/Exceptions/DeviceInitializationFailure.hpp"
@@ -987,6 +988,11 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
SetParameter(parameter, value)
);
Logger::debug(
"Setting AVR8 EDBG parameter (context: 0x" + String::toHex(parameter.context) + ", id: 0x"
+ String::toHex(parameter.id) + ", value: 0x" + String::toHex(value) + ")"
);
if (responseFrame.id == Avr8ResponseId::FAILED) {
throw Avr8CommandFailure("Failed to set parameter on device!", responseFrame);
}