Unable to get mcuboot to work on custom nRF52840 design.

I have a custom nRF52840 design, I'm actually using a ublox BMD-340-A-R module on a custom board. I have a working application with BLE peripheral, I2C sensors, USB CDC, LoRaWan and some RS485 interfaces. I am using NCS 2.5.2. The application is working as intended and I now want to add mcuboot for OTA DFU firmware updates. In the application I have console and logging disabled as I am using the UARTs for the RS485 interfaces so they are not available (practically all pins are in use).

Now, I've tried to add mcuboot by adding CONFIG_BOOTLOADER_MCUBOOT=y in prj.conf and a child_image/mcuboot.conf (shown below). If I connect to the device using nRFConnect App I can see that DFU service is available. If I press the DFU icon and load the app_distribution.zip it appears as if the file is uploaded (I get the transfer speed chart and the progress goes on to 100%) but right after the upload when the progress switches to "Validating..." the nRF52 reboots and gets stuck somewhere. If I power cycle the board the device comes back up but it is on the original firmware.

I'm not very familiar with mcuboot so I'm not sure what to check or try. Below are all of the file the I think are relevant.

prj.conf:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
CONFIG_GPIO=y
CONFIG_SERIAL=y
CONFIG_UART_0_ASYNC=y
CONFIG_UART_1_ASYNC=y
CONFIG_UART_ASYNC_API=y
CONFIG_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_HEAP_MEM_POOL_SIZE=8192
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="dtu proto"
CONFIG_BT_DEVICE_APPEARANCE=833
CONFIG_BT_MAX_CONN=1
CONFIG_BT_MAX_PAIRED=1
# Enable bonding
CONFIG_BT_SETTINGS=y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

child_image/mcuboot.conf:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
CONFIG_SHELL=n
CONFIG_LOG=n
CONFIG_CONSOLE=n
CONFIG_GPIO_AS_PINRESET=n
CONFIG_BOOT_SIGNATURE_TYPE_RSA=y
CONFIG_MULTITHREADING=y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

pm_static.yml (copied from partition.yml)

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
app:
address: 0xc200
end_address: 0x85000
region: flash_primary
size: 0x78e00
mcuboot:
address: 0x0
end_address: 0xc000
placement:
before:
- mcuboot_primary
region: flash_primary
size: 0xc000
mcuboot_pad:
address: 0xc000
end_address: 0xc200
placement:
align:
start: 0x1000
before:
- mcuboot_primary_app
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX