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

Running the usbd_ble_uart_freertos example on custom board with no buttons

Code example: nRF5_SDK_15.2.0_9412b96\examples\peripheral\usbd_ble_uart_freertos

Board: custom board with nRF52840

What are the fastest and easiest steps to make this example work on a buttonless board?

I do not need the Bluetooth functionality to work at this time, only USB and freertos.

Compiling the project after including my custom_board.h file throws up some button related errors from bsp.c which I circumvented by defining BSP_SIMPLE in the preprocessor.

Now the bsp_btn_ble.c file is giving me trouble, as it is using button defines from bsp.c that are omitted when BSP_SIMPLE is defined.

The entire purpose of this file is clearly to define how the buttons interact with the Bluetooth functionality, and it is understandable that this doesn't work on a buttonless board.

Since I currently do not need BT functionality I was wondering if there is some simple config I can do to omit these files without other (non BT) parts of the example breaking down.

I realize I can manually add the USB library to one of the blinky_freertos examples, but I am hoping there is a faster way.

Parents
  • Hi,

    bsp_btn_ble is only used for configuring button for wakeup from system off sleep mode in that example. If you do not have any buttons, you can comment out line 367-368 in main.c and exclude the source file bsp_btn_ble.c from your project.

    //    err_code = bsp_btn_ble_sleep_mode_prepare();
    //    APP_ERROR_CHECK(err_code);

    I would then recommend that you do not enter system off sleep mode, or configure an alternative wakeup source. Otherwise you will have to trigger a reset or disconnect power to wake from system off mode.

    Best regards,
    Jørgen

Reply
  • Hi,

    bsp_btn_ble is only used for configuring button for wakeup from system off sleep mode in that example. If you do not have any buttons, you can comment out line 367-368 in main.c and exclude the source file bsp_btn_ble.c from your project.

    //    err_code = bsp_btn_ble_sleep_mode_prepare();
    //    APP_ERROR_CHECK(err_code);

    I would then recommend that you do not enter system off sleep mode, or configure an alternative wakeup source. Otherwise you will have to trigger a reset or disconnect power to wake from system off mode.

    Best regards,
    Jørgen

Children
Related