Skip to content

Commit 7fb956b

Browse files
khoa-nguyen-18kartben
authored andcommitted
boards: renesas: Add support MCUBoot for ek_ra8p1 and mck_ra8t2
Add support MCUBoot for ek_ra8p1 and mck_ra8t2 Signed-off-by: Khoa Nguyen <[email protected]>
1 parent bc35c10 commit 7fb956b

File tree

5 files changed

+207
-0
lines changed

5 files changed

+207
-0
lines changed

boards/renesas/ek_ra8p1/doc/index.rst

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,79 @@ To flash the program to board
165165
166166
west flash -r jlink
167167
168+
MCUboot bootloader
169+
==================
170+
171+
The sysbuild makes possible to build and flash all necessary images needed to
172+
bootstrap the board.
173+
174+
To build the sample application using sysbuild use the command:
175+
176+
.. zephyr-app-commands::
177+
:tool: west
178+
:zephyr-app: samples/hello_world
179+
:board: ek_ra8p1/r7ka8p1kflcac/cm85
180+
:goals: build flash
181+
:west-args: --sysbuild
182+
:gen-args: -DSB_CONFIG_BOOTLOADER_MCUBOOT=y
183+
184+
By default, Sysbuild creates MCUboot and user application images.
185+
186+
Build directory structure created by sysbuild is different from traditional
187+
Zephyr build. Output is structured by the domain subdirectories:
188+
189+
.. code-block::
190+
191+
build/
192+
├── hello_world
193+
| └── zephyr
194+
│ ├── zephyr.elf
195+
│ ├── zephyr.hex
196+
│ ├── zephyr.bin
197+
│ ├── zephyr.signed.bin
198+
│ └── zephyr.signed.hex
199+
├── mcuboot
200+
│ └── zephyr
201+
│ ├── zephyr.elf
202+
│ ├── zephyr.hex
203+
│ └── zephyr.bin
204+
└── domains.yaml
205+
206+
.. note::
207+
208+
With ``--sysbuild`` option, MCUboot will be rebuilt and re-flashed
209+
every time the pristine build is used.
210+
211+
To only flash the user application in the subsequent builds, Use:
212+
213+
.. code-block:: console
214+
215+
$ west flash --domain hello_world
216+
217+
For more information about the system build please read the :ref:`sysbuild` documentation.
218+
219+
You should see the following message in the terminal:
220+
221+
.. code-block:: console
222+
223+
*** Booting MCUboot v2.2.0-171-g8513be710e5e ***
224+
*** Using Zephyr OS build v4.2.0-6156-ged85ac9ffda9 ***
225+
I: Starting bootloader
226+
I: Image index: 0, Swap type: none
227+
I: Image index: 0, Swap type: none
228+
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
229+
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
230+
I: Boot source: none
231+
I: Image index: 0, Swap type: none
232+
I: Image index: 0, Swap type: none
233+
I: Image index: 0, Swap type: none
234+
I: Image index: 0, Swap type: none
235+
I: Bootloader chainload address offset: 0x10000
236+
I: Image version: v0.0.0
237+
I: Jumping to the first image slot
238+
*** Booting Zephyr OS build v4.2.0-6156-ged85ac9ffda9 ***
239+
Hello World! ek_ra8p1/r7ka8p1kflcac/cm85
240+
168241
References
169242
**********
170243
- `EK-RA8P1 Website`_

boards/renesas/ek_ra8p1/ek_ra8p1_r7ka8p1kflcac_cm33.dts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
chosen {
1616
zephyr,sram = &sram1;
1717
zephyr,flash = &code_mram_cm33;
18+
zephyr,flash-controller = &mram_ctrl;
1819
zephyr,console = &uart9;
1920
zephyr,shell-uart = &uart9;
2021
};

boards/renesas/ek_ra8p1/ek_ra8p1_r7ka8p1kflcac_cm85.dts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
chosen {
1717
zephyr,sram = &sram0;
1818
zephyr,flash = &code_mram_cm85;
19+
zephyr,flash-controller = &mram_ctrl;
20+
zephyr,code-partition = &slot0_partition;
1921
zephyr,console = &uart8;
2022
zephyr,shell-uart = &uart8;
2123
};
@@ -141,6 +143,34 @@
141143
};
142144
};
143145

146+
&code_mram_cm85 {
147+
partitions {
148+
compatible = "fixed-partitions";
149+
#address-cells = <1>;
150+
#size-cells = <1>;
151+
152+
boot_partition: partition@0 {
153+
label = "mcuboot";
154+
reg = <0x0 DT_SIZE_K(64)>;
155+
};
156+
157+
slot0_partition: partition@10000 {
158+
label = "image-0";
159+
reg = <0x10000 DT_SIZE_K(344)>;
160+
};
161+
162+
slot1_partition: partition@66000 {
163+
label = "image-1";
164+
reg = <0x66000 DT_SIZE_K(344)>;
165+
};
166+
167+
storage_partition: partition@bc000 {
168+
label = "storage";
169+
reg = <0xbc000 DT_SIZE_K(16)>;
170+
};
171+
};
172+
};
173+
144174
zephyr_lcdif: &lcdif {};
145175

