pm_static optimize

Development environment:  ncs 2.6.0.  

my application need BLE-DFU, so i added multi-image support to my project. 

the pm_static.yml is the typical default system configuration

mcuboot:
  address: 0x0
  size: 0xc000
  region: flash_primary
mcuboot_pad:
  address: 0xc000
  size: 0x200
app:
  address: 0xc200
  size: 0x38e00
mcuboot_primary:
  orig_span: &id001
  - mcuboot_pad
  - app
  span: *id001
  address: 0xc000
  size: 0x39000
  region: flash_primary
mcuboot_primary_app:
  orig_span: &id002
  - app
  span: *id002
  address: 0xc200
  size: 0x38e00
mcuboot_secondary:
  address: 0x45000
  size: 0x39000
  region: flash_primary
settings_storage:
  address: 0x7e000
  size: 0x2000
  region: flash_primary

The results of my project compilation (-Os) are as follows

[240/248] Linking C executable zephyr\zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 208164 B 208384 B 99.89%
RAM: 59724 B 64 KB 91.13%
IDT_LIST: 0 GB 32 KB 0.00%

DFU work perfectly. 

BUT. as you see, the flash is full. <FLASH:      208164 B     208384 B     99.89%>, when I add some little source-code, the compile will prmot overflow-mistake. 

I found MCUBOOT just has 32K-size, 8KB settings-storage, and <mcuboot_primary> has 24KB nvs-storage.

I changed MCUBOOT-size to 40KB, or settings-storage to 4KB, compile will OK, but DFU failed.

my Question:

1. MCUBOOT-size changed to smaller feasible? Or the size can only be 0xC000=48KB?

2. i need settings-storage area, but the size can be smaller ?

3. nvs-storage=24KB Is it necessary? how to make it smaller ?

Related