Hi,
I'm using nrf52 with s132(v17.0.0).
When I connect nrf52 with my phone, there is error like this picture.
And, the code is
#define SAADC_SAMPLES_IN_BUFFER 240 void saadc_callback(nrf_drv_saadc_evt_t const * p_event) { if (p_event->type == NRF_DRV_SAADC_EVT_DONE) { ret_code_t err_code; uint16_t bytes_to_send = (uint16_t) SAADC_SAMPLES_IN_BUFFER; uint8_t DATA[SAADC_SAMPLES_IN_BUFFER]; // set buffers err_code = nrf_drv_saadc_buffer_convert(p_event->data.done.p_buffer, SAADC_SAMPLES_IN_BUFFER); APP_ERROR_CHECK(err_code); // print samples on hardware UART and parse data for BLE transmission for (int i = 0; i < SAADC_SAMPLES_IN_BUFFER; i++) { DATA[i] = p_event->data.done.p_buffer[i]; } err_code = ble_nus_data_send(&m_nus, DATA, &bytes_to_send, m_conn_handle); if ((err_code != NRF_ERROR_INVALID_STATE) && (err_code != NRF_ERROR_NOT_FOUND)) { APP_ERROR_CHECK(err_code); } } }
When the buffer is filled, then next buffer is filled by ADC value.
I guess the problem occurs at this time.
Also, when I use printf function to see value in PC, same problem occurs.
How can I solve this?
Thank you.