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

PPI AND SOFTDEVICE

Hi

I try to configure a ppi channel with timers to generate pwm signal My entire code is working well without softdevice. Here my ppi init function:

 NRF_PPI->CH[0].EEP = (uint32_t)&NRF_TIMER2->EVENTS_COMPARE[0];
        NRF_PPI->CH[0].TEP = (uint32_t)&NRF_GPIOTE->TASKS_OUT[0];   
        
	// Enable PPI channels 0.
	NRF_PPI->CHEN = (PPI_CHEN_CH0_Enabled << PPI_CHEN_CH0_Pos); 

Now, i try to adapt my code for softdevice. So i used sd_ppi_channel_assign function instead NRF_PPI registers :

sd_ppi_channel_assign(0,&NRF_TIMER2->EVENTS_COMPARE[0], &NRF_GPIOTE->TASKS_OUT[0]); sd_ppi_channel_enable_set(1 << 0);

sd_ppi_channel_assign call cause an hardfault error...

Does anybody have an idea were it can come from?

Related