Hi @JerryChang,
Yes, I’ve dual boot enabled and it works, including bootloader update.
Let me share the last test result. The issue isn’t happening when updating the system, but just by rebooting multiples times (around 370 times).
I added a debug message inside EDK2, exactly at line edk2/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c at r35.5.0-edk2-stable202208 · NVIDIA/edk2 · GitHub. Below are the changes, I added the two lines with “DIOGO14” and have my build is done with EDK2_BUILD_MODE:pn-edk2-firmware-tegra = "DEBUG"
:
//
// Parse non-volatile variable data and get last variable offset.
//
Variable = GetStartPointer (mNvVariableCache);
while (IsValidVariableHeader (Variable, GetEndPointer (mNvVariableCache))) {
NextVariable = GetNextVariablePtr (Variable, mVariableModuleGlobal->VariableGlobal.AuthFormat);
DEBUG ((DEBUG_ERROR, "DIOGO14 Variable: %s\n", GetVariableNamePtr (Variable, mVariableModuleGlobal->VariableGlobal.AuthFormat)));
VariableSize = (UINTN)NextVariable - (UINTN)Variable;
if ((Variable->Attributes & (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_HARDWARE_ERROR_RECORD)) == (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_HARDWARE_ERROR_RECORD)) {
mVariableModuleGlobal->HwErrVariableTotalSize += VariableSize;
} else {
mVariableModuleGlobal->CommonVariableTotalSize += VariableSize;
DEBUG ((DEBUG_ERROR, "DIOGO14 CommonVariableSpace = 0x%x - CommonVariableTotalSize = 0x%x\n", mVariableModuleGlobal->CommonVariableSpace, mVariableModuleGlobal->CommonVariableTotalSize));
}
Variable = NextVariable;
}
Every time that the board reboots it is creating two new variables MTC
and PlatformConfigData
, but it isn’t overwriting the old variable, I mean, it is writing the new variable into a new memory allocation, the system works until the free space is gone. See the UART logs below:
diogo14.txt (15.3 KB)
While CommonVariableTotalSize
is smaller than CommonVariableSpace
, everything works, but after ~370 reboots, that variable free space is gone.