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

ADC conflict with softedevice

Hi,

I’m trying to use the SAADC on nrf52832. I’m not using softdevice (I’m not doing BLE code) but it’s present on the chip (to use it for DFU).
When I program the chip without softdevice my code run well & SAADC return good values. But when softdevice is present (FLASH starts at 0x26000) the code run well until I call: nrf_drv_saadc_sample(). After that, instead of entering saadc_callback function… I’ve got nothing! No error messages, no break, no restarts and I can’t do anything. So my problem is that I can not identify the problem with debugger, breakpoints or LOG_DEBUG.

I checked  the ble_app_proximity example, which is using SAADC with softedevice, but initialization, use of nrf_drv_saadc_sample() and callback function are the same as in saadc example.
Anybody knows if softdevice can create conflicts with the adc? Id there any solution?
I’m not using PPI (like the code given in this topic).

 

Best regards

Parents Reply Children
  • Hi

    Thank’s for answer.

    I tried the code you told me to try, the code did work on my electronic card. I cheked init_saadc function, saadc_sampling_event_init function and saadc_sampling_event_enable. Those 3 functions were the same in my code, but my own code still didn’t work. I checked principals #define in sdk_config.h, they were equals.

    So I deleted on your code the initialization of softedvice, and it was still working. So, I finally decided to copy all my code (3 C files, 2 headers and the main loop) on your project. The code run and saadc works.

    You’ll understand that I’m happy and disappointed (Schrödinger's happiness?) because I can’t know where my mistake was.

    Have you any idea where the error should come from? Sdk_config ? Flash start address?

     

    Thanks for the help,

     

    Best regards

  • Good that you were able to get passed the issue, unfortunately though I don't have a clue what was the issue, sometimes I have found that "clean target" project and "rebuild all target files" is worth a try when there are odd issues.

    Best regards,
    Kenneth

Related