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

Can I combine the ble_app_nus_c and usbd_ble_uart together?

Hello, I am working on a multi peripherals to one central project based on the NUS service of NORDIC chip. Now I use nRF52840 Dongle as the central board. I have debug the usbd_ble_uart project in the example folder to send and receive data via NUS service between DONGLE board and cell phone. 

Now I want to combine the usbd_ble_uart and ble_app_nus_c together. The ble_app_nus_c work as the firmware of the central board and receive the data from peripheral board. Then transmit the data to the laptop via the usb protocol. I copied all the files and code needed from usbd_ble_uart to the ble_app_nus_c project. When link the files in the compiling, many errors occurred. 

In usbd_ble_uart project, the BLE NUS service instance is defined as BLE_NUS_DEF(m_nus, NRF_SDH_BLE_TOTAL_LINK_COUNT);  In ble_app_nus_c project, the BLE NUS client instances is defined as BLE_NUS_C_ARRAY_DEF(m_ble_nus_c, NRF_SDH_BLE_CENTRAL_LINK_COUNT); Can these two instances be defined in one project? I added both ble_nus.c and ble_nus_c.c to the project. But seem that all the codes in ble_nus.c is not actived in compiling even I have enable the BLE_NUS service in sdk_config.h. 

How can I enable USBD communication in the BLE_APP_NUS_C project? Any help will be appreciated. Thanks a lot.

Parents
  • Hi Ming, 
    Could you show the error when you try to compile ?

    I assume you are trying to build a central ? Why are you hving ble_nus.c instead of ble_nus_c.c ? It should be the client on the central, not the server. 
    So BLE_NUS_C_ENABLED should be = 1 in sdk_config.h 

    If you don't plan to have the server on the central, please remove the ble_nus.c 

Reply
  • Hi Ming, 
    Could you show the error when you try to compile ?

    I assume you are trying to build a central ? Why are you hving ble_nus.c instead of ble_nus_c.c ? It should be the client on the central, not the server. 
    So BLE_NUS_C_ENABLED should be = 1 in sdk_config.h 

    If you don't plan to have the server on the central, please remove the ble_nus.c 

Children
No Data
Related