Hi All,
I use SDK 15.2 to periodically trigger ADC acquisition tasks via PPI. But SOFTDEVICE: INVALID MEMORY ACCESS error occurred while the system is running.
I found an error that occurred when initializing the ADC and PPI configuration.
/************* saadc_init****************/
void saadc_init(void)
{
ret_code_t err_code;
err_code = nrf_drv_saadc_init(NULL, saadc_callback);
APP_ERROR_CHECK(err_code);
nrf_saadc_channel_config_t channel0_config = {
.resistor_p = NRF_SAADC_RESISTOR_DISABLED, \
.resistor_n = NRF_SAADC_RESISTOR_DISABLED, \
.gain = NRF_SAADC_GAIN1_4, \
.reference = NRF_SAADC_REFERENCE_INTERNAL, \
.acq_time = SAADC_CH_CONFIG_TACQ_40us, \
.mode = NRF_SAADC_MODE_SINGLE_ENDED, \
.burst = NRF_SAADC_BURST_DISABLED, \
.pin_p = (nrf_saadc_input_t)(NRF_SAADC_INPUT_AIN0), \
.pin_n = NRF_SAADC_INPUT_DISABLED \
} ;
err_code = nrf_drv_saadc_channel_init(0, &channel0_config);
APP_ERROR_CHECK(err_code);
nrf_saadc_channel_config_t channel4_config = {
.resistor_p = NRF_SAADC_RESISTOR_DISABLED, \
.resistor_n = NRF_SAADC_RESISTOR_DISABLED, \
.gain = NRF_SAADC_GAIN1_3, \
.reference = NRF_SAADC_REFERENCE_INTERNAL, \
.acq_time = NRF_SAADC_ACQTIME_40US, \
.mode = NRF_SAADC_MODE_SINGLE_ENDED, \
.burst = NRF_SAADC_BURST_DISABLED, \
.pin_p = (nrf_saadc_input_t)(NRF_SAADC_INPUT_AIN4), \
.pin_n = NRF_SAADC_INPUT_DISABLED \
} ;
/************The system can be operated after shielding***********/
err_code = nrf_drv_saadc_channel_init(4, &channel4_config);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool, SAMPLES_IN_BUFFER);
APP_ERROR_CHECK(err_code);
saadc_sampling_event_init();
saadc_sampling_event_enable();
// err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[1], SAMPLES_IN_BUFFER);
// APP_ERROR_CHECK(err_code);
/***************************end**************************/
}
Attachment is my ADC configuration code.
So what is the cause of this? How can I solve this problem? Please help me, thank you!