Skip to content

Commit d642f23

Browse files
author
SimonMcCarthy
committed
built bootloader and hello world for u575zi_q with overlays
1 parent 4f29db3 commit d642f23

File tree

7 files changed

+171
-29
lines changed

7 files changed

+171
-29
lines changed

boot/zephyr/.vscode/settings.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
{
2-
"CodeGPT.apiKey": "CodeGPT Plus Beta"
2+
"CodeGPT.apiKey": "CodeGPT Plus Beta",
3+
"files.associations": {
4+
"flash_map_backend.h": "c",
5+
"mcuboot_status.h": "c",
6+
"bootutil.h": "c",
7+
"bootutil_log.h": "c"
8+
}
39
}

boot/zephyr/nucleo_h7s3l8.overlay

+34-26
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
1-
&flash0 {
2-
// compatible = "st,stm32h7-flash";
3-
// reg = <0x08000000 0x10000>; /* 64KB Flash */
4-
// label = "FLASH";
5-
6-
partitions {
7-
compatible = "fixed-partitions";
8-
#address-cells = <1>;
9-
#size-cells = <1>;
10-
11-
boot_partition: partition@0 {
12-
label = "mcuboot";
13-
reg = <0x00000000 DT_SIZE_K(48)>; /* 32KB for MCUboot */
14-
};
15-
16-
slot0_partition: partition@C000 {
17-
label = "image-0";
18-
reg = <0x0000C000 DT_SIZE_K(8)>; /* 16B for Application */
19-
};
20-
21-
slot1_partition: partition@E000 {
22-
label = "image-1";
23-
reg = <0x000E000 DT_SIZE_K(8)>; /* 16KB for Secondary Application Slot */
24-
};
25-
};
26-
};
1+
// / {
2+
// chosen {
3+
// zephyr,code-partition = &slot0_partition;
4+
// };
5+
// };
6+
7+
&flash0 {
8+
// compatible = "st,stm32h7-flash";
9+
// reg = <0x08000000 0x10000>; /* 64KB Flash */
10+
// label = "FLASH";
11+
12+
partitions {
13+
compatible = "fixed-partitions";
14+
#address-cells = <1>;
15+
#size-cells = <1>;
16+
17+
boot_partition: partition@0 {
18+
label = "mcuboot";
19+
reg = <0x00000000 DT_SIZE_K(36)>; /* 32KB for MCUboot */
20+
};
21+
22+
slot0_partition: partition@9000 {
23+
label = "image-0";
24+
// reg = <0x0000C000 DT_SIZE_K(8)>; /* 16B for Application */
25+
reg = <0x00009000 DT_SIZE_K(26)>; /* 16B for Application */
26+
};
27+
28+
slot1_partition: partition@F800 {
29+
label = "image-1";
30+
// reg = <0x000E000 DT_SIZE_K(8)>; /* 16KB for Secondary Application Slot */
31+
reg = <0x000F800 DT_SIZE_K(2)>; /* 16KB for Secondary Application Slot */
32+
};
33+
};
34+
};

