Minimum available Flash / RAM required for DFU? Download failing with "insufficient resources"

Hi everyone, I am attempting to integrate buttonless secure DFU into my existing firmware application. I am following this guide: https://content.u-blox.com/sites/default/files/Add-NordicSemiconductorDFU-to-SDKexample_AppNote_UBX-19050198.pdf

I am using SDK 15.2 and intend to deploy this application onto nRF52810, but am using nRF 52 DK for development purposes. When I load only the secure bootloader and softdevice S112 onto my nRF52 DK, from the dfu example ($/examples/dfu/secure_bootloader/pca10040e_ble), I have no problems. I can find the nRF52 DK advertising as dfuTarg, I can connect to it, and then I can do a DFU update using the default unedited "ble_app_uart" example, zipped up with the appropriate private key using nrfutils. 

When I use my own custom firmware application that is extended from the defualt ble_app_uart template, zip it up using nrfutils and then try to update using DFU, I get the error "Insufficient resources" and I cannot update the firmware. 

The default ble_app_uart project builds with 126.2 / 192KB flash and 17.2 / 24KB RAM. My custom application builds with 163.9 / 192KB flash and 18.2 / 24KB RAM. 

What is the minimum required free flash and/or ram to work with DFU? Do I need to optimize my firmware so that there is enough space to perform DFU, or am I doing something else wrong?

Thanks!

 err

File Name: test_app_v10.zip
Parts: 1
Size: 65 KB
Soft Device Size: Zero KB
Bootloader Size: Zero KB
[Callback] Central Manager did update state to: Powered ON
Connecting to DfuTarg...
centralManager.connect(peripheral, options: nil)
[Callback] Central Manager did connect peripheral
Connected to DfuTarg
Discovering services...
peripheral.discoverServices(nil)
Services discovered
Starting Secure DFU...
Connected to DfuTarg
Services discovered
Secure DFU Service found
Discovering characteristics in DFU Service...
peripheral.discoverCharacteristics(nil, for: FE59)
DFU characteristics discovered
MTU set to 247
Enabling notifications for 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.setNotifyValue(true, for: 8EC90001-F315-4F60-9FB8-838830DAEA50)
Notifications enabled for 8EC90001-F315-4F60-9FB8-838830DAEA50
Secure DFU Control Point notifications enabled
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x0601, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600601000100008e0000008672ebd1
Command object info (Max size = 256, Offset = 142, CRC = D1EB7286) received
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x01018e000000, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600101
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x020000, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600201
Packet Receipt Notif disabled (Op Code = 2, Value = 0)
Writing to characteristic 8EC90002-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x128b010a450801124108db4f10341a02b00120002800300038b8ff03422408031220db43cc45a6468084fe7c6df722c0b203200c5cc67e9614ff26717010abdbb40a480052040801120010001a402578b3009e2a2cc2f913b01300163f31d797670239810eeee2b78adc6ca16d7ac4dae624f77e90ee3c713e772b8f0a43b0083620d886c3a0a49c91b2b2593b65, for: 8EC90002-F315-4F60-9FB8-838830DAEA50, type: .withoutResponse)
Command object sent (CRC = 1BB50FF8)
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x03, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 6003018e000000f80fb51b
Checksum (Offset = 142, CRC = 1BB50FF8) received
Writing to characteristic 8EC90001-F315-4F60-9FB8-838830DAEA50...
peripheral.writeValue(0x04, for: 8EC90001-F315-4F60-9FB8-838830DAEA50, type: .withResponse)
Data written to 8EC90001-F315-4F60-9FB8-838830DAEA50
Notification received from 8EC90001-F315-4F60-9FB8-838830DAEA50, value (0x): 600404
Error 4: Insufficient resources
Disconnecting...
centralManager.cancelPeripheralConnection(peripheral)
[Callback] Central Manager did disconnect peripheral
Disconnected

Parents Reply Children
No Data
Related