Skip to content

Commit

Permalink
Output EDBG parameter values in debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
navnavnav committed Jan 21, 2023
1 parent b5dfa4a commit 0583283
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 0583283

Please sign in to comment.