You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/nrf/config_and_build/bootloaders/bootloader_adding_sysbuild.rst
+94Lines changed: 94 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -353,3 +353,97 @@ The S1 variant is built as a separate image called ``s1_image`` automatically.
353
353
This variant image will use the same application configuration as the base image, with the exception of its placement in memory.
354
354
You only have to modify the version set in the :kconfig:option:`CONFIG_FW_INFO_FIRMWARE_VERSION` Kconfig option.
355
355
To make ``s1_image`` bootable with |NSIB|, the value of :kconfig:option:`CONFIG_FW_INFO_FIRMWARE_VERSION` for the default image (or MCUboot if using MCUboot as a second-stage bootloader) must be bigger than the one for original image.
356
+
357
+
Using MCUboot in firmware loader mode
358
+
**************************************
359
+
360
+
MCUboot supports a firmware loader mode which is supported in sysbuild. This mode allows for a project to consist of an MCUboot image (optionally with serial recovery), a main application which does not support firmware updates, and a secondary application which is dedicated to loading firmware updates. The benefit of this is for having a dedicated application purely for loading firmware updates e.g. over Bluetooth and allowing the size of tha main application to be smaller, helping on devices with limited flash or RAM.
361
+
In order to use this mode, a static partition file must be created for the application to designate the addresses and sizes of the main image and firmware loader applications, the firmware loader partition **must** be named ``firmware_loader``. The following is an example static partition manager file for the nRF53:
362
+
363
+
.. code-block:: yaml
364
+
365
+
app:
366
+
address: 0x10200
367
+
region: flash_primary
368
+
size: 0xdfe00
369
+
mcuboot:
370
+
address: 0x0
371
+
region: flash_primary
372
+
size: 0x10000
373
+
mcuboot_pad:
374
+
address: 0x10000
375
+
region: flash_primary
376
+
size: 0x200
377
+
mcuboot_primary:
378
+
address: 0x10000
379
+
orig_span: &id001
380
+
- mcuboot_pad
381
+
- app
382
+
region: flash_primary
383
+
size: 0xc0000
384
+
span: *id001
385
+
mcuboot_primary_app:
386
+
address: 0x10200
387
+
orig_span: &id002
388
+
- app
389
+
region: flash_primary
390
+
size: 0xbfe00
391
+
span: *id002
392
+
firmware_loader:
393
+
address: 0xd0200
394
+
region: flash_primary
395
+
size: 0x1fe00
396
+
mcuboot_secondary:
397
+
address: 0xd0000
398
+
orig_span: &id003
399
+
- mcuboot_pad
400
+
- firmware_loader
401
+
region: flash_primary
402
+
size: 0x20000
403
+
span: *id003
404
+
mcuboot_secondary_app:
405
+
address: 0xd0200
406
+
orig_span: &id004
407
+
- firmware_loader
408
+
region: flash_primary
409
+
size: 0x1fe00
410
+
span: *id004
411
+
settings_storage:
412
+
address: 0xf0000
413
+
region: flash_primary
414
+
size: 0x10000
415
+
pcd_sram:
416
+
address: 0x20000000
417
+
size: 0x2000
418
+
region: sram_primary
419
+
420
+
The project must also have a ``sysbuild.cmake`` file which includes the firmware loader application in the build, this **must** be named ``firmware_loader``:
421
+
422
+
.. code-block:: cmake
423
+
424
+
ExternalZephyrProject_Add(
425
+
APPLICATION firmware_loader
426
+
SOURCE_DIR <path_to_firmware_loader_application>
427
+
)
428
+
429
+
There must also be a ``sysbuild.conf`` file which selects the required sysbuild options for enabling MCUboot and selecting the firmware loader mode:
430
+
431
+
.. code-block:: cfg
432
+
433
+
SB_CONFIG_BOOTLOADER_MCUBOOT=y
434
+
SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER=y
435
+
436
+
At least one mode must be set in MCUboot for entering the firmware loader application, supported entrance methods include:
437
+
438
+
* GPIO
439
+
* Boot mode using retention subsystem
440
+
* No valid main application
441
+
* Device reset using dedicated reset pin
442
+
443
+
For this example, the use of a GPIO when booting will be used. Create a ``sysbuild`` folder and add a ``sysbuild/mcuboot.conf`` Kconfig fragment file to use when building MCUboot with the following:
444
+
445
+
.. code-block:: cfg
446
+
447
+
CONFIG_BOOT_FIRMWARE_LOADER_ENTRANCE_GPIO=y
448
+
449
+
The project can now be built and flashed and will boot the firmware loader application when the button is held upon device reboot, or the main application will be booted when the device is reset and the button is not held down.
0 commit comments