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

BLE not visible after adding nrf_gpio and twi functions

Hi all, 

I am merging TWI code with BLE.  I started with the ble_app_uart example working perfectly, however, after adding TWI libs and drivers (nrf_twi; nrf_twim; twi_master), and a simple function to blink a led using gpio, the BLE device is not visible anymore. Any help please? 

My code is exactly the ble_app_uart + twi drivers + leds_init function, My leds_init function is bellow.

void leds_init(void)
{
     nrf_gpio_cfg_output(LED_PIN);

	//Turn on the LED to indicate initializing
	
	nrf_gpio_pin_clear(LED_PIN);
	nrf_delay_ms(500);
	// this will switch led on
	nrf_gpio_pin_set(LED_PIN);
	nrf_delay_ms(500);
	// this will switch  led off
	nrf_gpio_pin_clear(LED_PIN);
	nrf_delay_ms(500);
}

Thanks

Parents
  • Hi Mylena, 

    Sorry for the delay. 

    Check your interrupt priorities. It looks like you are trying to call a Softdevice SV call from within an interrupt context running at high priority, which is not allowed. You can try to use APP_IRQ_PRIORITY_LOW for the TWI interrupts. 

    Please note that we are moving into the summer vacation period here in Norway, so it might take a bit longer to get to the bottom of this than expected, as staff during the month of July will be reduced. I'm sorry about the inconvenience, but please be patient. And I'll get back to you as soon as I hear something from the devs.

    -Amanda H.

Reply
  • Hi Mylena, 

    Sorry for the delay. 

    Check your interrupt priorities. It looks like you are trying to call a Softdevice SV call from within an interrupt context running at high priority, which is not allowed. You can try to use APP_IRQ_PRIORITY_LOW for the TWI interrupts. 

    Please note that we are moving into the summer vacation period here in Norway, so it might take a bit longer to get to the bottom of this than expected, as staff during the month of July will be reduced. I'm sorry about the inconvenience, but please be patient. And I'll get back to you as soon as I hear something from the devs.

    -Amanda H.

Children
No Data
Related