Hi Guys,
I'm working with a couple of NRF52840-DK trying to implement my own firmware update logic using Openthread and MCUBoot. My goal is to use CoAP to upload chunk of firmware on the non active slot and then switch firmware partition after a reset.
In my project I use the external NOR flash to store data (my desiderata is to use that also to store the second image, but it's not mandatory at this stage) and I'm experiencing some strange compiler behaivour. It seems that the build of MCUBoot works fine but once is time to compile the firmware it fails with error:
C:\Users\agall\OneDrive\Lavoro\NRFDomoticWorkspace\NRFDomotic\nrf\include\flash_map_pm.h:50:18: error: 'PM_PM_PM_external_partition_ID_LABEL_OFFSET' undeclared (first use in this function)
As far as I understand (I'm working with zephyr for about 6 months now and I gain some experiences but, for suure, I'm not a guru) it seems that external_partition is not recognized in the DTS file. So, I took a look at the zephyr build folder and in the zephyr.dts file I have:
qspi: flash_qspi: qspi@40029000 { compatible = "nordic,nrf-qspi"; #address-cells = < 0x1 >; #size-cells = < 0x0 >; reg = < 0x40029000 0x1000 >, < 0x12000000 0x8000000 >; reg-names = "qspi", "qspi_mm"; interrupts = < 0x29 0x1 >; status = "okay"; pinctrl-0 = < &qspi_default >; pinctrl-1 = < &qspi_sleep >; pinctrl-names = "default", "sleep"; mx25r64: storage: mx25r6435f@0 { compatible = "nordic,qspi-nor"; reg = < 0x0 >; writeoc = "pp4io"; readoc = "read4io"; sck-frequency = < 0x7a1200 >; jedec-id = [ C2 28 17 ]; sfdp-bfp = [ E5 20 F1 FF FF FF FF 03 44 EB 08 6B 08 3B 04 BB EE FF FF FF FF FF 00 FF FF FF 00 FF 0C 20 0F 52 10 D8 00 FF 23 72 F5 00 82 ED 04 CC 44 83 68 44 30 B0 30 B0 F7 C4 D5 5C 00 BE 29 FF F0 D0 FF FF ]; size = < 0x4000000 >; has-dpd; t-enter-dpd = < 0x2710 >; t-exit-dpd = < 0x88b8 >; status = "okay"; partitions { status = "okay"; compatible = "fixed-partitions"; #address-cells = < 0x1 >; #size-cells = < 0x1 >; external_partition: partition@0 { label = "ext_storage"; reg = < 0x0 0x4000 >; phandle = < 0x5 >; }; }; }; };
So, as far as I understand the DTS is properly managed.
The strange thing is that, if I compile everything with