Skip to content

Commit

Permalink
debug: update ozone config
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Sitbon <[email protected]>
  • Loading branch information
sitbon committed Nov 21, 2018
1 parent 820c5db commit 40ce5ed
Showing 1 changed file with 93 additions and 108 deletions.
201 changes: 93 additions & 108 deletions etc/dbg/fw.jdebug
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@
**********************************************************************
*/
void OnProjectLoad (void) {

Project.SetDevice ("MK66FX1M0xxx18");
//
// Dialog-generated settings
//
Project.SetDevice ("MK66FN2M0xxx18");
Project.SetHostIF ("USB", "203200983");
Project.SetTargetIF ("SWD");
Project.SetTIFSpeed ("10 MHz");
Project.AddSvdFile ("Cortex-M4.svd");
File.Open ("/home/jq/evo/intel/pr/rf/kinetis-radio/build/fw/fw.elf");
Project.SetTIFSpeed ("4 MHz");
Project.AddSvdFile ("$(InstallDir)/Config/CPU/Cortex-M4F.svd");
Project.AddPathSubstitute ("/home/jq/intel/pr/rf/cloudchaser/etc/dbg", "$(ProjectDir)");
Project.AddPathSubstitute ("/home/jq/intel/pr/rf/cloudchaser/etc/dbg", "$(ProjectDir)");
//
// User settings
//
File.Open ("/home/jq/intel/pr/rf/cloudchaser/build/fw.elf");
}

/*********************************************************************
Expand All @@ -31,26 +38,27 @@ void OnProjectLoad (void) {
*
**********************************************************************
*/
/*
void TargetReset (void) {

unsigned int SP;
unsigned int PC;
unsigned int VectorTableAddr;

Util.Log("Resetting Program.");

Exec.Reset();

VectorTableAddr = Elf.GetBaseAddr();

SP = Target.ReadU32(VectorTableAddr);
Target.SetReg("SP", SP);

PC = Target.ReadU32(VectorTableAddr + 4);
Target.SetReg("PC", PC);
}
*/
//void TargetReset (void) {
//
// unsigned int SP;
// unsigned int PC;
// unsigned int VectorTableAddr;
//
// Exec.Reset();
//
// VectorTableAddr = Elf.GetBaseAddr();
//
// if (VectorTableAddr != 0xFFFFFFFF) {
//
// Util.Log("Resetting Program.");
//
// SP = Target.ReadU32(VectorTableAddr);
// Target.SetReg("SP", SP);
//
// PC = Target.ReadU32(VectorTableAddr + 4);
// Target.SetReg("PC", PC);
// }
//}

/*********************************************************************
*
Expand All @@ -61,24 +69,37 @@ void TargetReset (void) {
*
**********************************************************************
*/
/*
void BeforeTargetReset (void) {
}
*/
//void BeforeTargetReset (void) {
//}

/*********************************************************************
*
* AfterTargetReset
*
* Function description
* Event handler routine. Optional.
* Event handler routine.
* - Sets the PC register to program reset value.
* - Sets the SP register to program reset value on Cortex-M.
*
**********************************************************************
*/
/*
void AfterTargetReset (void) {
}
*/
void AfterTargetReset (void) {
unsigned int SP;
unsigned int PC;
unsigned int VectorTableAddr;

VectorTableAddr = Elf.GetBaseAddr();

if (VectorTableAddr == 0xFFFFFFFF) {
Util.Log("Project file error: failed to get program base");
} else {
SP = Target.ReadU32(VectorTableAddr);
Target.SetReg("SP", SP);

PC = Target.ReadU32(VectorTableAddr + 4);
Target.SetReg("PC", PC);
}
}

/*********************************************************************
*
Expand All @@ -89,24 +110,20 @@ void AfterTargetReset (void) {
*
**********************************************************************
*/
/*
void DebugStart (void) {
}
*/
//void DebugStart (void) {
//}

/*********************************************************************
*
* TargetConnect
*
* Function description
* Replaces the default target device connect routine. Optional.
* Replaces the default target IF connection routine. Optional.
*
**********************************************************************
*/
/*
void TargetConnect (void) {
}
*/
//void TargetConnect (void) {
//}

/*********************************************************************
*
Expand All @@ -117,10 +134,8 @@ void TargetConnect (void) {
*
**********************************************************************
*/
/*
void BeforeTargetConnect (void) {
}
*/
//void BeforeTargetConnect (void) {
//}

/*********************************************************************
*
Expand All @@ -131,10 +146,8 @@ void BeforeTargetConnect (void) {
*
**********************************************************************
*/
/*
void AfterTargetConnect (void) {
}
*/
//void AfterTargetConnect (void) {
//}

/*********************************************************************
*
Expand All @@ -145,10 +158,8 @@ void AfterTargetConnect (void) {
*
**********************************************************************
*/
/*
void TargetDownload (void) {
}
*/
//void TargetDownload (void) {
//}

/*********************************************************************
*
Expand All @@ -159,43 +170,37 @@ void TargetDownload (void) {
*
**********************************************************************
*/
/*
void BeforeTargetDownload (void) {
}
*/
//void BeforeTargetDownload (void) {
//}

/*********************************************************************
*
* AfterTargetDownload
*
* Function description
* Event handler routine.
*
* Notes
* This sample implementation demonstrates the application
* initialization on a Cortex-M target.
* If no initialization can be done, Target.Reset() may be called.
* - Sets the PC register to program reset value.
* - Sets the SP register to program reset value on Cortex-M.
*
**********************************************************************
*/
/*
void AfterTargetDownload (void) {

unsigned int SP;
unsigned int PC;
unsigned int VectorTableAddr;

Util.Log("Initializing PC and SP.");

VectorTableAddr = Elf.GetBaseAddr();

SP = Target.ReadU32(VectorTableAddr);
Target.SetReg("SP", SP);

PC = Target.ReadU32(VectorTableAddr + 4);
Target.SetReg("PC", PC);
}
*/
void AfterTargetDownload (void) {
unsigned int SP;
unsigned int PC;
unsigned int VectorTableAddr;

VectorTableAddr = Elf.GetBaseAddr();

if (VectorTableAddr == 0xFFFFFFFF) {
Util.Log("Project file error: failed to get program base");
} else {
SP = Target.ReadU32(VectorTableAddr);
Target.SetReg("SP", SP);

PC = Target.ReadU32(VectorTableAddr + 4);
Target.SetReg("PC", PC);
}
}

/*********************************************************************
*
Expand All @@ -206,10 +211,8 @@ void AfterTargetDownload (void) {
*
**********************************************************************
*/
/*
void BeforeTargetDisconnect (void) {
}
*/
//void BeforeTargetDisconnect (void) {
//}

/*********************************************************************
*
Expand All @@ -220,10 +223,8 @@ void BeforeTargetDisconnect (void) {
*
**********************************************************************
*/
/*
void AfterTargetDisconnect (void) {
}
*/
//void AfterTargetDisconnect (void) {
//}

/*********************************************************************
*
Expand All @@ -234,21 +235,5 @@ void AfterTargetDisconnect (void) {
*
**********************************************************************
*/
/*
void AfterTargetHalt (void) {
}
*/

/*********************************************************************
*
* BeforeTargetResume
*
* Function description
* Event handler routine. Optional.
*
**********************************************************************
*/
/*
void BeforeTargetResume (void) {
}
*/
//void AfterTargetHalt (void) {
//}

0 comments on commit 40ce5ed

Please sign in to comment.