Skip to content

Commit

Permalink
Fixed bug where we were incorrectly offsetting flash reads (see #40)
Browse files Browse the repository at this point in the history
  • Loading branch information
navnavnav committed May 14, 2022
1 parent 814b98d commit 158a32a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1376,8 +1376,12 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
int pagesRequired = static_cast<int>(bytes / pageSize);
TargetMemoryBuffer memoryBuffer;

for (auto i = 1; i <= pagesRequired; i++) {
auto pageBuffer = this->readMemory(type, startAddress + (pageSize * i), pageSize);
for (auto i = 0; i < pagesRequired; i++) {
auto pageBuffer = this->readMemory(
type,
startAddress + static_cast<std::uint32_t>(pageSize * i),
pageSize
);
memoryBuffer.insert(memoryBuffer.end(), pageBuffer.begin(), pageBuffer.end());
}

Expand Down

0 comments on commit 158a32a

Please sign in to comment.