Qiu,
You need to make sure the flow control setting between HOST and TARGET are the 
same. In your case, you need to change the 
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl to TRUE.



From: Kan Qiu [mailto:kan...@osbase.com]
Sent: Thursday, May 21, 2015 2:11 AM
To: Ni, Ruiyu
Cc: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] Debug UEFI driver using EDKII

Hi Ray
Have you got any findings ? I have dumped the log file into email text below in 
case the attachment didn't work, looks like the target side has no issue of 
communicating to host since the log does reflect what's going on with DUET 
Loader, how can we adjust HOST side software(Intel(R) UDK Debugger Tool v1.4) 
to work with Windbg ?
Thanks
Kan
===Configuration===
Debug Port:
  Channel: SERIAL
  Port: COM3
  BaudRate: 115200
  FlowControl: 1
Target System:
  ProcessorCount: 2
  FlashBase: 0xFF000000
  FlashSize: 0x1000000
Features:
  TerminalRedirectionPort: 20715
  ModeSwitchBreak: 1
  SymbolPath:
Maintenance:
  Trace: 1f
  Debug: 1
  RetryTimeout: 500
  ResetDelay: 0
Features:
  LoadModuleSymbol: 1
Debugger:
  Exe: C:\Program Files (x86)\Debugging Tools for Windows (x86)\windbg.exe
  Directory: C:\Program Files (x86)\Debugging Tools for Windows (x86)
üEnter DUET Loader...
BiosMemoryMapBaseAddress = 20710
Get 11 entries of memory map!
Decompress BFV image, Image Address = 366A4 Offset = 146A4
BFV decompress: DestinationSize = A0000, ScratchSize = 10000
Decompress DxeIpl image, Image Address = 26270 Offset = 4270
Start load DxeIpl PE image
LoadPe: new image base 7B8FB000
DxeIpl PE image is successed loaded at 7B8FA000, entry=7B8FB669
Decompress DxeMain FV image, Image Address = 2820B Offset = 620B
LoadPe: new image base 7B8DD000
DxeCore PE image is successed loaded at 7B8DA000, entry=7B8DD260

EFI Memory Descriptors
Type = 7 Start = 00000000 NumberOfPages = 0000009F
Type = 0 Start = 0009F000 NumberOfPages = 00000001
Type = 0 Start = 0009F000 NumberOfPages = 00000001
Type = 0 Start = 000E8000 NumberOfPages = 00000018
Type = 7 Start = 00100000 NumberOfPages = 0007B7DA
Type = A Start = 7B9A1000 NumberOfPages = 00000003
Type = A Start = 7B9A3000 NumberOfPages = 00000001
Type = 0 Start = 7B9A3000 NumberOfPages = 0000265D
Type = 0 Start = F4000000 NumberOfPages = 00004000
Type = 0 Start = FEC00000 NumberOfPages = 00000140
Type = 0 Start = FED45000 NumberOfPages = 000012BB
Type = 6 Start = 7B901000 NumberOfPages = 000000A0
Type = 5 Start = 7B8FB000 NumberOfPages = 00000006
Type = 6 Start = 7B8FA000 NumberOfPages = 00000001
Type = 5 Start = 7B8DD000 NumberOfPages = 0000001D
Type = 6 Start = 7B8DA000 NumberOfPages = 00000003
Transfer to DxeIpl ...EntryPoint = 7B8FB669
Enter DxeIpl ...
Handoff:
Handoff.BfvBase = 7B901000, BfvLength = A0000
Handoff.DxeIplImageBase = 7B8FA000, DxeIplImageSize = 7000
Handoff.DxeCoreImageBase = 7B8DA000, DxeCoreImageSize = 20000
Prepare Cpu HOB information ...
Prepare BFV HOB information ...
Prepare Memory HOB information ...
Prepare NV Storage information ...
NV Storage Base = 7B8AA000
Stack Top=0x7B8AA000, Stack Bottom=0x7B88A000
Prepare DxeCore memory Hob ...

AcpiTable=0xE5810 SMBIOS Table=0xF9C00 MPS Table=0xF9BF0
HobStart = 768AA000
Memory Top = 7B8AA000, Bottom = 768AA000
Free Memory Top = 7B887000, Bottom = 768AB058
NvStorageFvb = 7B8AA000, Length = 20000
BfvResource = 7B901000, Length = A0000
NvStorageFvResource = 7B8AA000, Length = 10000
NvStorage = 7B8AA048, Length = 4000
NvFtwFvResource = 7B8BA000, Length = 20000
NvFtwWorking = 7B8BA048, Length = 2000
NvFtwSpare = 7B8BC048, Length = 10000
Stack = 7B88A000, StackLength = 20000
PageTable = 7B888000
MemoryFreeUnder1MB = 86000, MemoryFreeUnder1MBLength = 19800
MemoryAbove1MB = 100000, MemoryAbove1MBLength = 7B7AA000
MemoryAbove4GB = 0, MemoryAbove4GBLength = 0
DxeCore = 7B8DA000, DxeCoreLength = 27000
MemoryAllocation = 7B887000, MemoryLength = 3000
$









                         WELCOME TO EFI WORLD!

Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool 
v1.4) ...
    Received data [ fe 3f 06 00 59 ba ]
    Request = 0
    m_WaitingAckForReset is 0 when INIT_BREAK
    Halt() called
    Halt() returning - failed (80000013)

