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

Device is not advertising stuck at SOFTDEVICE_HANDLER_INIT Macro

I have created a customized Services according to nAN36 Document.

  1. SDK using 8.0
  2. Stack S110 8.0
  3. DEV kit PCA10028 nRF51.
  4. J-LInk RTT DEbugger

When the function ble_stack_init(void) get called from main. It stuck somewhere with MACRO

SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL); 

This Macro is defined softdevice_handler.h file. Now how to Proceed further to check where I am lagging...

 ble_uuid_t adv_uuids[] =
    {				
				{SOS_BLE_BAS_SERVICE, BLE_UUID_TYPE_VENDOR_BEGIN},
				{SOS_UUID_SERVICE, BLE_UUID_TYPE_VENDOR_BEGIN},
				{FIND_ME_ALERT_SERVICE, BLE_UUID_TYPE_VENDOR_BEGIN}        
    };

This is service I passed for advertising. And these are defined as

/*-------------------------------------------------------------------------------------------------------*/
#define   SOS_UUID_BASE	{0xFA,0xFF,0xBE,0x11,0xA7,0x63,0x1C,0xBB,0x7F,0x48,0x27,0x66,0x00,0x00,0x8C,0xF0}

//-----------------------SERVICES UUID VENDOR
#define   SOS_UUID_SERVICE					0x1602
#define   FIND_ME_ALERT_SERVICE			0x1604
#define	SOS_BLE_BAS_SERVICE				0x1606

//-----------------------SERVICE CHARACTERISTIC UUID
#define	  SOS_UUID_EMR_MSG_CHAR			0x1608
#define 	ALERT_UUID_FIND_ME_CHAR		0x1610
#define		SOS_BLE_BAS_CHAR					0x1612 

______________________________________________________________

Some one if suggest me the step I follow next to know the problem. And please revert on same if any other part of code require here.

  • I really don't understand what you're saying, sorry I just don't understand some of the English.

    You're saying you fail in side the sd_softdevice_enable() function, well that's far before any services are added. So how can it have anything to do with the services?

    If the chip REALLY is resetting inside the call to sd_softdevice_enable() then you have serious problems and that really sounds like you don't have the correct softdevice on the chip or you don't have it on there properly. I assume this is very close to the start of your main() routine. You're telling me that if you put a breakpoint RIGHT after the sd_softdevice_enable() call, in the assembler if necessary, that it never returns from there and the chip resets?

  • I think You got it your last line sir.... It never returns when it get inside the sd_softdevice_enable function.. OK Can you guide me where I can be wrong with Softdevice.. Because I am using everything as shown in Document. I am using nRF51-DK Hardware Kit and S110 softdevice version 8.0.2.

    One more thing If Softdevice compatibility is the only issue than why Application like Proximity run perfectly with same Softdevice.

  • So proximity from SDK 8.0.0 works. Then you have taken that example or ble_app_template from SDK 8.0.0 and added some custom services. This shouldn't affect anything inside ble_stack_init();, but there must be something that is different betweent the two applications. Maybe you could upload your complete project so we can test it here?

Related