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

nrf_gpio.h Compile Fail?

Hi,

I am following the "Bluetooth low energy Services, a beginner's tutorial", however, this tutorial is written for SDK V11.0.0 and I am using SDK14.1.0, softdevice 5.0.0, nrf52832_xxaa_s132 by Keil5.

I did a migration to make sure this tutorial could run on my environment. But, I still could not solve the error from nrf_gpio.h although I already modified the "preprocessor symbols" to "BOARD_PCA10040 CONFIG_GPIO_AS_PINRESET NRF52 NRF52832_XXAA NRF52_PAN_74 NRF_SD_BLE_API_VERSION=5 S132 SOFTDEVICE_PRESENT SWI_DISABLE0" in Options for Target > C/C++. I need your help.

The error is listed below:

*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Build target 'nrf52832_xxaa_s132' compiling bsp.c...

............\components\drivers_nrf\hal\nrf_gpio.h(67): error: #35: #error directive: "Not supported." #error "Not supported."

............\components\libraries\bsp\bsp.c: 0 warnings, 1 error compiling bsp_btn_ble.c...

............\components\drivers_nrf\hal\nrf_gpio.h(67): error: #35: #error directive: "Not supported." #error "Not supported."

............\components\libraries\bsp\bsp_btn_ble.c: 0 warnings, 1 error compiling nrf_log_backend_rtt.c...

compiling our_service.c...

compiling nrf_log_backend_serial.c...

compiling nrf_log_default_backends.c...

compiling main.c...

............\components\drivers_nrf\hal\nrf_gpio.h(67): error: #35: #error directive: "Not supported." #error "Not supported."

......\main.c: 0 warnings, 1 error compiling ble_srv_common.c... compiling ble_advdata.c... compiling ble_conn_params.c... compiling nrf_log_frontend.c... compiling ble_conn_state.c... compiling ble_advertising.c... compiling nrf_log_str_formatter.c... compiling app_button.c... ............\components\drivers_nrf\hal\nrf_gpio.h(67): error: #35: #error directive: "Not supported." #error "Not supported."

............\components\libraries\button\app_button.c: 0 warnings, 1 error compiling app_uart.c... compiling nrf_drv_gpiote.c... ............\components\drivers_nrf\hal\nrf_gpio.h(67): error: #35: #error directive: "Not supported." #error "Not supported." ............\components\drivers_nrf\gpiote\nrf_drv_gpiote.c: 0 warnings, 1 error compiling nrf_drv_uart.c... ............\components\drivers_nrf\hal\nrf_gpio.h(67): error: #35: #error directive: "Not supported." #error "Not supported." ............\components\drivers_nrf\uart\nrf_drv_uart.c: 0 warnings, 1 error

compiling app_error.c...

compiling app_error_weak.c...

compiling sensorsim.c...

compiling nrf_drv_common.c...

compiling nrf_fstorage.c...

compiling retarget.c...

compiling nrf_assert.c...

compiling SEGGER_RTT.c...

compiling app_util_platform.c...

compiling nrf_sdh_soc.c...

compiling SEGGER_RTT_printf.c...

compiling nrf_sdh.c...

compiling app_timer.c...

compiling nrf_sdh_ble.c...

compiling msgs.c...

compiling system_nrf52.c...

"._build\nrf52832_xxaa_s132.axf" - 6 Error(s), 0 Warning(s).

Thank you.

Best regards, SM

  • I think you need to define NRF52832 (not NRF52832_XXAA.)

    I could be wrong. I am using SDK13.2 and Eclipse. nrf_gpio.h is complaining that GPIO_COUNT is not defined. That is defined in one of many xxx_peripherals.h files included from hal/nrf_peripherals.h depending on a particular symbol being defined. Look in nrf_peripherals.h to see what the symbols are. Also, you could set your compiler to "verbose" to make sure the symbol is defined on the compiler command line. You might be defining them in the Keil GUI somewhere, but they are not getting to the compiler command line (for example if you defined them for the C++ compiler but the C compiler is using other defined preprocessor symbols.)

Related