Flash area error when attempting DFU via nRF Connect App

Hello,

I'm getting the following error  when attempting to perform a DFU. I'm using the Android nRF Connect app.

Fullscreen
1
2
3
00> I: Image index: 0, Swap type: test
00> I: Image index: 1, Swap type: none
00> E: Failed to open flash area ID 1: -2
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Flash Area ID of 1 indicates it's external flash. Error -2 is ENOENT. So it's saying that no such flash area exists? I suspect something is not configured correctly.

Here is my external flash devicetree snippet:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&spi4 {
compatible = "nordic,nrf-spim";
status = "okay";
pinctrl-0 = <&spi4_default>;
pinctrl-1 = <&spi4_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
sst26vf: sst26vf064b@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <24000000>;
jedec-id = [bf 26 43]; /* see datasheet table 5-4, p.25 */
/* see datasheet pp. 72-79 for basic flash parameters table below */
sfdp-bfp = [
fd 20 f1 ff ff ff ff 03 44 eb 08 6b 08 3b 80 bb
fe ff ff ff ff ff 00 ff ff ff 44 0b 0c 20 0d d8
0f d8 10 d8 20 91 48 24 80 6f 1d 81 ed 0f 77 38
30 b0 30 b0 f7 ff ff ff 29 c2 5f ff f0 30 c0 80
];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The project is based on the smart lock sample code. I had to increase the size of the bootloader region to get it to fit. Here is the pm_static_dfu.yml file:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
mcuboot:
address: 0x0
size: 0xc000
region: flash_primary
mcuboot_pad:
address: 0xc000
size: 0x200
app:
address: 0xc200
size: 0xeae00
mcuboot_primary:
orig_span: &id001
- mcuboot_pad
- app
span: *id001
address: 0xc000
size: 0xeb000
region: flash_primary
mcuboot_primary_app:
orig_span: &id002
- app
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I'm don't know how or if this yaml file relates to the partitions defined in the devicetree, but here are the devicetree partitions:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x00010000>;
};
slot0_partition: partition@10000 {
label = "image-0";
};
slot0_ns_partition: partition@50000 {
label = "image-0-nonsecure";
};
slot1_partition: partition@80000 {
label = "image-1";
};
slot1_ns_partition: partition@c0000 {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thanks.