Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

compile error has been occurred when use the PPI driver.

hello, 

i'm developing about HR sensor. 

so i need to add SAADC function for sensor. 

and i had added SAADC code on the ble_app_hrs code. 

but some compile error on the ppi driver like belows. 

_build/nrf52832_xxaa/main.c.o: In function `saadc_sampling_event_init':
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:191: undefined reference to `nrf_drv_ppi_init'
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:194: undefined reference to `nrf_drv_timer_init'
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:199: undefined reference to `nrf_drv_timer_extended_compare'
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:200: undefined reference to `nrf_drv_timer_enable'
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:203: undefined reference to `nrf_drv_saadc_sample_task_get'
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:206: undefined reference to `nrf_drv_ppi_channel_alloc'
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:209: undefined reference to `nrf_drv_ppi_channel_assign'
_build/nrf52832_xxaa/main.c.o: In function `saadc_sampling_event_enable':
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:215: undefined reference to `nrf_drv_ppi_channel_enable'
_build/nrf52832_xxaa/main.c.o: In function `saadc_callback':
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:230: undefined reference to `nrf_drv_saadc_buffer_convert'
_build/nrf52832_xxaa/main.c.o: In function `saadc_init':
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:281: undefined reference to `nrf_drv_saadc_init'
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:284: undefined reference to `nrf_drv_saadc_channel_init'
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:286: undefined reference to `nrf_drv_saadc_channel_init'
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:288: undefined reference to `nrf_drv_saadc_channel_init'
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:290: undefined reference to `nrf_drv_saadc_channel_init'
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:293: undefined reference to `nrf_drv_saadc_buffer_convert'
D:\wrk\S-patch 개발\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hrs\pca10040\s332\armgcc/../../../main.c:295: undefined reference to `nrf_drv_saadc_buffer_convert'
collect2.exe: error: ld returned 1 exit status

clearly, related header files have been included on the code and Makefile. 

please check about this. 

attached file is my ble_app_hrs code.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
* Copyright (c) 2014 - 2017, Nordic Semiconductor ASA
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Parents
  • Did you add the .c files to your Makefile in addition to the include paths?

    You also need to enable the PPI and SAADC drivers in the sdk_config.h file. Make sure that you have this in your config file:

    Fullscreen
    1
    2
    3
    4
    5
    6
    // <q> PPI_ENABLED - nrf_drv_ppi - PPI peripheral driver
    #ifndef PPI_ENABLED
    #define PPI_ENABLED 1
    #endif
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    and

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    // <e> SAADC_ENABLED - nrf_drv_saadc - SAADC peripheral driver
    //==========================================================
    #ifndef SAADC_ENABLED
    #define SAADC_ENABLED 1
    #endif
    // <o> SAADC_CONFIG_RESOLUTION - Resolution
    // <0=> 8 bit
    // <1=> 10 bit
    // <2=> 12 bit
    // <3=> 14 bit
    #ifndef SAADC_CONFIG_RESOLUTION
    #define SAADC_CONFIG_RESOLUTION 1
    #endif
    // <o> SAADC_CONFIG_OVERSAMPLE - Sample period
    // <0=> Disabled
    // <1=> 2x
    // <2=> 4x
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • thanks, i can compile it. 

Reply Children
No Data