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

Is code size will be issue for advertisement when sd is enabled

Hi,

I have Nordic Nrf51822 custom board.

in that we have spi Nor flash.

i check the spi read and write with an application without soft device enabled.

which is working fine.

but when i flash soft device hex file.

i am not able to get advertisement.

here is my code:

uint32_t err_code;

timers_init();
gpiote_init();
buttons_init();
	
	NRF_GPIO->PIN_CNF[30]=0x09;
	NRF_GPIO->OUTSET=(1<<30);
	NRF_GPIO->PIN_CNF[27]=0x09;
	NRF_GPIO->OUTSET=(1<<27);
	NRF_GPIO->PIN_CNF[28]=0x09;
	NRF_GPIO->OUTSET=(1<<28);
	
	spi_master_init(SPI0,SPI_MODE0,0);  

	FLASH_DEVICE_OBJECT fdo;            /* flash device object */
	
	ParameterType para;                 /* parameters used for all operation */
	ReturnType ret;                     /* return variable */
	NMX_uint8 rbuffer[16];              /* read buffer */
	NMX_uint8 wbuffer[16] =             /* write buffer */
				{
				 0xAB, 0x12, 0xFE, 0xED, 0xBE, 0xEF, 0xFE, 0xED,
				 0xCD, 0x13, 0xFE, 0xED, 0xBE, 0xEF, 0xFE, 0xED
				};

		
				
	 ret = Driver_Init(&fdo);            /* initialize the flash driver */
	
	

				
bond_manager_init();
ble_stack_init();
radio_notification_init();

// Initialize Bluetooth Stack parameters
gap_params_init();
advertising_init();
services_init();
conn_params_init();
sec_params_init();

// Actually start advertising
advertising_start();

// Enter main loop
for (;;)
{
    // Switch to a low power state until an event is available for the application
    err_code = sd_app_event_wait();
    APP_ERROR_CHECK(err_code);
}

}

once i commented Driver_Init(&fdo); function ,i am getting advertisement.

but once i call that function , i am not getting advertisement.

and also i check by commenting all instruction in function definition Driver_Init(&fdo);

then i am not getting advertisement

my code size with Driver_Init(&fdo); function is 21608.

by commenting Driver_Init(&fdo); function is 15440.

Kindly tell me is code size will be issue or something else.

i am using spi_master.c file for spi communication.

Regards Balaji

Parents
  • Do you check the error code of sd_softdevice_enable(), and have put a breakpoint in the app_error_handler()? As I've said before, you should make sure to have an infinite loop in app_error_handler to make errors like this easy to catch.

    It seems likely that enabling the softdevice fails for some reason, most likely either because you use an illegal interrupt priority for something, or because you have enabled an interrupt that the softdevice needs for itself, as shown in the SoftDevice Specification. It's impossible to say for sure without knowing the contents of Driver_Init().

    PS: If you use code-tags around your code, it becomes much easier to read your code! The syntax is [ code ] your code [ /code ] without spaces.

    
    void some_function(void)
    {
    }
    
    
Reply
  • Do you check the error code of sd_softdevice_enable(), and have put a breakpoint in the app_error_handler()? As I've said before, you should make sure to have an infinite loop in app_error_handler to make errors like this easy to catch.

    It seems likely that enabling the softdevice fails for some reason, most likely either because you use an illegal interrupt priority for something, or because you have enabled an interrupt that the softdevice needs for itself, as shown in the SoftDevice Specification. It's impossible to say for sure without knowing the contents of Driver_Init().

    PS: If you use code-tags around your code, it becomes much easier to read your code! The syntax is [ code ] your code [ /code ] without spaces.

    
    void some_function(void)
    {
    }
    
    
Children
No Data
Related