Any suggestions to reduce code size for nRF52832 for DFU to work?

Hello,

I have an application that I built for the nRF52832 using the peripheral uart example that uses Bluetooth. I am using NCS 2.7.0 I am using the following peripherals:

SPI to communicate with a stepper driver IC
SPI to handle some RGB LEDs
I2C to communicate with an external EEPROM
ADC to monitor some inputs
UART to interact with the device
GPIO to control different inputs and outputs

Attached is a photo of the memory report.   From what I can tell, the code that I directly wrote accounts for approximately 44.35 KB. 

Looking at the NCS section, it looks like this is taking about 109 KB.

When I perform a build, the total memory size is 283496 bytes (when Optimize for size) is being used. 

If I try to build the application so that it builds for mcuboot, the build fails with the following messages:

`text' will not fit in region `FLASH'
region `FLASH' overflowed by 50616 bytes

I know I can control the size of the code I write but what can I do about the various other items that account for most of the size of the application?

What is the max size of app that I can build that I can use with mcuboot?

Related