From ed78ca737dd83779296b0dc67a6e352a9bb06699 Mon Sep 17 00:00:00 2001 From: Jonas Fritzke Emdal Date: Thu, 23 Feb 2023 13:53:08 +0100 Subject: [PATCH] Remove pagination --- Changelog.md | 7 +++++++ package.json | 2 +- src/actions/jlinkTargetActions.ts | 17 ++++++++--------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Changelog.md b/Changelog.md index 8f9456b5..0ebbabbb 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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 diff --git a/package.json b/package.json index 3467a307..3d15c22b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/actions/jlinkTargetActions.ts b/src/actions/jlinkTargetActions.ts index aa063ac3..b91293b1 100644 --- a/src/actions/jlinkTargetActions.ts +++ b/src/actions/jlinkTargetActions.ts @@ -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, @@ -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`);