Unfortunately, you will need to trace your execution by yourself.
Everything seems correct but you might have missed a dependency in your code
(check library assignment in DSC file) or got an error in your code path.
Use DEBUG() macro or debugger to trace your execution.
Try to understand why ConSplitterDxe does not set gST->ConIn and gST->ConOut
might a good starting point.

> -----Original Message-----
> From: bhupesh.sha...@freescale.com
> [mailto:bhupesh.sha...@freescale.com]
> Sent: 09 December 2013 07:07
> To: Olivier Martin; bhupesh.sha...@freescale.com; 'Andrew Fish'; edk2-
> de...@lists.sourceforge.net
> Subject: RE: gST->ConOut is NULL and Timer issues (Was: RE: SerialPrint
> not working in DxeServicesLib.c)
> 
> Hi Olivier and Andrew,
> 
> Thanks for your respective suggestions. Accordingly I checked out my
> code and found out that:
> 
> 1.  I checked the relevant stuff in the DSC and FDF files and I have
> the following entries related to ConOut and ConIn:
> 
>   MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
>   MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
> 
> MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.in
> f
>   MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
>   EmbeddedPkg/SerialDxe/SerialDxe.inf
> 
>   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|FALSE
> 
>   # Use the serial console for both ConIn & ConOut
>   gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-
> 971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi();"
>   gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-
> 971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi()"
> 
>   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2E
> 
>   I can see the DEBUG() prints and well as the AsciiSPrint() on the
> console, but can't get any console output for the Print() directives.
> 
> 2. I was looking at the 'StartDefaultBootOnTimeout' function
> implementation inside Bds.c
> (https://github.com/tianocore/edk2/blob/master/ArmPlatformPkg/Bds/Bds.c
> #L322)
>    and cannot seem to understand which timer (the Metronome one  or the
> Periodic one will be called here) will be called to implement a timer
> event. To me
>    it seems the Periodic timer (TimerDxe rather than the TimerLib)
> would be involved here.
> 
>    Also, I think that since my gST->ConIn and gST->ConOut are both
> NULL, the 'StartDefaultBootOnTimeout' function will never get a gST-
> >ConIn->WaitForKey
>    and hence the default boot should start after
> 'PcdPlatformBootTimeOut' interval.
> 
> Is this understanding correct?
> 
> Regards,
> Bhupesh
> 
> > -----Original Message-----
> > From: Olivier Martin [mailto:olivier.mar...@arm.com]
> > Sent: Tuesday, December 03, 2013 4:48 PM
> > To: Sharma Bhupesh-B45370; 'Andrew Fish'; edk2-
> > de...@lists.sourceforge.net
> > Subject: RE: gST->ConOut is NULL and Timer issues (Was: RE:
> SerialPrint
> > not working in DxeServicesLib.c)
> >
> > Because you are using SerialDxe (see
> > 'VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)'), ensure you have the
> > following drivers in your DSC and FDF files:
> > - MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
> > - MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
> > - MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> >
> > ConSplitterDxe is the driver that will set gST->ConOut in this
> scenario.
> >
> > Olivier
> >
> >
> > > -----Original Message-----
> > > From: Bhupesh Sharma [mailto:bhupesh.sha...@freescale.com]
> > > Sent: 02 December 2013 11:09
> > > To: Olivier Martin; 'Andrew Fish'; 'edk2-
> de...@lists.sourceforge.net'
> > > Subject: gST->ConOut is NULL and Timer issues (Was: RE: SerialPrint
> > > not working in DxeServicesLib.c)
> > >
> > > Hi,
> > >
> > > I managed to trace down the issues with my UEFI ported code for a
> > > Cortex-A9 MP core based SoC.
> > >
> > > I see two issues (after solving a few on the way) on which I cannot
> > > seem to make any headway.
> > >
> > > 1. gST->ConOut is NULL causing the Print routines inside
> > > StartDefaultBootOnTimeout
> > >
> > >
> (https://github.com/tianocore/edk2/blob/master/ArmPlatformPkg/Bds/Bds.
> > > c
> > > #L327), to not print
> > >   anything on the UART console.
> > >
> > >   - At first, I suspected this to be an issue with my .dsc file as
> I
> > > don't have a LCD available on my SoC
> > >     and I had serial port as well as (a left over) LCD configured
> as
> > > SIMPLE TEXT protocols for ConOut.
> > >     I have hence changed my .dsc to something like:
> > >
> > >   # Use the serial console for both ConIn & ConOut
> > >
> gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-
> > > 971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi();"
> > >   gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-
> > > 971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi()"
> > >
> > >   However, still I see that gST->ConOut is NULL (via the DS-5
> source
> > > debugger).
> > >
> > > 2. Timer support in UEFI:
> > >
> > >  - For every BoardPkg (e.g. ArmPlatformPkg/SP804, BeagleBoardPkg
> and
> > > Samsung etc), I can see that there are two Timer helper layers:
> > >
> > >   # [1] Timer Dxe Driver:
> > >
> > >   https://github.com/tianocore/edk2/tree/master/ArmPlatformPkg/Driv
> > > ers/SP804TimerDxe
> > >
> > >   # [2] Timer Lib:
> > >
> > >   https://github.com/tianocore/edk2/tree/master/ArmPlatformPkg/Libr
> > > ary/SP804TimerLib
> > >
> > >
> > >   When I start to look at this code it seems that the UEFI code
> > > requires support for atleast 2 timers: Performance Timer (used in
> [1])
> > >       and another free SoC timer which is used to provide delays
> ([2]).
> > >
> > >   Is this understanding correct? Does UEFI require atleast 2 timers
> > to
> > > be supported by the SoC and are these timers used in parallel
> > >   by the UEFI framework?
> > >
> > > Thanks for any pointers on the above two aspects.
> > >
> > > Regards,
> > > Bhupesh
> > >
> > >
> > > > -----Original Message-----
> > > > From: Sharma Bhupesh-B45370
> > > > Sent: Tuesday, November 26, 2013 5:02 PM
> > > > To: Olivier Martin; 'Andrew Fish'; edk2-
> de...@lists.sourceforge.net
> > > > Cc: Kushwaha Prabhakar-B32579
> > > > Subject: RE: SerialPrint not working in DxeServicesLib.c
> > > >
> > > > Hi Olivier,
> > > >
> > > > Thanks for your mail.
> > > >
> > > > I have a SerialPortLib which tries to configure Serial controller
> > > > specific to my board (so *no* 'SerialPortLib' pointing to
> > > > 'MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf'
> > > > in my DSC).
> > > >
> > > > I am getting the UEFI firmware .. banner at the very start.
> > > >
> > > > I will now try to add some SerialPortWrite() before calling
> > > > GetSectionFromAnyFv().
> > > >
> > > > Regards,
> > > > Bhupesh
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Olivier Martin [mailto:olivier.mar...@arm.com]
> > > > > Sent: Tuesday, November 26, 2013 4:27 PM
> > > > > To: Sharma Bhupesh-B45370; 'Andrew Fish'; edk2-
> > > > > de...@lists.sourceforge.net
> > > > > Cc: Kushwaha Prabhakar-B32579
> > > > > Subject: RE: SerialPrint not working in DxeServicesLib.c
> > > > >
> > > > > Sorry to not reply earlier, I was on holiday in the last two
> weeks.
> > > > >
> > > > > If you do not see any output from the serial, ensure your are
> > > > > using the appropriate 'SerialPortLib'.
> > > > > Check in your DSC file, there is no 'SerialPortLib' pointing to
> > > > >
> 'MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf'.
> > > > > Example:
> > > > >
> > > > > [LibraryClasses.common]
> > > > >   (...)
> > > > >
> > > > >
> > >
> SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNu
> > > > > SerialPortLib|ll
> > > > > SerialPortLib|.inf
> > > > >   (...)
> > > > >
> > > > > SerialPortLib should use the implementation for your Serial
> > > controller.
> > > > >
> > > > > Try also to add some SerialPortWrite() before calling
> > > > > GetSectionFromAnyFv().
> > > > > I would not be surprised if the crash happens much earlier than
> > > > > the DXE phase.
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Bhupesh Sharma [mailto:bhupesh.sha...@freescale.com]
> > > > > > Sent: 20 November 2013 11:50
> > > > > > To: 'Andrew Fish'; 'edk2-devel@lists.sourceforge.net';
> Olivier
> > > > > > Martin
> > > > > > Cc: Prabhakar Kushwaha
> > > > > > Subject: RE: SerialPrint not working in DxeServicesLib.c
> > > > > >
> > > > > > I don't know why but I didn't get any mail from the mail list
> > > server
> > > > > > for my original mail below, though I can see same in the mail
> > > list
> > > > > > archives.
> > > > > >
> > > > > > Adding Andrew..
> > > > > >
> > > > > > Can you guys please help me with the issue mentioned below.
> > > > > >
> > > > > > Regards,
> > > > > > Bhupesh
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Sharma Bhupesh-B45370
> > > > > > > Sent: Tuesday, November 19, 2013 4:25 PM
> > > > > > > To: 'edk2-devel@lists.sourceforge.net'; 'Olivier Martin'
> > > > > > > Cc: 'boot-architect...@lists.linaro.org'; Kushwaha
> > > > > > > Prabhakar-B32579
> > > > > > > Subject: SerialPrint not working in DxeServicesLib.c
> > > > > > >
> > > > > > > Hi List,
> > > > > > >
> > > > > > > I am experiencing a Data Abort inside function
> > > > 'GetSectionFromAnyFv'
> > > > > > in
> > > > > > > file 'DxeServicesLib.c'
> > > > > > > on my ARMv7 UEFI platform.
> > > > > > >
> > > > > > > To debug the same I added some print messages like:
> > > > > > >
> > > > > > > /* Added for debugging */
> > > > > > >   CHAR8                         Buffer1[100];
> > > > > > >   UINTN                         CharCount;
> > > > > > >   CharCount = AsciiSPrint (Buffer1,sizeof (Buffer1),"Inside
> > > > > > Func\n\r");
> > > > > > >   SerialPortWrite ((UINT8 *) Buffer1, CharCount);
> > > > > > >
> > > > > > >
> > > > > > > And also something like:
> > > > > > >   SerialPrint ("Inside Func\n\r");
> > > > > > >
> > > > > > > I have included:
> > > > > > > #include <Library/PrintLib.h>
> > > > > > > #include <Library/SerialPortLib.h>
> > > > > > >
> > > > > > > and defined:
> > > > > > >
> > > > > > > #define SerialPrint(txt)  SerialPortWrite ((UINT8*)(txt),
> > > > > > > AsciiStrLen(txt)+1);
> > > > > > >
> > > > > > > I still cannot see any debug prints on the UART (placed
> right
> > > > > > > after
> > > > > > the
> > > > > > > entry point of 'GetSectionFromAnyFv' function).
> > > > > > > Debugger (DS-5) suggests that the crash is inside
> > > > > > 'GetSectionFromAnyFv'
> > > > > > > itself.
> > > > > > >
> > > > > > > I get the UEFI firmware <version xx built at xx on xx) and
> > > > > > > Data Abort Exception PC at xx prints on the console, but no
> > > > > > > prints
> > > from
> > > > > > > 'DxeServicesLib.c'
> > > > > > >
> > > > > > > Any pointers to what I may be missing here.
> > > > > > >
> > > > > > > Regards,
> > > > > > > Bhupesh
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> >
> >
> >
> >
> 





------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to