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

Implementing SAADC example to send data over Bluetooth

Hi,

I'm trying to implement a testing firmware for my Nordic nRF52840 PDK where I can send the data generated on an analog input over Bluetooth.

Basically the idea is to send something like a potentiometer data over Bluetooth MIDI.

First I tried to simply mount the correct circuit on a breadboard and test the SAADC example (via serial) to make sure that everything was ok on the hardware side.

Then, as required for MIDI messages, I successfully found a way to scale down the readings of the pot to 127 values.

My issue now is merging both the SAADC example with a Bluetooth example.

For the Bluetooth MIDI I'm following this tutorial.

I modified it and experiment with it before just using digital inputs and it was everything ok.

On my attempts first I had some errors compiling. Following topics like this I discovered that I needed to modify my sdk_config file.

Apparently I did all the required modifications on the file, so I got no errors while compiling and also no errors uploading the code to my PDK.

The problem is that like this my PDK doesn't appear anywhere as a Bluetooth device (not only checking as a Bluetooth MIDI device, but any Bluetooth terminal). Apparently it is not reaching the Bluetooth device "generation" function.

What am I doing wrong?

Parents Reply
  • After the debug I discovered that apparently I get stuck in the function "nrf_log_panic" inside "nrf_log_frontend.c".

    The program gets in this function from the "saadc_sampling_event_init" function in my main.

    While running "saadc_sampling_event_init" the program gets into "app_error_fault_handler" inside "app_error_weak.c"

    The "saadc_sampling_event_init" runs ok until:

    timer_cfg.bit_width = NRF_TIMER_BIT_WIDTH_32;

    Is this a memory issue? What I'm I doing wrong and how should I solve it? If it is possible.

Children
  • joneves said:
    While running "saadc_sampling_event_init" the program gets into "app_error_fault_handler" inside "app_error_weak.c"

     This is something you can debug by yourself. Please look at this blog which will make you understand how to debug errors that lead to app_error_fault_handler.

     

    joneves said:
    Is this a memory issue? What I'm I doing wrong and how should I solve it? If it is possible.

     The error code will give us a proper direction to look into. Can you please tell me what error code you got with APP_ERROR_CHECK, that lead your code execution into app_error_fault_handler?

Related