NRF52805 ADC BLE APP UART

Hello, I'm working currently on an nrf52805 module and I'm creating a board with it, for now, I managed to do the ble app uart for this module and improve to code a little bit.

My goal, for now, is to create an ADC measurement of voltage, and I'm struggling with this. If someone could help me with this that would be great to give a code that would be good with it or an idea (i'm kinda new with BLE)

So I tried to use the example:    github.com/.../ble_app_uart__saadc_timer_driven__scan_mode

I'm trying to readapt the example to my board and thanks to the datasheet i saw that The nRF52805 only has 10 PPI channels (0-9) and The nRF52805 also only has 3 timers (TIMER0-TIMER2) but when I'm trying to taking off this in the code i get this error after : 

Thank you to everybody for their help. 

  • What happened when you made the changes? Are you still experiencing an issue, or are you sharing the project for future reference because it now works?
    In case of the former, please elaborate thoroughly on what you would like me to help you with in the attached project.

    For future reference, please do not upload the entire SDK folder, you only need to zip the specific project folder.

    Best regards,
    Karl

  • it happens that i'm having ussues even if i'm doing exactly like you told me to do ... and i have this 

    Building ‘ble_app_uart_pca10040_s132’ from solution ‘ble_app_uart_pca10040_s132’ in configuration ‘Release’
    2> Checking ‘thumb_crt0.s’
    2> 'Output/Release/Obj/ble_app_uart_pca10040_s132/thumb_crt0.o' is up to date
    3> Checking ‘nrf_log_backend_rtt.c’
    3> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_log_backend_rtt.o' is up to date
    4> Checking ‘nrf_log_backend_serial.c’
    4> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_log_backend_serial.o' is up to date
    5> Checking ‘nrf_log_default_backends.c’
    5> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_log_default_backends.o' is up to date
    6> Checking ‘nrf_log_frontend.c’
    6> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_log_frontend.o' is up to date
    7> Checking ‘nrf_log_str_formatter.c’
    7> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_log_str_formatter.o' is up to date
    8> Checking ‘app_button.c’
    8> 'Output/Release/Obj/ble_app_uart_pca10040_s132/app_button.o' is up to date
    1> Checking ‘app_error.c’
    1> 'Output/Release/Obj/ble_app_uart_pca10040_s132/app_error.o' is up to date
    2> Checking ‘app_error_handler_gcc.c’
    2> 'Output/Release/Obj/ble_app_uart_pca10040_s132/app_error_handler_gcc.o' is up to date
    3> Checking ‘app_error_weak.c’
    3> 'Output/Release/Obj/ble_app_uart_pca10040_s132/app_error_weak.o' is up to date
    4> Checking ‘app_fifo.c’
    4> 'Output/Release/Obj/ble_app_uart_pca10040_s132/app_fifo.o' is up to date
    5> Checking ‘app_scheduler.c’
    5> 'Output/Release/Obj/ble_app_uart_pca10040_s132/app_scheduler.o' is up to date
    6> Checking ‘app_timer.c’
    6> 'Output/Release/Obj/ble_app_uart_pca10040_s132/app_timer.o' is up to date
    7> Checking ‘app_uart_fifo.c’
    7> 'Output/Release/Obj/ble_app_uart_pca10040_s132/app_uart_fifo.o' is up to date
    8> Checking ‘app_util_platform.c’
    8> 'Output/Release/Obj/ble_app_uart_pca10040_s132/app_util_platform.o' is up to date
    1> Checking ‘hardfault_implementation.c’
    1> 'Output/Release/Obj/ble_app_uart_pca10040_s132/hardfault_implementation.o' is up to date
    2> Checking ‘nrf_assert.c’
    2> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_assert.o' is up to date
    3> Checking ‘nrf_atfifo.c’
    3> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_atfifo.o' is up to date
    4> Checking ‘nrf_atflags.c’
    4> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_atflags.o' is up to date
    5> Checking ‘nrf_atomic.c’
    5> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_atomic.o' is up to date
    6> Checking ‘nrf_balloc.c’
    6> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_balloc.o' is up to date
    7> Checking ‘nrf_fprintf.c’
    7> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_fprintf.o' is up to date
    8> Checking ‘nrf_fprintf_format.c’
    8> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_fprintf_format.o' is up to date
    1> Checking ‘nrf_memobj.c’
    1> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_memobj.o' is up to date
    2> Checking ‘nrf_pwr_mgmt.c’
    2> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_pwr_mgmt.o' is up to date
    3> Checking ‘nrf_ringbuf.c’
    3> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_ringbuf.o' is up to date
    4> Checking ‘nrf_section_iter.c’
    4> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_section_iter.o' is up to date
    5> Checking ‘nrf_strerror.c’
    5> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_strerror.o' is up to date
    6> Checking ‘retarget.c’
    6> 'Output/Release/Obj/ble_app_uart_pca10040_s132/retarget.o' is up to date
    7> Checking ‘ses_startup_nrf52.s’
    7> 'Output/Release/Obj/ble_app_uart_pca10040_s132/ses_startup_nrf52.o' is up to date
    8> Checking ‘ses_startup_nrf_common.s’
    8> 'Output/Release/Obj/ble_app_uart_pca10040_s132/ses_startup_nrf_common.o' is up to date
    1> Checking ‘system_nrf52.c’
    1> 'Output/Release/Obj/ble_app_uart_pca10040_s132/system_nrf52.o' is up to date
    2> Checking ‘boards.c’
    2> 'Output/Release/Obj/ble_app_uart_pca10040_s132/boards.o' is up to date
    3> Checking ‘nrf_drv_clock.c’
    3> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_drv_clock.o' is up to date
    4> Checking ‘nrf_drv_uart.c’
    4> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_drv_uart.o' is up to date
    5> Checking ‘nrfx_clock.c’
    5> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrfx_clock.o' is up to date
    6> Checking ‘nrfx_gpiote.c’
    6> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrfx_gpiote.o' is up to date
    7> Checking ‘nrfx_prs.c’
    7> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrfx_prs.o' is up to date
    8> Checking ‘nrfx_uart.c’
    8> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrfx_uart.o' is up to date
    1> Checking ‘nrfx_uarte.c’
    1> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrfx_uarte.o' is up to date
    2> Checking ‘nrfx_saadc.c’
    2> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrfx_saadc.o' is up to date
    3> Checking ‘nrfx_ppi.c’
    3> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrfx_ppi.o' is up to date
    4> Checking ‘nrfx_timer.c’
    4> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrfx_timer.o' is up to date
    5> Checking ‘nrf_drv_ppi.c’
    5> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrf_drv_ppi.o' is up to date
    6> Checking ‘nrfx_power.c’
    6> 'Output/Release/Obj/ble_app_uart_pca10040_s132/nrfx_power.o' is up to date
    7> Checking ‘bsp.c’
    7> 'Output/Release/Obj/ble_app_uart_pca10040_s132/bsp.o' is up to date
    8> Checking ‘bsp_btn_ble.c’
    8> 'Output/Release/Obj/ble_app_uart_pca10040_s132/bsp_btn_ble.o' is up to date
    1> Checking ‘main.c’
    1> C:/Users/l.marcos/Desktop/nRF5_SDK_17.1.0_ddde560/examples/ble_peripheral/ble_app_uart__saadc_timer_driven__scan_mode/pca10040/s132/config/sdk_config.h (21.04.2022 11:11:16) is later than Output/Release/Obj/ble_app_uart_pca10040_s132/main.o (21.04.2022 10:41:35).
    1> Compiling ‘main.c’
    3> Checking ‘SEGGER_RTT.c’
    3> C:/Users/l.marcos/Desktop/nRF5_SDK_17.1.0_ddde560/examples/ble_peripheral/ble_app_uart__saadc_timer_driven__scan_mode/pca10040/s132/config/sdk_config.h (21.04.2022 11:11:16) is later than Output/Release/Obj/ble_app_uart_pca10040_s132/SEGGER_RTT.o (21.04.2022 11:09:29).
    3> Compiling ‘SEGGER_RTT.c’
    4> Checking ‘SEGGER_RTT_Syscalls_SES.c’
    4> C:/Users/l.marcos/Desktop/nRF5_SDK_17.1.0_ddde560/examples/ble_peripheral/ble_app_uart__saadc_timer_driven__scan_mode/pca10040/s132/config/sdk_config.h (21.04.2022 11:11:16) is later than Output/Release/Obj/ble_app_uart_pca10040_s132/SEGGER_RTT_Syscalls_SES.o (21.04.2022 11:09:29).
    4> Compiling ‘SEGGER_RTT_Syscalls_SES.c’
    5> Checking ‘SEGGER_RTT_printf.c’
    5> C:/Users/l.marcos/Desktop/nRF5_SDK_17.1.0_ddde560/examples/ble_peripheral/ble_app_uart__saadc_timer_driven__scan_mode/pca10040/s132/config/sdk_config.h (21.04.2022 11:11:16) is later than Output/Release/Obj/ble_app_uart_pca10040_s132/SEGGER_RTT_printf.o (21.04.2022 10:41:36).
    5> Compiling ‘SEGGER_RTT_printf.c’
    6> Checking ‘ble_advdata.c’
    6> C:/Users/l.marcos/Desktop/nRF5_SDK_17.1.0_ddde560/examples/ble_peripheral/ble_app_uart__saadc_timer_driven__scan_mode/pca10040/s132/config/sdk_config.h (21.04.2022 11:11:16) is later than Output/Release/Obj/ble_app_uart_pca10040_s132/ble_advdata.o (21.04.2022 10:41:36).
    6> Compiling ‘ble_advdata.c’
    7> Checking ‘ble_advertising.c’
    7> C:/Users/l.marcos/Desktop/nRF5_SDK_17.1.0_ddde560/examples/ble_peripheral/ble_app_uart__saadc_timer_driven__scan_mode/pca10040/s132/config/sdk_config.h (21.04.2022 11:11:16) is later than Output/Release/Obj/ble_app_uart_pca10040_s132/ble_advertising.o (21.04.2022 10:41:36).
    7> Compiling ‘ble_advertising.c’
    8> Checking ‘ble_conn_params.c’
    8> C:/Users/l.marcos/Desktop/nRF5_SDK_17.1.0_ddde560/examples/ble_peripheral/ble_app_uart__saadc_timer_driven__scan_mode/pca10040/s132/config/sdk_config.h (21.04.2022 11:11:16) is later than Output/Release/Obj/ble_app_uart_pca10040_s132/ble_conn_params.o (21.04.2022 10:41:36).
    8> Compiling ‘ble_conn_params.c’
    2> Checking ‘ble_conn_state.c’
    2> C:/Users/l.marcos/Desktop/nRF5_SDK_17.1.0_ddde560/examples/ble_peripheral/ble_app_uart__saadc_timer_driven__scan_mode/pca10040/s132/config/sdk_config.h (21.04.2022 11:11:16) is later than Output/Release/Obj/ble_app_uart_pca10040_s132/ble_conn_state.o (21.04.2022 10:41:36).
    2> Compiling ‘ble_conn_state.c’
    1> In file included from ../../../../../../modules/nrfx/nrfx.h:45,
    1>                  from ../../../../../../modules/nrfx/hal/nrf_gpio.h:44,
    1>                  from ../../../../../../components/boards/boards.h:43,
    1>                  from ../../../../../../components/libraries/bsp/bsp.h:58,
    1>                  from ../../../../../../components/libraries/bsp/bsp_btn_ble.h:60,
    1>                  from C:\Users\l.marcos\Desktop\nRF5_SDK_17.1.0_ddde560\examples\ble_peripheral\ble_app_uart__saadc_timer_driven__scan_mode\main.c:71:
    1> ../../../../../../modules/nrfx/drivers/include/nrfx_timer.h:71:39: error: 'NRF_TIMER3' undeclared here (not in a function); did you mean 'NRF_TIMER0'?
    1> ../../../../../../modules/nrfx/drivers/nrfx_common.h:92:37: note: in definition of macro 'NRFX_CONCAT_2_'
    1> ../../../../../../modules/nrfx/drivers/include/nrfx_timer.h:71:25: note: in expansion of macro 'NRFX_CONCAT_2'
    1> ../../../../../../integration/nrfx/legacy/nrf_drv_timer.h:64:50: note: in expansion of macro 'NRFX_TIMER_INSTANCE'
    1> C:\Users\l.marcos\Desktop\nRF5_SDK_17.1.0_ddde560\examples\ble_peripheral\ble_app_uart__saadc_timer_driven__scan_mode\main.c:130:42: note: in expansion of macro 'NRF_DRV_TIMER_INSTANCE'
    1> ../../../../../../modules/nrfx/drivers/include/nrfx_timer.h:72:39: error: 'NRFX_TIMER3_INST_IDX' undeclared here (not in a function); did you mean 'NRFX_TIMER2_INST_IDX'?
    1> ../../../../../../modules/nrfx/drivers/nrfx_common.h:113:37: note: in definition of macro 'NRFX_CONCAT_3_'
    1> ../../../../../../modules/nrfx/drivers/include/nrfx_timer.h:72:25: note: in expansion of macro 'NRFX_CONCAT_3'
    1> ../../../../../../integration/nrfx/legacy/nrf_drv_timer.h:64:50: note: in expansion of macro 'NRFX_TIMER_INSTANCE'
    1> C:\Users\l.marcos\Desktop\nRF5_SDK_17.1.0_ddde560\examples\ble_peripheral\ble_app_uart__saadc_timer_driven__scan_mode\main.c:130:42: note: in expansion of macro 'NRF_DRV_TIMER_INSTANCE'
    1> ../../../../../../modules/nrfx/hal/nrf_timer.h:125:55: error: 'TIMER3_CC_NUM' undeclared here (not in a function); did you mean 'TIMER0_CC_NUM'?
    1> ../../../../../../modules/nrfx/drivers/nrfx_common.h:113:37: note: in definition of macro 'NRFX_CONCAT_3_'
    1> ../../../../../../modules/nrfx/hal/nrf_timer.h:125:41: note: in expansion of macro 'NRFX_CONCAT_3'
    1> ../../../../../../modules/nrfx/drivers/include/nrfx_timer.h:73:25: note: in expansion of macro 'NRF_TIMER_CC_CHANNEL_COUNT'
    1> ../../../../../../integration/nrfx/legacy/nrf_drv_timer.h:64:50: note: in expansion of macro 'NRFX_TIMER_INSTANCE'
    1> C:\Users\l.marcos\Desktop\nRF5_SDK_17.1.0_ddde560\examples\ble_peripheral\ble_app_uart__saadc_timer_driven__scan_mode\main.c:130:42: note: in expansion of macro 'NRF_DRV_TIMER_INSTANCE'
    Build failed
    

  • It seems to me that there might still exists references to nrf_drv_timer* calls in your code, or the TIMER3 instance.

    Please share the project folder as a .zip file if you would like me to take a look at what these may be.

    Best regards,
    Karl

  • Hello Karl, I put you the program in the folder 2 posts before could you see there? Thank you 

  • No, you shared the entire SDK, not the project folder.
    It is cumbersome and unnecessary to send an entire SDK, when you could instead just send the relevant project, like I mentioned in my previous comment.
    Please keep this in mind for future reference.

    As far as I can see in the included examples/ble_peripheral/ble_app_uart__saadc_timer_driven__scan_mode/main.c file you are still trying to use the TIMER3 instance:

    static const nrf_drv_timer_t   m_timer = NRF_DRV_TIMER_INSTANCE(3);


    You will need to change this as there exist no TIMER3 instance on the nRF52805.

    Your sdk_config.h file looks correct.

    Best regards,
    Karl

Related