-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRB3Gen2.JLinkScript
More file actions
56 lines (48 loc) · 2.35 KB
/
RB3Gen2.JLinkScript
File metadata and controls
56 lines (48 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// void ResetTarget(void) {
// int v;
// int Speed;
// int Ctrl;
// Report("******************************************************");
// Report("J-Link script: ResetTarget()");
// Report("******************************************************");
// Speed = JTAG_Speed;
// JTAG_Speed = 100;
// JTAG_WriteClocks(1);
// JLINK_MEM_WriteU32(0x6B0E0D8, 0x2);
// JTAG_WriteClocks(1);
// JLINK_MEM_WriteU32(0x6B0E0D8, 0x1);
// JTAG_WriteClocks(1);
// JTAG_Speed = Speed;
// }
/*********************************************************************
*
* ConfigTargetSettings()
*/
int ConfigTargetSettings(void) {
//
// Setup AP map:
// AP[0] AXI-AP Connected to system memory. May be used for RTT / HSS as well as MMU independent peripheral acces
// AP[1] APB-AP Debug AP. Connected to debug registers etc. of the cores
// AP[2] JTAG-AP ???
//
// AP address in DAP space can be retrieved from MCU vendor.
// For CoreSight SoC-400 and earlier, APAddr = APIndex << 24. This is no longer the case for CoreSight SoC-600 and later.
// Note that "index" inside this command is the index inside the AP map of the J-Link software. It is not related to any index on the hardware/chip side.
//
//JLINK_ExecCommand("CORESIGHT_AddAP = Index=0 Type=AXI-AP Addr=0x00000000"); // AXI-AP
//JLINK_ExecCommand("CORESIGHT_AddAP = Index=1 Type=APB-AP Addr=0x01000000");
//JLINK_ExecCommand("CORESIGHT_AddAP = Index=2 Type=JTAG-AP Addr=0x02000000");
// JLINK_ExecCommand("CORESIGHT_SetIndexAPBAPToUse = 1"); // Define which APB-AP to use for debugging (the one that is connected to the core)
//JLINK_ExecCommand("CORESIGHT_SetIndexBGMemAPToUse = 0"); // Use AXI-AP for RTT/HSS
JLINK_ExecCommand("CORESIGHT_SetCoreBaseAddr = 0x87010000"); // Debug registers of CPU0 in APB-AP address space
JLINK_ExecCommand("CORESIGHT_SetCTICoreBaseAddr = 0x87020000"); // CTI of CPU0. Needed for ARMv8-A/R based cores to halt + resume the core
JLINK_ExecCommand("map exclude 0x14604000-0x1467FFFF");
JLINK_ExecCommand("map exclude 0x146C0000-0x147FFFFF");
JLINK_ExecCommand("map exclude 0x7EFFFFF0-0x7FFFFFFF");
// Configure target
// JTAG chain detection found 2 devices:
// #0 Id: 0x5BA00477, IRLen: 04, CoreSight JTAG-DP
// #1 Id: 0x0015A0E1, IRLen: 11, Unknown device
// JLINK_ExecCommand("JTAGConf 4, -1");
return 0;
}