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 Hung, thanks for you information. In linking, errors are "undefined reference to `app_usbd_cdc_acm_rx_size'" and "undefined reference to `app_usbd_class_append'". All the codes are related to USBD_CDC function and I have included all the c and h files in the project. For ble_nus_c, it is very tricky. Some explanation mention that the 'c' means client but actually it is located in ble_central folder. I have other successful example for multi peripherals to one central project which are made by several peripheral with "ble_nus" firmware and one central with "ble_nus_c" firmware. 

    I have disable the ble_nus.c from the project and the errors were shown as above. The firmware really trouble me a lot.

Reply
  • Hi Hung, thanks for you information. In linking, errors are "undefined reference to `app_usbd_cdc_acm_rx_size'" and "undefined reference to `app_usbd_class_append'". All the codes are related to USBD_CDC function and I have included all the c and h files in the project. For ble_nus_c, it is very tricky. Some explanation mention that the 'c' means client but actually it is located in ble_central folder. I have other successful example for multi peripherals to one central project which are made by several peripheral with "ble_nus" firmware and one central with "ble_nus_c" firmware. 

    I have disable the ble_nus.c from the project and the errors were shown as above. The firmware really trouble me a lot.

Children
Related