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

custom_board.h for sdk v12.2 and v13.0

In my nRF52832 base-board, I don't have any leds and buttons. I use Keil v5 and I used ble_app_uart_pca10040_s132. I copied pca10040.h as custom_board.h and replaced BOARD_PCA10040 with BOARD_CUSTOM in proprocessor symbol. when I removed led definitions from custom_board.h, I got the following compile error.

compiling bsp.c... ............\components\libraries\bsp\bsp.c(115): error: #20: identifier "m_app_ticks_per_100ms" is undefined

when I removed button definitions from custom_board.h, I got the following compile error.

compiling bsp_btn_ble.c... linking... ._build\nrf52832_xxaa.axf: Error: L6218E: Undefined symbol bsp_button_is_pressed (referred from bsp_btn_ble.o).

when I used sdk v12.1, I could complie successfully.

what is the right custom_board.h for no led/button custom board? how can I fix these problems in sdk v12.2 and v13.0?

Parents
  • If your custom board does not have any buttons, then the problem could be resolved by setting LEDS_NUMBER to 0 in custom_board.h and wrapping content of bsp_btn_ble.c with

    #if BUTTONS_NUMBER > 0
      // content of bsp_btn_ble.c
    #endif // BUTTONS_NUMBER > 0
    

    It seems to be a bug because functions in bsp_btn_ble.c always try to call functions from bsp.c which are not defined when BUTTONS_NUMBER is 0.

Reply
  • If your custom board does not have any buttons, then the problem could be resolved by setting LEDS_NUMBER to 0 in custom_board.h and wrapping content of bsp_btn_ble.c with

    #if BUTTONS_NUMBER > 0
      // content of bsp_btn_ble.c
    #endif // BUTTONS_NUMBER > 0
    

    It seems to be a bug because functions in bsp_btn_ble.c always try to call functions from bsp.c which are not defined when BUTTONS_NUMBER is 0.

Children
No Data
Related