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

sd_softdevice_enable never returns

Hello,

The sd_softdevice_enable never returns, how can I investigate please ?

With my Jlink probe, it's look halted at address 0x000008CC.

Configuration:

SDK 15.0.0, SD_132_6.0.0 with bootloader

Parents Reply Children
  • The softdevice needs to execute code pre-main. 

    https://forum.segger.com/index.php/Thread/5252-oZone-IAR-ElfDwarf-problems-and-unexpected-break. It may look like the stuff in this thread is unrelated to the one you describe, but it shares the same problems. Note, the first issue I mention there about the Elf/Dwarf warning has nothing to do with this specific problem.

    If you're using oZone, you need to modify the .jdebug file that is generated by oZone (provided you saved one!).

    Start with simply opening your project in oZone and reset the target. In the console windows, you should see something like this:

    Debug.Halt();
    Debug.Reset();
    J-Link: Reset: Halt core after reset via DEMCR.VC_CORERESET.
    J-Link: Reset: Reset device via AIRCR.SYSRESETREQ.
    Target.SetReg ("SP", 0x20000400);
    Target.SetReg ("PC", 0x8E9);

    Jot down the two addresses shown for future reference.

    Then save the project, close oZone and open the saved .jdebug file in your favorite ASCII editor. Now search for the AfterTargetReset function and modify it to read:

    void AfterTargetReset (void) 
    {
    	unsigned int SP;
    	unsigned int PC;
    
    	SP = Target.ReadU32(0);
    	Target.SetReg("SP", SP);
    
    	PC = Target.ReadU32(4);
    	Target.SetReg("PC", PC);
    }
    

    Then search for the AfterTargetDownload function and replace its contents with the same code. Save the .jproject file and reload your project in oZone. In the Console window, you should see different start addresses from the ones you wrote down earlier.

    If you're not using oZone but the one that is integrated in your development environment, things work differently. I use IAR, which is pretty simple: just make sure the debugger is started with the commandline option "--drv_vector_table_base=0x0" (in project options, go to "Debugger", select "Extra options" tab, enable "Use command line options" and enter the string "--drv_vector_table_base=0x0" in the text field).

    If you're using another toolchain you're pretty much on your own - can't help you with those.

  • Thank you very much for your help. It's solved now !!!!!!!!!!!

Related