Skip to content

Commit f2cef8d

Browse files
Merge pull request #568 from NordicSemiconductor/push-uxrroyuvqnvk
Fix: Incorrect warning for nRF9151 modem FW files
2 parents ff8421e + e7310bf commit f2cef8d

File tree

4 files changed

+123
-9
lines changed

4 files changed

+123
-9
lines changed

Changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 4.7.2 - Unreleased
2+
3+
### Fixed
4+
5+
- Issue with incorrect warning "Unexpected file name detected" that would appear
6+
for nRF9151 modem firmware files with variant suffixes (for example,
7+
`mfw_nrf9151-ntn_1.0.0-1.alpha.zip`).
8+
19
## 4.7.1 - 2025-12-18
210

311
### Fixed

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": "4.7.1",
3+
"version": "4.7.2",
44
"displayName": "Programmer",
55
"description": "Tool for flash programming Nordic SoCs and SiPs",
66
"homepage": "https://github.com/NordicSemiconductor/pc-nrfconnect-programmer",

src/components/ModemUpdateDialogView.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ import {
2929
} from '../reducers/modemReducer';
3030
import { WithRequired } from '../util/types';
3131

32+
export const isValidNrf9160FirmwareName = (filename: string | undefined) =>
33+
!filename || /mfw_nrf9160_\d+\.\d+\.\d+.*.zip/.test(filename);
34+
35+
export const isValidNrf91x1FirmwareName = (filename: string | undefined) =>
36+
!filename ||
37+
/mfw_nrf91x1_\d+\.\d+\.\d+.*.zip/.test(filename) ||
38+
/mfw.*nrf91.1(-\w+)?_\d+\.\d+\.\d+.*.zip/.test(filename);
39+
3240
const ModemUpdateDialogView = () => {
3341
const abortController = useRef(new AbortController());
3442
const [progress, setProgress] =
@@ -61,17 +69,12 @@ const ModemUpdateDialogView = () => {
6169

6270
if (is9160) {
6371
expectedFileName = 'mfw_nrf9160_X.X.X*.zip';
64-
expectedFwName =
65-
!modemFwName || /mfw_nrf9160_\d+\.\d+\.\d+.*.zip/.test(modemFwName);
72+
expectedFwName = isValidNrf9160FirmwareName(modemFwName);
6673
url =
6774
'https://www.nordicsemi.com/Products/Development-hardware/nrf9160-dk/download#infotabs';
6875
} else if (is91x1) {
69-
expectedFileName = 'mfw_nrf91x1_X.X.X*.zip';
70-
expectedFwName =
71-
!modemFwName ||
72-
/mfw_nrf91x1_\d+\.\d+\.\d+.*.zip/.test(modemFwName) ||
73-
// DECT mfw
74-
/mfw.*nrf91.1_\d+\.\d+\.\d+\.zip/.test(modemFwName);
76+
expectedFileName = 'mfw_nrf91?1*_X.X.X*.zip';
77+
expectedFwName = isValidNrf91x1FirmwareName(modemFwName);
7578
url = 'https://www.nordicsemi.com/Products/nRF9161/Download';
7679
}
7780

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
5+
*/
6+
7+
import {
8+
isValidNrf91x1FirmwareName,
9+
isValidNrf9160FirmwareName,
10+
} from '../ModemUpdateDialogView';
11+
12+
describe('Modem firmware filename validation', () => {
13+
describe('nRF9160 firmware names', () => {
14+
it('accepts names from https://www.nordicsemi.com/Products/nRF9160/Download', () => {
15+
expect(isValidNrf9160FirmwareName('mfw_nrf9160_1.1.0.zip')).toBe(
16+
true,
17+
);
18+
expect(isValidNrf9160FirmwareName('mfw_nrf9160_1.3.7.zip')).toBe(
19+
true,
20+
);
21+
});
22+
23+
it('accepts undefined as valid (no file selected)', () => {
24+
expect(isValidNrf9160FirmwareName(undefined)).toBe(true);
25+
});
26+
27+
describe('invalid names', () => {
28+
it('rejects wrong prefix', () => {
29+
expect(isValidNrf9160FirmwareName('fw_nrf9160_1.0.0.zip')).toBe(
30+
false,
31+
);
32+
});
33+
34+
it('rejects non-zip file', () => {
35+
expect(
36+
isValidNrf9160FirmwareName('mfw_nrf9160_1.1.0.tar'),
37+
).toBe(false);
38+
});
39+
40+
it('rejects nRF91x1 firmware names', () => {
41+
expect(
42+
isValidNrf9160FirmwareName('mfw_nrf91x1_2.0.4.zip'),
43+
).toBe(false);
44+
expect(
45+
isValidNrf9160FirmwareName('mfw-pti_nrf91x1_2.3.8.zip'),
46+
).toBe(false);
47+
});
48+
});
49+
});
50+
51+
describe('nRF91x1 firmware names', () => {
52+
it('accepts names from https://www.nordicsemi.com/Products/nRF9161/Download', () => {
53+
expect(isValidNrf91x1FirmwareName('mfw_nrf91x1_2.0.0.zip')).toBe(
54+
true,
55+
);
56+
expect(isValidNrf91x1FirmwareName('mfw_nrf91x1_2.0.4.zip')).toBe(
57+
true,
58+
);
59+
expect(
60+
isValidNrf91x1FirmwareName('mfw-pti_nrf91x1_2.3.1.zip'),
61+
).toBe(true);
62+
expect(
63+
isValidNrf91x1FirmwareName('mfw-pti_nrf91x1_2.3.8.zip'),
64+
).toBe(true);
65+
});
66+
67+
it('DECT names from https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/getting-started-with-nr-phy', () => {
68+
expect(
69+
isValidNrf91x1FirmwareName('mfw-nr+_nrf91x1_1.0.0.zip'),
70+
).toBe(true);
71+
});
72+
73+
it('accepts names from https://www.nordicsemi.com/Products/nRF9151/Download', () => {
74+
expect(
75+
isValidNrf91x1FirmwareName('mfw_nrf9151-ntn_1.0.0-1.alpha.zip'),
76+
).toBe(true);
77+
});
78+
79+
it('accepts undefined as valid (no file selected)', () => {
80+
expect(isValidNrf91x1FirmwareName(undefined)).toBe(true);
81+
});
82+
83+
describe('invalid names', () => {
84+
it('rejects wrong prefix', () => {
85+
expect(isValidNrf91x1FirmwareName('fw_nrf91x1_2.0.0.zip')).toBe(
86+
false,
87+
);
88+
});
89+
90+
it('rejects non-zip file', () => {
91+
expect(
92+
isValidNrf91x1FirmwareName('mfw_nrf91x1_2.0.0.tar'),
93+
).toBe(false);
94+
});
95+
96+
it('rejects nRF9160 firmware names', () => {
97+
expect(
98+
isValidNrf91x1FirmwareName('mfw_nrf9160_1.1.0.zip'),
99+
).toBe(false);
100+
});
101+
});
102+
});
103+
});

0 commit comments

Comments
 (0)