Cannot change APPSIZE in partition XML file

I am trying to implement A/B partition scheme in NX. So I tried to reduce the APP partition size to 8 GB

-- a/bootloader/t186ref/cfg/flash_l4t_t194_spi_sd_p3668.xml
+++ b/bootloader/t186ref/cfg/flash_l4t_t194_spi_sd_p3668.xml
@@ -522,7 +522,7 @@
         <partition name="APP" type="data">
             <allocation_policy> sequential </allocation_policy>
             <filesystem_type> basic </filesystem_type>
-            <size> APPSIZE </size>
+            <size> 8589934592 </size>
             <file_system_attribute> 0 </file_system_attribute>
             <allocation_attribute> 0x8 </allocation_attribute>
             <align_boundary> 4096 </align_boundary>

I tried to flash the images, but it throws the following error.

[ 321.3500 ] Writing partition APP with system.img
[ 321.3563 ] 0000000074740204: E> NV3P_SERVER: Accessing offset 15032385536 after boundary partition size 8589934592

I also tried to change the value in Linux_for_Tegra/p3668.conf.common, where the flash.sh gets the APP Size, but still the same result.

hello mohamedhusain1303,

are you going to have implementation of root file system A/B redundancy?
that’s out-of-boundary error while you’d define APP size as 8GB, could you please have confirmation of your system.img file size.
thanks

Hi
Yes I am going to implement root file system A/B redundancy.
The system image size is 4.9 GB.

hello mohamedhusain1303,

did you already specify APP and APP_b in the flash configuration files?

BTW, there’s known issue that BUP generation utility currently do not support APP_b partition.
you may refer to Topic 139810, to remove APPFILE when running BUP generation.
thanks

@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.

hello mohamedhusain1303,

those are errors due to we’ll need more changes besides partition layouts to make rootfs A/B redundancy works.
FYI, rootfs A/B support will be included in l4t-r32.5 public release.
thanks

Thanks, @JerryChang. Could you please share us the ETA for l4t-r32.5 release if possible.

hello mohamedhusain1303,

I cannot guarantee the next JetPack public release date,
please expect the rough ETA would be the end of 2020 or early in 2021,
thanks

1 Like

Thanks for the update, @JerryChang.
I made these changes for SOM with eMMC support, and it works. I was able to create two app partitions and flash images through flash.sh. Our target configuration has only eMMC, so this is okay for us.

Thanks for the support.

how to change the APPSIZE ? xml changed is ok?