SourcePoint AMD Help
Table of Contents
- Using Help
- Contacting ASSET InterTech
- Introduction to SourcePoint
- SourcePoint Environment
- SourcePoint Overview
- SourcePoint Parent Window Introduction
- SourcePoint Icon Toolbar
- File Menu
- File Menu - Project Menu Item
- File Menu - Layout Menu Item
- File Menu - Program Menu Item
- File Menu - Macro Menu Item
- File Menu - Print Menu Items
- File Menu - Update Emulator Flash Menu Item
- File Menu - Program Target Device Menu Item
- File Menu - Other Menu Items
- Edit Menu
- View Menu
- Processor Menu
- Options Menu
- Options Menu - Preferences Menu Item
- Options Menu - Target Configuration Menu Item
- Options Menu - Load Target Configuration File Menu Item
- Options Menu - Save Target Configuration File Menu Item
- Options Menu - Emulator Configuration Menu Item
- Options Menu - Emulator Connection Menu Item
- Options Menu - Emulator Reset Menu Item
- Options Menu - Confidence Tests Menu Item
- Window Menu
- Help Menu
- How To -- SourcePoint Environment
- Add Emulator Connections
- Configure Custom Macro Icons
- Configure Autoloading Macros
- Display Text on the Icon Toolbar
- Edit Icon Groups to Customize Your Toolbars
- Modify a Defined Memory Region
- Refresh SourcePoint Windows
- Save a Program
- Start SourcePoint With Command Line Arguments
- Use the New Project Wizard
- Verify Emulator Network Connections
- SourcePoint Overview
- Breakpoints Window
- Code Window
- Command Window
- Command Window Overview
- Confidence Tests Window
- Descriptors Tables Window
- Devices Window
- Log Window
- Memory Window
- Page Translation Window
- Page Translation Windows Overview
- PCI Devices Window
- PCI Devices Window Overview
- How To - PCI Devices Window
- Registers Window
- Symbols Windows
- Viewpoint Window
- Watch Window
- Technical Notes
- SourcePoint Command Language
- Commands and Control Variables
- bell (beep)
- Character Functions
- cpubreak commands
- dbgbreak commands
- do while
- execution point ($)
- list, nolist
- log, nolog
- Memory Access
- print cycles
- Register Access
- softbreak, softremove, softdisable, softenable
- string [ ] (index into string)
- taskbreak, taskremove, taskdisable, taskenable
UEFI Framework Debugging
The Intel® Platform Innovation Framework for Unified Extensible Firmware Interface (UEFI), commonly known as the UEFI Framework, is a new firmware architecture standard that defines a set of software interfaces and replaces the legacy BIOS found on traditional PC computers. This framework provides the kind of modularity, flexibility, and extensibility that were formerly unavailable with traditional BIOS. With UEFI, BIOS developers can now write all their code in ’C’, rather than assembly language. See Intel’s web site at http://www.intel.com/technology/framework or http://www.tianocore.org for more information on UEFI Framework.
Along with this new firmware architecture and the ’C’ code that implements it comes the need for source-level debugging. Arium's debugger, SourcePoint™ (versions 7.0 and later) for Intel and AMD processors offers native debug support for UEFI Framework platforms. Users can set breakpoints, single step, view variables, see the call stack, and access all of the feature-rich functionality SourcePoint normally provides. This includes source-level debugging during the PEI, DXE, and OS Boot phases of UEFI. Below is a set of instructions for setting up SourcePoint to debug the UEFI Framework.
Note: The macros described below are installed in the Macro\UEFI sub-folder of the SourcePoint install path. Several of the UEFI macro files contain directory paths to other macro files. If you move the macro files or change the current working directory in SourcePoint (via the ’cwd’ command), you will need to update the macros files with the new locations.
After installing SourcePoint, run the EFI.mac macro file located in the Macro\UEFI directory. This creates six custom toolbar buttons and associates each with a corresponding UEFI proc.
• The StartPEI icon resets the target, then runs to PeiMain and loads the PEI symbols.
• The PEIMs (Pre-UEFI Initialization Modules) icon loads the symbol files for the PEI modules found in target memory.
• The DXEs (Driver Execution Environments) icon loads the symbol files for the DXE modules found in target memory.
• The HOBs (Hand-Off Blocks) icon displays a list of UEFI HOBs found in target memory.
• The SysConfigTable icon displays the contents of the UEFI system configuration table.
• The DumpMemMap icon displays the UEFI Memory Map.
EFI.mac toolbar buttons
The PEI environment requires a specialized configuration of SourcePoint. PEI gets control shortly after target reset. PEI modules are dispatched and executed after cache RAM is mapped into system memory and the stack is initialized. Having a stack this early allows ’C’ language code to execute, but a special memory map must be configured to take advantage of it.
To configure SourcePoint for source-level debugging of PEI code, follow these steps.
Optional: Select Options|Target Configuration|Memory Map from the menu, and set it similar to the following (your system may vary depending on your memory map):
The first entry in the table designates the first 1MB of system memory. The middle entry designates the location of the cache RAM mapped into system memory. The third entry designates the firmware ROM.
The StartPEI button will reset the target and step one instruction at a time until the processor enters protected mode. It then will load the PEI module symbols and run until PeiMain.
Alternatively, you can use the PEIs macro button at any time when the processor is in protected mode.
Command window after running PEIMs macro function
Symbols window after loading PEIM modules
Code window after loading PEIM modules
Once system RAM is initialized and the PEI phase completes, the DXE environment is entered. This is less specialized than PEI; nevertheless, it requires a few SourcePoint parameters to be set.
To configure SourcePoint for source-level debugging of DXE code, follow these steps:
Run the target to the UEFI shell, or as far as it will go in DXE.
Stop the target.
Click the DXEs toolbar icon to load the DXE symbols.
Browse the source code files using the Symbols window and set breakpoints in your code.
Reset the target and go until you hit a breakpoint.
DXE Code window
Open the Command window, and then click the HOBs toolbar icon to display the hand-off blocks on the target.
Example of HOB display
System Configuration Table
Open the Command window, and then click the SysConfigTable toolbar icon to display the contents of the UEFI system configuration table on the target.
Example of System Configuration Table
DXE Debugging Tip
To stop the target and load symbols just before a DXE module is dispatched, open the Symbols window, choose the Globals tab, and drill down to:
module: image (image.c)
Right click on CoreStartImage and select Open Code Window from the pop-up menu.
Set a processor breakpoint in CoreStartImage( ) where Image->EntryPoint( ) is called. This hits before each DXE module is dispatched, but afterwards its entry is placed in tables. Each time you hit this breakpoint, click the DXEs toolbar icon to load the DXE symbols.
Now you can load symbols just before your DXE module runs instead of running to the UEFI shell, then loading symbols, then resetting the target, then running to your breakpoint.
Watchdog Timer on Intel Platforms
Some motherboards with Intel processors have a TCO timer that will assert RESET independent of the emulator. See the Arium application note titled, "Disabling the TCO Timer in an Intel I/O Controller Hub" for details. Resetting the target from SourcePoint can cause a Target state undefined error message to appear because the timer asserts RESET and confuses the emulator. The solution to this problem is to configure the ICH_TCO_Timer_Disable.mac macro to run at every target reset.
The UEFI firmware on the target contains strings that hold the paths to the program symbol files on your hard drive. SourcePoint macros read target memory, find these strings, then load the symbol files specified in these paths. The symbol files must be located in the path specified in the UEFI firmware.
For example, one path might look like this:
This architecture, defined by Intel, presents a requirement for UEFI debugging. You must have the UEFI symbol files on the host computer in the same directories as specified in the firmware on the target. This should not be a problem if you build the UEFI firmware on the same host from which you run SourcePoint.
If the drive letter or path doesn’t match exactly, you can use the ’subst’ command from the Windows command prompt to map a drive letter to a desired path (example: 'subst d: c:\working\EFI').