Difference between revisions of "4-Pin Trace with LPC4357"
Line 3: | Line 3: | ||
=== 1. Create a file for the device === |
=== 1. Create a file for the device === |
||
+ | LPC4357.ini |
||
− | /*------------------------------------------------------------------- |
||
+ | /********************************************************************* |
||
− | ** Define the function to enable the trace port |
||
+ | * Configure pins to enable the trace port * |
||
− | **-----------------------------------------------------------------*/ |
||
+ | *********************************************************************/ |
||
− | FUNC void EnableTPIU(void) { |
||
− | _WDWORD(0x40086790, 0x00000032); // Configure PF_4 AS FUNC2 |
||
− | _WDWORD(0x40086794, 0x00000033); // Configure PF_5 as FUNC3 |
||
− | _WDWORD(0x40086798, 0x00000033); // Configure PF_6 as FUNC3 |
||
− | _WDWORD(0x4008679C, 0x00000033); // Configure PF_7 as FUNC3 |
||
− | _WDWORD(0x400867A0, 0x00000033); // Configure PF_8 as FUNC3 |
||
− | } |
||
+ | _WDWORD(0x40086790, 0x00000032); // Configure PF_4 AS FUNC2 |
||
− | /*------------------------------------------------------------------- |
||
+ | _WDWORD(0x40086794, 0x00000033); // Configure PF_5 as FUNC3 |
||
− | ** Invoke the function at debugger startup |
||
+ | _WDWORD(0x40086798, 0x00000033); // Configure PF_6 as FUNC3 |
||
− | **-----------------------------------------------------------------*/ |
||
+ | _WDWORD(0x4008679C, 0x00000033); // Configure PF_7 as FUNC3 |
||
− | EnableTPIU(); |
||
+ | _WDWORD(0x400867A0, 0x00000033); // Configure PF_8 as FUNC3 |
||
=== 2. Set the file as initialization file === |
=== 2. Set the file as initialization file === |
Revision as of 15:44, 15 January 2016
Contents
Configure required pins for trace output
1. Create a file for the device
LPC4357.ini
/********************************************************************* * Configure pins to enable the trace port * *********************************************************************/ _WDWORD(0x40086790, 0x00000032); // Configure PF_4 AS FUNC2 _WDWORD(0x40086794, 0x00000033); // Configure PF_5 as FUNC3 _WDWORD(0x40086798, 0x00000033); // Configure PF_6 as FUNC3 _WDWORD(0x4008679C, 0x00000033); // Configure PF_7 as FUNC3 _WDWORD(0x400867A0, 0x00000033); // Configure PF_8 as FUNC3
2. Set the file as initialization file
- Open the dialog "Options for Target - Debug".
- Set the created file as Initialization File.
Configure µVision for ETM trace
- Click Settings to open the "Target Driver Setup" dialog.
- Click the Trace tab.
- Set Enable and ETM Trace Enable.
- Set Trace Port to "Sync Trace Port with 4-bit Data".
- Start the debugging session and open an "Instruction Trace" window.