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()); } }; }