146176
pmod_sd_shield: &sdhc0 {};

boards/renesas/mck_ra8t2/doc/index.rst

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,79 @@ To flash the program to board
117117
118118
west flash -r jlink
119119
120+
MCUboot bootloader
121+
==================
122+
123+
The sysbuild makes possible to build and flash all necessary images needed to
124+
bootstrap the board.
125+
126+
To build the sample application using sysbuild use the command:
127+
128+
.. zephyr-app-commands::
129+
:tool: west
130+
:zephyr-app: samples/hello_world
131+
:board: mck_ra8t2/r7ka8t2lfecac/cm85
132+
:goals: build flash
133+
:west-args: --sysbuild
134+
:gen-args: -DSB_CONFIG_BOOTLOADER_MCUBOOT=y
135+
136+
By default, Sysbuild creates MCUboot and user application images.
137+
138+
Build directory structure created by sysbuild is different from traditional
139+
Zephyr build. Output is structured by the domain subdirectories:
140+
141+
.. code-block::
142+
143+
build/
144+
├── hello_world
145+
| └── zephyr
146+
│ ├── zephyr.elf
147+
│ ├── zephyr.hex
148+
│ ├── zephyr.bin
149+
│ ├── zephyr.signed.bin
150+
│ └── zephyr.signed.hex
151+
├── mcuboot
152+
│ └── zephyr
153+
│ ├── zephyr.elf
154+
│ ├── zephyr.hex
155+
│ └── zephyr.bin
156+
└── domains.yaml
157+
158+
.. note::
159+
160+
With ``--sysbuild`` option, MCUboot will be rebuilt and re-flashed
161+
every time the pristine build is used.
162+
163+
To only flash the user application in the subsequent builds, Use:
164+
165+
.. code-block:: console
166+
167+
$ west flash --domain hello_world
168+
169+
For more information about the system build please read the :ref:`sysbuild` documentation.
170+
171+
You should see the following message in the terminal:
172+
173+
.. code-block:: console
174+
175+
*** Booting MCUboot v2.2.0-171-g8513be710e5e ***
176+
*** Using Zephyr OS build v4.2.0-6156-ged85ac9ffda9 ***
177+
I: Starting bootloader
178+
I: Image index: 0, Swap type: none
179+
I: Image index: 0, Swap type: none
180+
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
181+
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
182+
I: Boot source: none
183+
I: Image index: 0, Swap type: none
184+
I: Image index: 0, Swap type: none
185+
I: Image index: 0, Swap type: none
186+
I: Image index: 0, Swap type: none
187+
I: Bootloader chainload address offset: 0x10000
188+
I: Image version: v0.0.0
189+
I: Jumping to the first image slot
190+
*** Booting Zephyr OS build v4.2.0-6156-ged85ac9ffda9 ***
191+
Hello World! mck_ra8t2/r7ka8t2lfecac/cm85
192+
120193
References
121194
**********
122195
- `MCK-RA8T2 Website`_

boards/renesas/mck_ra8t2/mck_ra8t2_r7ka8t2lfecac_cm85.dts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
chosen {
1616
zephyr,sram = &sram0;
1717
zephyr,flash = &code_mram_cm85;
18+
zephyr,flash-controller = &mram_ctrl;
19+
zephyr,code-partition = &slot0_partition;
1820
zephyr,console = &uart9;
1921
zephyr,shell-uart = &uart9;
2022
};
@@ -102,3 +104,31 @@
102104
status = "okay";
103105
};
104106
};
107+
108+
&code_mram_cm85 {
109+
partitions {
110+
compatible = "fixed-partitions";
111+
#address-cells = <1>;
112+
#size-cells = <1>;
113+
114+
boot_partition: partition@0 {
115+
label = "mcuboot";
116+
reg = <0x0 DT_SIZE_K(64)>;
117+
};
118+
119+
slot0_partition: partition@10000 {
120+
label = "image-0";
121+
reg = <0x10000 DT_SIZE_K(464)>;
122+
};
123+
124+
slot1_partition: partition@84000 {
125+
label = "image-1";
126+
reg = <0x84000 DT_SIZE_K(464)>;
127+
};
128+
129+
storage_partition: partition@f8000 {
130+
label = "storage";
131+
reg = <0xf8000 DT_SIZE_K(32)>;
132+
};
133+
};
134+
};

0 commit comments

Comments
 (0)