-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.jdebug
More file actions
39 lines (32 loc) · 879 Bytes
/
project.jdebug
File metadata and controls
39 lines (32 loc) · 879 Bytes
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
void OnProjectLoad (void) {
Edit.SysVar (VAR_HSS_SPEED, FREQ_100_HZ);
Project.SetDevice ("STM32F103C8");
Project.SetHostIF ("USB", "");
Project.SetTargetIF ("SWD");
Project.SetTIFSpeed ("4 MHz");
Project.AddSvdFile ("$(InstallDir)/Config/CPU/Cortex-M3.svd");
Project.AddSvdFile ("STM32F103xx.svd");
File.Open ("build/ds18b20_demo.elf");
}
void AfterTargetReset (void) {
_SetupTarget();
}
void AfterTargetDownload (void) {
_SetupTarget();
}
void _SetupTarget(void) {
unsigned int SP;
unsigned int PC;
unsigned int VectorTableAddr;
VectorTableAddr = Elf.GetBaseAddr();
SP = Target.ReadU32(VectorTableAddr);
if (SP != 0xFFFFFFFF) {
Target.SetReg("SP", SP);
}
PC = Elf.GetEntryPointPC();
if (PC != 0xFFFFFFFF) {
Target.SetReg("PC", PC);
} else {
Util.Error("Project script error: failed to set up entry point PC", 1);
}
}