diff --git a/samples/bluetooth/peripheral_uart/boards/nrf5340dk_nrf5340_cpuapp.overlay b/samples/bluetooth/peripheral_uart/boards/nrf5340dk_nrf5340_cpuapp.overlay new file mode 100644 index 000000000..dae8a491a --- /dev/null +++ b/samples/bluetooth/peripheral_uart/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -0,0 +1,33 @@ + +/delete-node/ &boot_partition; +/delete-node/ &slot0_partition; +/delete-node/ &slot0_ns_partition; +/delete-node/ &slot1_partition; +/delete-node/ &slot1_ns_partition; + +&flash0 { + partitions { + compatible = "fixed-partitions"; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0x00020000>; + }; + slot0_partition: partition@20000 { + label = "image-0"; + reg = <0x00020000 0x38000>; + }; + slot0_ns_partition: partition@58000 { + label = "image-0-nonsecure"; + reg = <0x00058000 0x30000>; + }; + slot1_partition: partition@88000 { + label = "image-1"; + reg = <0x00088000 0x38000>; + }; + slot1_ns_partition: partition@c0000 { + label = "image-1-nonsecure"; + reg = <0x000c0000 0x30000>; + }; + }; +}; \ No newline at end of file diff --git a/samples/bluetooth/peripheral_uart/child_image/mcuboot.conf b/samples/bluetooth/peripheral_uart/child_image/mcuboot.conf new file mode 100644 index 000000000..ca2a9d728 --- /dev/null +++ b/samples/bluetooth/peripheral_uart/child_image/mcuboot.conf @@ -0,0 +1,31 @@ +CONFIG_LOG=y +CONFIG_LOG_BACKEND_UART=y +# The build won't fit on the partition allocated for it without size +# optimizations. +CONFIG_SIZE_OPTIMIZATIONS=y +CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x20000 +CONFIG_PCD=y + +# Serial +CONFIG_SERIAL=y +CONFIG_UART_NRFX=y +CONFIG_UART_INTERRUPT_DRIVEN=y +CONFIG_UART_LINE_CTRL=y + +# MCUBoot serial +CONFIG_GPIO=y +CONFIG_MCUBOOT_SERIAL=y +CONFIG_BOOT_SERIAL_CDC_ACM=y +CONFIG_BOOT_SERIAL_DETECT_PORT="GPIO_0" +CONFIG_BOOT_SERIAL_DETECT_PIN=23 + +# Required by USB +CONFIG_MULTITHREADING=y + +# USB +CONFIG_USB=y +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_DEVICE_PRODUCT="MCUBOOT" +CONFIG_USB_CDC_ACM=y +CONFIG_USB_COMPOSITE_DEVICE=n +CONFIG_USB_MASS_STORAGE=n diff --git a/samples/bluetooth/peripheral_uart/prj.conf b/samples/bluetooth/peripheral_uart/prj.conf index cd6df0664..418bd9489 100644 --- a/samples/bluetooth/peripheral_uart/prj.conf +++ b/samples/bluetooth/peripheral_uart/prj.conf @@ -4,6 +4,8 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # +CONFIG_BOOTLOADER_MCUBOOT=y + # Enable the UART driver CONFIG_UART_ASYNC_API=y CONFIG_NRFX_UARTE0=y