On Mon, May 18, 2015 at 10:58 PM, Kan Qiu 
<kan...@osbase.com<mailto:kan...@osbase.com>> wrote:
Thanks Ray
Please find attached udk-debugger-trace.log,
......
                         WELCOME TO EFI WORLD!

Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool 
v1.4) ...
    Received data [ fe 3f 06 00 59 ba ]
    Request = 0
    m_WaitingAckForReset is 0 when INIT_BREAK

then I tried to break in frm windbg, which resulted into
    Halt() called
    Halt() returning - failed (80000013)
at the very end.

I also added   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl 
|FALSE to DuetPkgIa32.dsc when I built firmware this time.
Thanks
Kan

On Mon, May 18, 2015 at 10:22 PM, Ni, Ruiyu 
<ruiyu...@intel.com<mailto:ruiyu...@intel.com>> wrote:
Kan,
Please edit SoftDebugger.ini to set [Debug]/Trace = 0x1f.
Then send out the C:\Users\<uid>\udk-debugger-trace.log.

Thanks,
Ray

From: Kan Qiu [mailto:kan...@osbase.com<mailto:kan...@osbase.com>]
Sent: Monday, May 18, 2015 11:49 AM
To: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
Subject: Re: [edk2] Debug UEFI driver using EDKII

Hi Ruiyu,
Thank you so much for responding. I added the following SOURCE_DEBUG_ENABLE to 
DuetPkgIa32 and DuetPkg.fdf,
did
build -D SOURCE_DEBUG_ENABLE -p DuetPkg\DuetPkgIa32.dsc -a IA32,
cd DuetPkg
PostBuild.bat IA32
CreateBootDisk.bat usb e: FAT32 IA32
CreateBootDisk.bat usb e: FAT32 IA32 step2
Then boot up the firmware on target machine, it's a HP Compaq dc 7900, which is 
has a COM1 port,
connected to host with a Plugable USB Serial Converter.
Host side(which has USB port) is Win7 X64, installed
http://firmware.intel.com/sites/default/files/2013-WW52-UDK.Debugger.Tool-1.4-Windows.zip
and required version of windbg configured at the right COM port
However, Windbg is never able to get connected when the firmware is booting at 
Target and Target screen stuck
at something like UEFI world..., but firmware without SOURCE_DEBUG_ENABLE boots 
just fine.
I have verified that the same cable settings works with Windows debugging if I 
boot target to Windows
and I was able to connect Windows via kernel mode Windbg from host, so there 
should be no issue
with physical cable connection.
Could you please advise if my settings below are correct ? Also the reason I 
use DuetPkg is so that
I could test with hardware USB device, please let me know if you know of any 
other package that works better
with debugging USB drivers.
Thanks
Kan

!ifdef $(SOURCE_DEBUG_ENABLE)
  
PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf
  
DebugCommunicationLib|SourceLevelDebugPkg/Library/DebugCommunicationLibSerialPort/DebugCommunicationLibSerialPort.inf
  DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
  ResetSystemLib|PcAtChipsetPkg/Library/ResetSystemLib/ResetSystemLib.inf
  LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf
!else
  
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
  DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
!endif
!ifdef $(SOURCE_DEBUG_ENABLE)
[LibraryClasses.common.SEC]
  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
  DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
[LibraryClasses.common.PEIM]
  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
  DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
[LibraryClasses.common.DXE_DRIVER]
  DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
!endif
[LibraryClasses.common.DXE_CORE]
  HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
  
MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
!ifdef $(SOURCE_DEBUG_ENABLE)
  DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
  DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
!endif
[PcdsFixedAtBuild]
  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x0
  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0
  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x0
  gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE
!ifdef $(SOURCE_DEBUG_ENABLE)
  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom1Enable|FALSE
  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17
  gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
!endif

and the following changes to DuetPkg.fdf

!ifndef $(SOURCE_DEBUG_ENABLE)
INF  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf ## comment this 
out to free serial port for debugging
!endif

!ifndef $(SOURCE_DEBUG_ENABLE)
INF  IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf
!endif

From: Ni, Ruiyu <ruiyu.ni@in...<mailto:ruiyu.ni@in...>> - 2015-05-18 02:21:33
Attachments: Message as 
HTML<https://sourceforge.net/p/edk2/mailman/attachment/734D49CCEBEEF84792F5B80ED585239D0ABAE9B3%40SHSMSX103.ccr.corp.intel.com/1/>


Please give a list of detailed steps about what you did to try UDK Debugger.



From: Kan Qiu [mailto:kanqiu@<mailto:kanqiu@>...]

Sent: Sunday, May 17, 2015 1:43 PM

To: edk2-devel@...

Subject: [edk2] Debug UEFI driver using EDKII



Hi I'm new to EDKII. I need to write a UEFI driver and I'm having difficulty 
setting up SourceLevelDebugging. I can build DuetPkg and boot up the firmware, 
but I'm not able to enable SourceLevelDebug with COM port using Windbg, I 
followed 
http://firmware.intel.com/sites/default/files/UDK-Debugger-Tool-User-Manual-SR1-v1-91_0.pdf
 and incorporated DuetPkg with needed debugger libs.

Could anyone please advise me or point me a working example of enabling source 
level debugging ?

Thanks

Kan




------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to