This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Problem debugging bootloader using Ozone

Hi,

I'm trying to debug my bootloader (I2C specifically) using Ozone. However the CPU only seems to halt when trying to debug the bootloader.

Also setting breakpoints only results in the error code:

SetBreakpoint: JLINK API call failed

Settings breakpoints in the application however works fine and when running the application through Ozone does not result in the CPU halting. And I can trigger the breakpoints on the I2C event handler by sending something over I2C.

Based on this link i have modified the AfterTargetDownload and AfterTargetReset accordingly:

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(0x0);                         
    Target.SetReg("SP", SP);                                    
                                                                  
    PC = Target.ReadU32(0x0 + 0x4);                     
    Target.SetReg("PC", PC);                                    
  }
}

I'm not really sure where to go from here...

SDK: v15.0

Softdevice: v6.0.0

Br,

Anton

Related