From 8cb60f442b80f9a8051c4fbd61ac25265918b5f1 Mon Sep 17 00:00:00 2001 From: Nav Date: Sun, 27 Feb 2022 20:40:40 +0000 Subject: [PATCH] Fixed bug with EDBG AVR8 WriteMemory command having an inflated payload --- .../EDBG/AVR/CommandFrames/AVR8Generic/WriteMemory.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/AVR8Generic/WriteMemory.hpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/AVR8Generic/WriteMemory.hpp index ca174a2c..0923bd9c 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/AVR8Generic/WriteMemory.hpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/AVR8Generic/WriteMemory.hpp @@ -21,7 +21,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::CommandFrames * 6. Asynchronous flag (0x00 for "write first, then reply" and 0x01 for "reply first, then write") * 7. Buffer */ - this->payload = std::vector(12 + buffer.size(), 0x00); + this->payload = std::vector(12, 0x00); this->payload[0] = 0x23; this->payload[1] = 0x00; this->payload[2] = static_cast(type); @@ -39,7 +39,7 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::CommandFrames // We always set the async flag to 0x00 ("write first, then reply") this->payload[11] = 0x00; - this->payload.insert(this->payload.begin() + 12, buffer.begin(), buffer.end()); + this->payload.insert(this->payload.end(), buffer.begin(), buffer.end()); } }; }