How can I compile "nvidia-uefi\edk2\MdeModulePkg\Application\HelloWorld"?

Hi,I am trying to add my own UEFI_APPLICATION into uefi. but I don’t know how to compile it.
I also find that “edk2\MdeModulePkg\Application\HelloWorld” did not been compiled after I executed command “edk2-nvidia/Platform/NVIDIA/Jetson/build.sh” according the follow link:
Build without docker · NVIDIA/edk2-nvidia Wiki · GitHub]
There are only four applications that have been complied.

However,there are eight Applications in directory “nvidia-uefi\edk2\MdeModulePkg\Application”.

image

So I want to know the configuration differences between the eight applications and how to compile all the applications.
BTW, I also want to know how to add my own UEFI_APPLICATION into uefi.

Thanks!

To build HelloWolrd application in UEFI, you could refer to the following patch.

diff --git a/Platform/NVIDIA/NVIDIA.common.dsc.inc b/Platform/NVIDIA/NVIDIA.common.dsc.inc
--- a/Platform/NVIDIA/NVIDIA.common.dsc.inc
+++ b/Platform/NVIDIA/NVIDIA.common.dsc.inc
@@ -896,6 +896,7 @@
   }
   MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
   MdeModulePkg/Application/VariableInfo/VariableInfo.inf
+  MdeModulePkg/Application/HelloWorld/HelloWorld.inf
 
   #
   # Default Security Key Enrollment Application.
diff --git a/Platform/NVIDIA/NVIDIA.fvmain.fdf.inc b/Platform/NVIDIA/NVIDIA.fvmain.fdf.inc
--- a/Platform/NVIDIA/NVIDIA.fvmain.fdf.inc
+++ b/Platform/NVIDIA/NVIDIA.fvmain.fdf.inc
@@ -194,6 +194,7 @@
   INF MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
   INF MdeModulePkg/Application/VariableInfo/VariableInfo.inf
   INF SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.inf
+  INF MdeModulePkg/Application/HelloWorld/HelloWorld.inf
 
   #
   # SMBIOS/DMI
1 Like

Thanks.
According your reply, I have built HelloWolrd application in UEFI successfully.
There are still something that make me confused .

  1. How to add the HelloWolrd.efi into fs0(esp blk0)like BootManagerMenuApp.efi or CapsuleApp.efi ?

Actually, I have tested HelloWolrd.efi by putting it into fs4. And it worked well.
image

2.Why I don’t see L4TLauncher.efi? When I run BootManagerMenuApp.efi or BOOTAA64.efi ,it will loader library ‘L4TLauncher.dll’,then it loader driver ‘L4TLauncher.efi’.


Does it mean L4TLauncher.dll include L4TLauncher.efi?

Thanks again!

FS0 is usually UEFI’s own file system.
Is there other media mounted on your system for FS4?

UEFI will load L4TLauncher.efi from ESP partition, it is the same as BOOTAA64.efi, just using different name.
May I know what’s your current use case?

NO,it isn’t. I don’t change the settings. I still use the original configuration.So there is no other media mounted for FS4.

Got it.Is there any way to update UEFI’s own file system? such as making a new UEFI file system and reflash.

FS4 is ESP partition,isn’t it?

My current case like this:
1,Use gpio to select boot mode .
2.Add a boot mode: uefi use spi interface to load kernel and dtb into ddr ,and boot kernel from ddr.

In order to accomplish the two function,I need to figure out the whole software boot flow.
I am appreciate it that if you have any other suggestions.
Thanks.

For you first case, it seems i have replied you in this thread.

For this use case, what do you mean about “use spi interface to load kernel and dtb”? Do you load kernel image and dtb on another module?
Could you help to clarify more about this use case?

Are you using the devkit or custom board?
Is there only internal eMMC on your board? (i.e. no SD or USB or NVMe SSD)

Yes,it is.

I still load kernel image and dtb on jetson-agx-xavier-industrial module. Once the product has be applied on project. there is no host computer. so it’s not easy to update the module by the existing way.According 40-pin Expansion Header, This module has a spi interface that can connect with other device,such as FPGA. We want use spi interface as a reserved way to update kernel and dtb.
BTW,in the uefi-source.I just find QSPI driver named QspiControllerDxe,I dont’t know if it can be configured as SPI mode to driver spi interface (SPI1) .

Now I use devkit for debug,but I will verify all the test function on custom board.There is no SD or USB or NVMe SSD on custom board.if you have any suggestion,I’d like to test on devkit.

Thanks.

Are you using Xavier AGX Industrial rather than Xavier AGX?

Have you tried to use image-based OTA for your use case?
It could update both rootfs and bootloader.

It seems not the official feature from us, you might need to implement it manually.
Actually, you could just use ssh through network log-in to device and update the kernel image and dtb.

Yes, you could just verify with just using internal eMMC.

Actually,I have both Xavier AGX Industrial and Xavier AGX. But finally Xavier AGX Industrial will be used in the product.

No,I haven’t. I will read OTA chapter and try it later.

That’s good suggestion.But network interface won’t be connected once the product is applied in the project.

About SPI,does it ok?May I use QspiControllerDxe to driver driver spi interface (SPI1) ?If not,any suggestion for using spi1?

Thank you.

You could keep USB interface, there’s l4tbr0 interface that you could also use to access the board.

QspiControllerDxe seems not for SPI interface.
You may try to use UART through TegraUartDxe for your use case.

OK. Thanks for your suggestions. I will re-check my software solutions.
I will open a new thread if I have any other questions after I discuss with my colleagues.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.