boot/zephyr/nucleo_u575zi_q.overlay

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// / {
2+
// chosen {
3+
// zephyr,code-partition = &slot0_partition;
4+
// };
5+
// };
6+
7+
&flash0 {
8+
// compatible = "st,stm32h7-flash";
9+
// reg = <0x08000000 0x10000>; /* 64KB Flash */
10+
// label = "FLASH";
11+
12+
partitions {
13+
compatible = "fixed-partitions";
14+
#address-cells = <1>;
15+
#size-cells = <1>;
16+
17+
boot_partition: partition@0 {
18+
label = "mcuboot";
19+
reg = <0x00000000 0x00010000>;
20+
read-only;
21+
};
22+
23+
/* storage: 64KB for settings */
24+
storage_partition: partition@10000 {
25+
label = "storage";
26+
reg = <0x00010000 0x00010000>;
27+
};
28+
29+
/* application image slot: 768KB */
30+
slot0_partition: partition@40000 {
31+
label = "image-0";
32+
reg = <0x00040000 0x000C0000>;
33+
};
34+
35+
/* backup slot: 768KB */
36+
slot1_partition: partition@100000 {
37+
label = "image-1";
38+
reg = <0x00100000 0x000C0000>;
39+
};
40+
41+
/* swap slot: 256KB */
42+
scratch_partition: partition@1c0000 {
43+
label = "image-scratch";
44+
reg = <0x001c0000 0x00040000>;
45+
};
46+
};
47+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/ {
2+
chosen {
3+
zephyr,code-partition = &slot0_partition;
4+
};
5+
};
6+
7+
&flash0 {
8+
// compatible = "st,stm32h7-flash";
9+
// reg = <0x08000000 0x10000>; /* 64KB Flash */
10+
// label = "FLASH";
11+
12+
partitions {
13+
compatible = "fixed-partitions";
14+
#address-cells = <1>;
15+
#size-cells = <1>;
16+
17+
boot_partition: partition@0 {
18+
label = "mcuboot";
19+
reg = <0x00000000 DT_SIZE_K(36)>; /* 32KB for MCUboot */
20+
};
21+
22+
slot0_partition: partition@9000 {
23+
label = "image-0";
24+
// reg = <0x0000C000 DT_SIZE_K(8)>; /* 16B for Application */
25+
reg = <0x00009000 DT_SIZE_K(26)>; /* 16B for Application */
26+
};
27+
28+
slot1_partition: partition@F800 {
29+
label = "image-1";
30+
// reg = <0x000E000 DT_SIZE_K(8)>; /* 16KB for Secondary Application Slot */
31+
reg = <0x000F800 DT_SIZE_K(2)>; /* 16KB for Secondary Application Slot */
32+
};
33+
};
34+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/ {
2+
chosen {
3+
zephyr,code-partition = &slot0_partition;
4+
};
5+
};
6+
7+
&flash0 {
8+
// compatible = "st,stm32h7-flash";
9+
// reg = <0x08000000 0x10000>; /* 64KB Flash */
10+
// label = "FLASH";
11+
12+
partitions {
13+
compatible = "fixed-partitions";
14+
#address-cells = <1>;
15+
#size-cells = <1>;
16+
17+
boot_partition: partition@0 {
18+
label = "mcuboot";
19+
reg = <0x00000000 0x00010000>;
20+
read-only;
21+
};
22+
23+
/* storage: 64KB for settings */
24+
storage_partition: partition@10000 {
25+
label = "storage";
26+
reg = <0x00010000 0x00010000>;
27+
};
28+
29+
/* application image slot: 768KB */
30+
slot0_partition: partition@40000 {
31+
label = "image-0";
32+
reg = <0x00040000 0x000C0000>;
33+
};
34+
35+
/* backup slot: 768KB */
36+
slot1_partition: partition@100000 {
37+
label = "image-1";
38+
reg = <0x00100000 0x000C0000>;
39+
};
40+
41+
/* swap slot: 256KB */
42+
scratch_partition: partition@1c0000 {
43+
label = "image-scratch";
44+
reg = <0x001c0000 0x00040000>;
45+
};
46+
};
47+
};

samples/zephyr/hello-world/prj.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ CONFIG_STDOUT_CONSOLE=y
99
CONFIG_BOOTLOADER_MCUBOOT=y
1010

1111
# Use the default MCUBoot PEM key file (BOOT_SIGNATURE_KEY_FILE)
12-
CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="bootloader/mcuboot/root-rsa-2048.pem"
12+
CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="C:/Partition_Environments/Pythons/zephyrproject/mcuboot/root-rsa-2048.pem"

samples/zephyr/hello-world/src/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <zephyr/kernel.h>
88
#include <zephyr/sys/printk.h>
99

10-
void main(void)
10+
int main(void)
1111
{
1212
printk("Hello World from %s on %s!\n",
1313
MCUBOOT_HELLO_WORLD_FROM, CONFIG_BOARD);

0 commit comments

Comments
 (0)