JetPack 4.2 partitions size odd behavior

Hi,

I need to decrease the kernel partitions sizes as they are too big. For example, the kernel and kernel_b partitions are 60 mb each, and they are only containing u-boot (boot.img) which is 400k in size.

I’m using the Jetpack 4.2 BSP flashing utility ./flash.sh jetson-tx2 mmcblk0p1 and set the LNXSIZE by hand in the flash_l4t_t186.xml config file for both kernel and kernel_b, like this:

<partition name="LNXNAME" type="data" oem_sign="true">
    <allocation_policy> sequential </allocation_policy>
    <filesystem_type> basic </filesystem_type>
    <size> 6291456 </size>
    <file_system_attribute> 0 </file_system_attribute>
    <allocation_attribute> 8 </allocation_attribute>
    <percent_reserved> 0 </percent_reserved>
    <filename> LNXFILE </filename>
</partition>

However, the board won’t load u-boot anymore after doing so:

[0001.880] I> Kernel type = Normal
[0001.883] I> Loading kernel/boot.img from built-in storage ...
[0001.889] W> No valid slot number is found in scratch register
[0001.894] W> Return default slot: _a
[0001.898] I> A/B: bin_type (24) slot 0
[0001.901] E> Cannot read beyond partition boundary for kernel
[0001.907] E> Failed to read bootimage partition
[0001.911] E> Cannot get binary info kernel
[0001.915] E> A/B loader failure
[0001.918] E> Top caller module: LOADER, error module: PARTITION_MANAGER, reason: 0x04, aux_info: 0x01

The documentation at https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fpart_config.html%23 states this:

size | | (Required) Specifies the size of the partition in bytes. Decimal and hexadecimal values are valid.
The partition size may be equal to or larger than the size of the file to be written to the partition. Specifying a larger size allows the file size to increase later without requiring the partition configuration file to be modified.
If the partition size specified is less than an erase block size, it will align itself to the partition erase block boundary.

Can you please help and tell me where else I should specify kernel partitions sizes apart from the xml so that I can actually lower them?

Thank you

hello alexandru7ac9a,

besides modify the flash_l4t_t186.xml config manually, please update the partition size in the flash scripts.
for example,

<i>$OUT/Linux_for_Tegra/flash.sh</i>

LNX_TAG+="-e s/LNXNAME/kernel/ ";
LNX_TAG+="-e s/LNXSIZE/67108864/ ";

Hello JerryChang,

I’ve done like you said:

LNX_TAG+="-e s/LNXNAME/kernel/ ";
LNX_TAG+="-e s/LNXSIZE/33554432/ ";

but I still get the exact same error and board restarts continuously:

[0001.895] I> Kernel type = Normal
[0001.898] I> Loading kernel/boot.img from built-in storage ...
[0001.903] W> No valid slot number is found in scratch register
[0001.909] W> Return default slot: _a
[0001.912] I> A/B: bin_type (24) slot 0
[0001.916] E> Cannot read beyond partition boundary for kernel
[0001.922] E> Failed to read bootimage partition
[0001.926] E> Cannot get binary info kernel
[0001.930] E> A/B loader failure
[0001.933] E> Top caller module: LOADER, error module: PARTITION_MANAGER, reason: 0x04, aux_info: 0x01

Maybe there’s something else I should try?

Are you able to reproduce this issue on your side on the tx2 with Jetpack 4.2?

Any suggestion is very appreciated, been searching everywhere but can’t find how I could lower partitions sizes without breaking booting.

Looks like this used to work with previous 28.2 releases…

hello alexandru7ac9a,

we found this is an internal bug for bootloader.
please consider this is a known issue for l4t-r32.1 and we’ll include the fix for the next public release (i.e. l4t-r32.2)
thanks

Thank you JerryChang, that is very good news! Can you confirm that also partitions before the kernel will be possible to have the size reduced if needed? I mean at least as to fit the binary that’s being written.

Hi JerryChang,

Can you please confirm if previous partitions like sce-fw and sc7 will be possible to be reduced too, or at least to be possible to remove a couple of redunant ones? Like to have only sce-fw, not sce-fw_b, only sc7 not sc7_b. I’m asking because I need to keep these partitions below total point of 49152 KiB from start of disk.

Thank you very much!

hello alexandru.costache.100,

you should customize the Partition Configuration File,
please refer to Partition Configuration chapter for the steps and details.
thanks

Thanks JerryChang, I understand that, just want to make sure that it will work to resize / shrink other partitions as expected using the partition specification guide, as it was reported to work in R28.x

I see JetPack 4.2.1 is on it’s way in a few days https://devtalk.nvidia.com/default/topic/1055631/jetson-tx2/new-jetson-software-modules-and-pricing/ so wanted to make sure these fixes will be in it.

hello alexandru.costache.100,

yes, as previous comment #5, I’ve confirmed this change already included into l4t-r32.2 code-line.
thanks