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

SAADC doesn't wake up.

I mashed up RTC and SAADC examples. The files of the project are attached in the end of the post. The problem is that after the first iteration (I want to sample audio for 10ms from saadc every 3 sec) the SAADC don't wake up and I have this error: ":ERROR:Fatal :INFO:Hit weak handler".

main.c sdk_config.h

Thanks

Marco

  • Hi,

    Most likely you get an error code because you are trying to initialize a module that is allready initialized (PPI, SAADC, etc.). You can use the method described here, to check the error code and which function is failing.

    I suggest you do the following changes to your code (attached main.c with changes):

    • Disable PPI channel before uninitializing SAADC

    • Remove PPI initialization from RTC
      callback

    • Initialize PPI and enable PPI channel in main()

    • You also need to re-enable interrupts for the COMPARE0 event, either by modifying the RTC interrupt handler, as described in this post, or by calling nrf_drv_rtc_cc_set() in the RTC callback.

    Best regards,

    Jørgen

Related