FOTA without external flash: Irrecoverable error: flash write failed: 12

Hello Team,

I am trying to change the Lesson 9 Exercise 5 nrf5340_both_sol sample to use internal flash for FOTA. The code builds successfully. I have changed the pm_static.yml file to adapt to my another project in which I want to implement FOTA without external flash. I have commented out the code in mcuboot.conf and mcuboot.overlay files and I have removed 

SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY in sysbuild.conf file. The sample build was completed and flashed to the DK. 

When I tried to flash the new build with some code changes using nRF Device Manager andriod app I get the follow error: 
*** Booting MCUboot v2.1.0-dev-4594a8693738 ***
*** Using nRF Connect SDK v2.8.0-a2386bfc8401 ***
*** Using Zephyr OS v3.7.99-0bc3393fb112 ***
I: Starting bootloader
W: Cannot upgrade: slots have non-compatible sectors
I: Image index: 1, Swap type: none
I: Bootloader chainload address offset: 0xc000
�E: JEDEC id [ff ff ff] expect [c2 28 17]
*** Booting My Application v2.9.0-580302f04f35 ***
*** Using nRF Connect SDK v2.8.0-a2386bfc8401 ***
*** Using Zephyr OS v3.7.99-0bc3393fb112 ***
BBB Starting Bluetooth Peripheral LBS example
I: 2 Sectors of 4096 bytes
I: alloc wra: 0, f18
I: data wra: 0, 144
I: HW Platform: Nordic Semiconductor (0x0002)
I: HW Variant: nRF53x (0x0003)
I: Firmware: Standard Bluetooth controller (0x00) Version 254.63788 Build 573996906
I: No ID address. App must call settings_load()
Bluetooth initialized
I: Identity: F9:87:99:29:1A:81 (random)
I: HCI: version 6.0 (0x0e) revision 0x204e, manufacturer 0x0059
I: LMP: version 6.0 (0x0e) subver 0x204e
Advertising successfully started
Connected
Security changed: 10:EC:81:F9:10:CE (public) level 4
I: Image index: 0, Swap type: none
I: Image index: 1, Swap type: none
E: Failed to open flash area ID 2: -2
I: Image index: 0, Swap type: none
E: Irrecoverable error: flash write failed: 12

SDK and Toolchain - v2.8.0
nRF5340DK

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
EMPTY_0:
address: 0xfe000
end_address: 0x100000
placement:
after:
- settings_storage
region: flash_primary
size: 0x2000
app:
address: 0xc200
end_address: 0x7be00
region: flash_primary
size: 0x6fc00
mcuboot:
address: 0x0
end_address: 0xc000
placement:
align:
end: 0x1000
before:
- mcuboot_primary
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX