You need add your PCD into OVMF and make sure the OVMF.fd include it.
toggle quoted messageShow quoted text
You can check the code in MdeModulePkg\Universal\PCD\Dxe\Service.c for detail.
From: Konstantin Aladyshev <email@example.com>
Sent: Tuesday, June 29, 2021 5:47 PM
To: Jiang, Guomin <firstname.lastname@example.org>
Subject: Re: [edk2-discuss] Token values are not produced for PCDs under
Sorry, I didn't understand your answer. Could you please elaborate it for me.
I'm trying to write `UEFI_APPLICATION` and test its execution in UEFI Shell in
QEMU running OVMF.
I also use `DxePcdLib` as PcdLib in my package DSC file:
In this library LibPcdGet32 is translate to:
IN UINTN TokenNumber
return GetPcdProtocol()->Get32 (TokenNumber); } ``` So the correct
`TokenNumber` should be passed for this to work correctly.
But as I said Token for my variable is set to 0 for some reason in AutoGen.h:
#define _PCD_TOKEN_PcdMyDynamicVar32 0U ```
On Tue, Jun 29, 2021 at 12:25 PM Jiang, Guomin <email@example.com>
the value and freeze.
This should be compiled into PCD PEIMs and PCD DXE Drivers.
It will be contained by firmware eventually.
It seem that you haven’t changed the firmware, so the firmware can’t get
From: firstname.lastname@example.org <email@example.com> On Behalf Of
Sent: Tuesday, June 29, 2021 1:00 AM
Subject: [edk2-discuss] Token values are not produced for PCDs under
I'm trying to understand dynamic PCDs in EDK2.
I've added this code to my package DEC file:
And have added this code to my app INF file:
I'm trying to use PCD in my application like this:
PcdSet32S(PcdMyDynamicVar32, 52); Print(L"PcdMyDynamicVar32=%d\n",
But when I try to compile, the token number is not populated to the
at the `PcdSet32S` call.
#define _PCD_TOKEN_PcdMyDynamicVar32 0U #define
LibPcdSet32(_PCD_TOKEN_PcdMyDynamicVar32, (Value)) #define
Because of that I get 0 in the first `PcdGet32` call and my application freezes
token value will be populated:
But if I change `[PcdsDynamic]` to [PcdsDynamicEx] in my package DEC file
(Value)) #define _PCD_SET_MODE_32_S_PcdMyDynamicVar32(Value)_PCD_TOKEN_PcdMyDynamicVar32,
(Value))`[PcdsDynamic]` is used?
What is my mistake? Why is the token value not populated when