@JerryChang I am not sure how I BUP generation is relevant in this case. I am just trying to flash the sd card with a custom partition layout.
For flashing system image, I have to mention the APPFILE variable right?
Also, I added APP_b partition
<partition name="primary_gpt" type="primary_gpt">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 19968 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** Contains primary GPT of the `sdcard` device. All
partitions defined after this entry are configured in the kernel, and are
accessible by standard partition tools such as gdisk and parted. </description>
</partition>
<partition name="APP" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 5368709120 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<align_boundary> 4096 </align_boundary>
<percent_reserved> 0 </percent_reserved>
<filename> system.img </filename>
<!-- <filename> APPFILE </filename> -->
<unique_guid> APPUUID </unique_guid>
<description> **Required.** Contains the rootfs. This partition must be defined
after `primary_GPT` so that it can be accessed as the fixed known special device
`/dev/mmcblk0p1`. </description>
</partition>
<partition name="APP_b" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 5368709120 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<align_boundary> 4096 </align_boundary>
<percent_reserved> 0 </percent_reserved>
<!-- <filename> APPFILE </filename> -->
<unique_guid> APPUUID </unique_guid>
<description> **Required.** Contains the rootfs. This partition must be defined
after `primary_GPT` so that it can be accessed as the fixed known special device
`/dev/mmcblk0p1`. </description>
</partition>
I got a different error now.
[0299.286] I> Writing bpmp-fw-dtb_b partition.
[0301.466] I> Writing VER partition.
[0301.479] I> Writing VER_b partition.
[0301.492] I> Writing device 6: 0.
[0301.498] I> Writing APP partition.
**[0301.578] E> NV3P_SERVER: Could not write 1048576 bytes.**
I am not sure why it is failing while writing the system image when the app partition is different from the default.
Please let me if there is a solution for this.