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

nrf_gpio.h(39): #error directive: "Not supported." WHY?

Hello,

I am trying to compile for the nrf52 this example coming from NordicGit and I am getting the bunch of errors showed below. If I focus on this one

compiling bsp_btn_ble.c...
..\..\..\..\..\..\components\drivers_nrf\hal\nrf_gpio.h(39): error:  #35: #error directive: "Not supported."

Going to nrf_gpio.h I can see that the line with trouble is this

#if (GPIO_COUNT == 1)
#define NUMBER_OF_PINS (P0_PIN_NUM)
#define GPIO_REG_LIST  {NRF_GPIO}
#elif (GPIO_COUNT == 2)
#define NUMBER_OF_PINS (P0_PIN_NUM + P1_PIN_NUM)
#define GPIO_REG_LIST  {NRF_P0, NRF_P1}
#else
#error "Not supported."
#endif

As far as I understand, the macro GPIO_COUNT is not defined, but my question is, where do I have to define it ?

And I wonder, how it isn't defined if I took the example from github?

Thanks in advance,

Regards

*** Using Compiler 'V5.06 update 4 (build 422)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'nrf52832_xxaa_s132'
compiling bsp_btn_ble.c...
..\..\..\..\..\..\components\drivers_nrf\hal\nrf_gpio.h(39): error:  #35: #error directive: "Not supported."
  #error "Not supported."
..\..\..\..\..\..\components\libraries\bsp\bsp_btn_ble.c: 0 warnings, 1 error
compiling bsp.c...
..\..\..\..\..\..\components\drivers_nrf\hal\nrf_gpio.h(39): error:  #35: #error directive: "Not supported."
  #error "Not supported."
..\..\..\..\..\..\components\libraries\bsp\bsp.c: 0 warnings, 1 error
compiling main.c...
..\..\..\..\..\..\components\drivers_nrf\hal\nrf_gpio.h(39): error:  #35: #error directive: "Not supported."
  #error "Not supported."
..\..\..\main.c: 0 warnings, 1 error
assembling arm_startup_nrf52.s...
compiling ble_advertising.c...
compiling system_nrf52.c...
compiling ble_advdata.c...
..\..\..\..\..\..\components\ble\common\ble_advdata.c(41): warning:  #223-D: function "sd_ble_gap_address_get" declared implicitly
          err_code = sd_ble_gap_address_get(&device_addr);
..\..\..\..\..\..\components\ble\common\ble_advdata.c: 1 warning, 0 errors
compiling ble_nus.c...
compiling ble_srv_common.c...
compiling ble_conn_params.c...
compiling nrf_drv_gpiote.c...
..\..\..\..\..\..\components\drivers_nrf\hal\nrf_gpio.h(39): error:  #35: #error directive: "Not supported."
  #error "Not supported."
..\..\..\..\..\..\components\drivers_nrf\gpiote\nrf_drv_gpiote.c: 0 warnings, 1 error
compiling app_uart_fifo.c...
compiling nrf_drv_common.c...
compiling nrf_drv_uart.c...
..\..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.h(96): error:  #169: expected a declaration
      } reg;
..\..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.h(383): warning:  #223-D: function "nrf_uarte_task_address_get" declared implicitly
      return nrf_uarte_task_address_get(p_instance->reg.p_uarte, (nrf_uarte_task_t)task);
..\..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.h(383): error:  #136: union "<unnamed>"  has no field "p_uarte"
      return nrf_uarte_task_address_get(p_instance->reg.p_uarte, (nrf_uarte_task_t)task);
..\..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.h(383): error:  #20: identifier "nrf_uarte_task_t" is undefined
      return nrf_uarte_task_address_get(p_instance->reg.p_uarte, (nrf_uarte_task_t)task);
..\..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.h(383): error:  #18: expected a ")"
      return nrf_uarte_task_address_get(p_instance->reg.p_uarte, (nrf_uarte_task_t)task);
..\..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.h(393): warning:  #223-D: function "nrf_uarte_event_address_get" declared implicitly
      return nrf_uarte_event_address_get(p_instance->reg.p_uarte, (nrf_uarte_event_t)event);
..\..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.h(393): error:  #136: union "<unnamed>"  has no field "p_uarte"
      return nrf_uarte_event_address_get(p_instance->reg.p_uarte, (nrf_uarte_event_t)event);
..\..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.h(393): error:  #20: identifier "nrf_uarte_event_t" is undefined
      return nrf_uarte_event_address_get(p_instance->reg.p_uarte, (nrf_uarte_event_t)event);
..\..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.h(393): error:  #18: expected a ")"
      return nrf_uarte_event_address_get(p_instance->reg.p_uarte, (nrf_uarte_event_t)event);
..\..\..\..\..\..\components\drivers_nrf\hal\nrf_gpio.h(39): error:  #35: #error directive: "Not supported."
  #error "Not supported."
..\..\..\..\..\..\components\drivers_nrf\uart\nrf_drv_uart.c: 2 warnings, 8 errors
compiling app_error.c...
compiling app_button.c...
..\..\..\..\..\..\components\drivers_nrf\hal\nrf_gpio.h(39): error:  #35: #error directive: "Not supported."
  #error "Not supported."
..\..\..\..\..\..\components\libraries\button\app_button.c: 0 warnings, 1 error
compiling app_fifo.c...
compiling app_error_weak.c...
compiling app_timer.c...
compiling app_util_platform.c...
compiling fstorage.c...
compiling RTT_Syscalls_KEIL.c...
compiling nrf_assert.c...
compiling SEGGER_RTT_printf.c...
compiling retarget.c...
compiling SEGGER_RTT.c...
compiling softdevice_handler.c...
".\_build\nrf52832_xxaa_s132.axf" - 13 Error(s), 3 Warning(s).
Target not created.
Build Time Elapsed:  00:00:15
Related