Skip to content

Commit

Permalink
Merge pull request #345 from NordicSemiconductor/feature/remove-pagin…
Browse files Browse the repository at this point in the history
…ation

Remove pagination
  • Loading branch information
Jonas authored Feb 23, 2023
2 parents 0087268 + ed78ca7 commit edbd8ed
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 3.0.7 - 2023-02-23

### Fixed

- Writing some hex files used to fail if they had data near forbidden areas
like the UICR and similar.

## 3.0.6 - 2023-02-14

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pc-nrfconnect-programmer",
"version": "3.0.6",
"version": "3.0.7",
"displayName": "Programmer",
"description": "Tool for flash programming of nRF SoCs",
"homepage": "https://github.com/NordicSemiconductor/pc-nrfconnect-programmer",
Expand Down
17 changes: 8 additions & 9 deletions src/actions/jlinkTargetActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,19 @@ const getDeviceMemMap = async (deviceId: number, coreInfo: CoreDefinition) =>
}

const buffer = (result as FirmwareReadResult).buffer || '';

const hextText = Buffer.from(buffer, 'base64').toString('utf8');

let memMap = MemoryMap.fromHex(hextText);
const hexText = Buffer.from(buffer, 'base64').toString('utf8');
const memMap = MemoryMap.fromHex(hexText);

const paddedArray = memMap.slicePad(
0,
coreInfo.romBaseAddr + coreInfo.romSize
);
memMap = MemoryMap.fromPaddedUint8Array(paddedArray);
const paddedMemMap =
MemoryMap.fromPaddedUint8Array(paddedArray);
logger.info(
`Reading memory for ${coreInfo.name} core completed`
);
resolve(memMap);
resolve(paddedMemMap);
},
() => {},
null,
Expand Down Expand Up @@ -479,12 +478,12 @@ export const writeOneCore =
overlaps.delete(key);
}
});

if (overlaps.size <= 0) {
return undefined;
}
const programRegions = MemoryMap.flattenOverlaps(overlaps).paginate(
coreInfo.pageSize
);

const programRegions = MemoryMap.flattenOverlaps(overlaps);

await writeHex(deviceId, coreInfo, programRegions.asHexString());
logger.info(`Writing procedure ends for ${coreInfo.name} core`);
Expand Down

0 comments on commit edbd8ed

Please sign in to comment.