Skip to content

Commit 19c1531

Browse files
authored
Merge pull request #156 from NordicSemiconductor/fix/program-51-with-uicr
Fix programming nRF51 device with UICR
2 parents edc58d2 + c62bb9c commit 19c1531

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/actions/jlinkTargetActions.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ export const writeOneCore = core => async (dispatch, getState) => {
399399
logger.info(`Writing procedure starts for core${core.coreNumber}`);
400400
dispatch(targetActions.writingStartAction());
401401
const {
402-
target: { serialNumber },
402+
target: { serialNumber, deviceInfo: { family } },
403403
file: { memMaps },
404404
} = getState().app;
405405
const { pageSize, uicrBaseAddr } = core;
@@ -432,8 +432,11 @@ export const writeOneCore = core => async (dispatch, getState) => {
432432
// In case the hex files include UICR, we need to erase that from the
433433
// device and avoid resetting, that will be done by pc-nrfjprog-js
434434
if ([...programRegions.keys()].find(addr => addr >= uicrBaseAddr) !== undefined) {
435+
const chipEraseMode = family === 'nRF51'
436+
? nrfjprog.ERASE_PAGES
437+
: nrfjprog.ERASE_PAGES_INCLUDING_UICR;
435438
await writeHex(serialNumberWithCore, programRegions.asHexString(64), {
436-
chip_erase_mode: nrfjprog.ERASE_PAGES_INCLUDING_UICR,
439+
chip_erase_mode: chipEraseMode,
437440
reset: false,
438441
});
439442
} else {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pc-nrfconnect-programmer",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Program a Nordic SoC with HEX files from nRF Connect",
55
"displayName": "Programmer",
66
"repository": {

0 commit comments

Comments
 (0)