Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void TargetReset (void) {
- unsigned int AIRCR;
- unsigned int SCB_AIRCR_VECTKEY;
- unsigned int SCB_AIRCR_VECTRESET;
- AIRCR = 0xE000ED0C;
- SCB_AIRCR_VECTKEY = 0x5fa0000;
- SCB_AIRCR_VECTRESET = 0x1;
- *AIRCR = SCB_AIRCR_VECTRESET | SCB_AIRCR_VECTRESET;
- //
- // unsigned int SP;
- // unsigned int PC;
- // unsigned int VectorTableAddr;
- //
- // VectorTableAddr = Program.GetBaseAddr();
- //
- // if (VectorTableAddr != 0xFFFFFFFF) {
- // SP = Target.ReadU32(VectorTableAddr);
- // Target.SetReg("SP", SP);
- // } else {
- // Util.Log("Project file error: failed to get program base");
- // }
- //
- // PC = Elf.GetEntryPointPC();
- //
- // if (PC != 0xFFFFFFFF) {
- // Target.SetReg("PC", PC);
- // } else if (VectorTableAddr != 0xFFFFFFFF) {
- // PC = Target.ReadU32(VectorTableAddr + 4);
- // Target.SetReg("PC", PC);
- }
- void AfterTargetReset (void) {
- unsigned int SP;
- unsigned int PC;
- unsigned int VectorTableAddr;
- VectorTableAddr = 0x8000000; //boardloader vector offset
- if (VectorTableAddr != 0xFFFFFFFF) {
- SP = Target.ReadU32(VectorTableAddr);
- Target.SetReg("SP", SP);
- } else {
- Util.Log("Project file error: failed to get program base");
- }
- PC = Target.ReadU32(VectorTableAddr + 4);
- Target.SetReg("PC", PC);
- }
Add Comment
Please, Sign In to add comment