Hi
SDK: ncs-v3.4.2
I wanted to compile the lesson as a starting point for a product in non-secure mode with TFM.
I don't have the nrf5340dk but one with the same chip and more or less most things are identical. I could reduce the problem to the folowing
Changes to the current git branch of l9_e5_nrf5340_both_sol
diff --git a/app.overlay b/app.overlay
index e6a2583..0ff152b 100644
--- a/app.overlay
+++ b/app.overlay
@@ -1,24 +1,34 @@
-/* STEP 1.1 - Add external flash to applciation */
-/delete-node/ &slot1_partition;
+/delete-node/ &mx25r64;
-&mx25r64 {
+&qspi {
status = "okay";
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
- slot1_partition: partition@0 {
- label = "image-1";
- reg = <0x0 0x74000>;
- ranges = <0x0 0x0 0x74000>;
+ pinctrl-0 = <&qspi_default>;
+ pinctrl-1 = <&qspi_sleep>;
+ pinctrl-names = "default", "sleep";
+
+ by25d40es: by25d40es@0 {
+ compatible = "nordic,qspi-nor";
+ reg = <0>;
+ /* BY25D40ES supports only pp and pp2o */
+ writeoc = "pp";
+ /* BY25D40ES supports only fastread, read2o and read2io*/
+ readoc = "fastread";
+ sck-frequency = <16000000>; // 6-96MHz, Chip kann 104MHz
+ jedec-id = [68 40 13];
+ size-in-bytes = <524288>;
+ has-dpd;
+ t-enter-dpd = <25000>;
+ t-exit-dpd = <25000>;
+ status = "okay";
+ partitions {
+ compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
- };
- /* Net core secondary slot for multi-image DFU */
- slot3_partition: partition@74000 {
- label = "image-3";
- reg = <0x74000 0x40000>;
+ /* Net core secondary slot for multi-image DFU */
+ slot3_partition: partition@00000 {
+ label = "image-3";
+ reg = <0x00000 0x40000>;
+ };
};
};
-
-};
\ No newline at end of file
+};
diff --git a/sysbuild/mcuboot.overlay b/sysbuild/mcuboot.overlay
index dd2228c..7efb0b1 100644
--- a/sysbuild/mcuboot.overlay
+++ b/sysbuild/mcuboot.overlay
@@ -1,31 +1,40 @@
-/* STEP 1.1 - Add external flash to mcuboot */
-/delete-node/ &slot1_partition;
+/delete-node/ &mx25r64;
-&mx25r64 {
+&qspi {
status = "okay";
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
- slot1_partition: partition@0 {
- label = "image-1";
- reg = <0x0 0x74000>;
- ranges = <0x0 0x0 0x74000>;
+ pinctrl-0 = <&qspi_default>;
+ pinctrl-1 = <&qspi_sleep>;
+ pinctrl-names = "default", "sleep";
+
+ by25d40es: by25d40es@0 {
+ compatible = "nordic,qspi-nor";
+ reg = <0>;
+ /* BY25D40ES supports only pp and pp2o */
+ writeoc = "pp";
+ /* BY25D40ES supports only fastread, read2o and read2io*/
+ readoc = "fastread";
+ sck-frequency = <16000000>; // 6-96MHz, Chip kann 104MHz
+ jedec-id = [68 40 13];
+ size-in-bytes = <524288>;
+ has-dpd;
+ t-enter-dpd = <25000>;
+ t-exit-dpd = <25000>;
+ status = "okay";
+ partitions {
+ compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
+ /* Net core secondary slot for multi-image DFU */
+ slot3_partition: partition@00000 {
+ label = "image-3";
+ reg = <0x00000 0x40000>;
+ };
};
- /* Net core secondary slot for multi-image DFU */
- slot3_partition: partition@74000 {
- label = "image-3";
- reg = <0x74000 0x40000>;
- };
-
};
-
};
/ {
chosen {
zephyr,code-partition = &boot_partition;
};
-};
\ No newline at end of file
+};
are only in app.overlay and mcuboot.overlay to support a different memory chip. As they is less in space I dropped the slot1_partition. As they has the same size I will use the default internal one.
- In the "Build configuration" is only selected "nrf5340dk/nrf5340/cpuapp/ns" to build with TFM.
- The build is running fine without errors, but I have a boot loop after starting the first image slot from mcuboot.
- UART0 log
*** Booting MCUboot v2.3.0-dev-5d8736c1fd98 *** *** Using nRF Connect SDK v3.4.2-f0b8ad4c7377 *** *** Using Zephyr OS v4.4.2-9133dab6b066 *** I: Starting bootloader I: LCS-awareness disabled, skipping LCS check I: Image index: 0, Swap type: none I: Image index: 1, Swap type: none I: Verifying RSA PSS with signature len: 256 I: RSA signature verification successful I: Bootloader chainload address offset: 0x10000 I: Image version: v2.9.0 I: Jumping to the first image slot ÿ*** Booting MCUboot v2.3.0-dev-5d8736c1fd98 *** *** Using nRF Connect SDK v3.4.2-f0b8ad4c7377 *** *** Using Zephyr OS v4.4.2-9133dab6b066 *** I: Starting bootloader I: LCS-awareness disabled, skipping LCS check I: Image index: 0, Swap type: none I: Image index: 1, Swap type: none I: Verifying RSA PSS with signature len: 256 I: RSA signature verification successful I: Bootloader chainload address offset: 0x10000 I: Image version: v2.9.0 I: Jumping to the first image slot ÿ*** Booting MCUboot v2.3.0-dev-5d8736c1fd98 *** *** Using nRF Connect SDK v3.4.2-f0b8ad4c7377 *** *** Using Zephyr OS v4.4.2-9133dab6b066 *** I: Starting bootloader I: LCS-awareness disabled, skipping LCS check I: Image index: 0, Swap type: none I: Image index: 1, Swap type: none I: Verifying RSA PSS with signature len: 256 I: RSA signature verification successful I: Bootloader chainload address offset: 0x10000 I: Image version: v2.9.0 I: Jumping to the first image slot ÿ*** Booting MCUboot v2.3.0-dev-5d8736c1fd98 *** *** Using nRF Connect SDK v3.4.2-f0b8ad4c7377 *** *** Using Zephyr OS v4.4.2-9133dab6b066 *** I: Starting bootloader I: LCS-awareness disabled, skipping LCS check I: Image index: 0, Swap type: none I: Image index: 1, Swap type: none I: Verifying RSA PSS with signature len: 256 I: RSA signature verification successful I: Bootloader chainload address offset: 0x10000 I: Image version: v2.9.0 I: Jumping to the first image slot
- UART1 has no output. Should be, because log is not disabled and I2C is not used which would block it.
- I have connected UART0 and also UART1. I tested both with changing the pin definition. Both UARTs are working well.
- I have the same with my own dts for the product.
- The "Build configuration" "nrf5340dk/nrf5340/cpuapp" and my own one without TFM is running well. Updates are possible by FOTA.
Has someone a hint what I can test?