DEVICE_DT_GET failing to get nordic_nus_uart

I am using the nRF Connect SDK v2.3.0 to build applications for nRF5340 audio boards . In particular I am interested in the application : ..\nrf\applications\nrf5340_audio .This builds and executes on the boards without issues using the buildprog.py script.

I am now trying to add extra functionality to this audio application inspired by the sample ..nrf\samples\bluetooth\peripheral_uart, to be able to send separate data over BLE to the board from an nRF Connect application. 

The following line I add causes the the build to fail :  

static const struct device *uart = DEVICE_DT_GET(DT_CHOSEN(nordic_nus_uart));

The issue is as as follows : 

C:/ncs/v2.3.0/zephyr/include/zephyr/device.h:83:41: error: '__device_dts_ord_DT_CHOSEN_nordic_nus_uart_ORD' undeclared here (not in a function)
   83 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                         ^~~~~~~~~
C:/ncs/v2.3.0/zephyr/include/zephyr/toolchain/common.h:132:26: note: in definition of macro '_DO_CONCAT'
  132 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
C:/ncs/v2.3.0/zephyr/include/zephyr/device.h:83:33: note: in expansion of macro '_CONCAT'
   83 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
      |                                 ^~~~~~~
C:/ncs/v2.3.0/zephyr/include/zephyr/device.h:209:37: note: in expansion of macro 'DEVICE_NAME_GET'
  209 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
      |                                     ^~~~~~~~~~~~~~~
C:/ncs/v2.3.0/zephyr/include/zephyr/device.h:226:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
  226 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
      |                                  ^~~~~~~~~~~~~~~~~~
../../../src/main.c:200:36: note: in expansion of macro 'DEVICE_DT_GET'
  200 | static const struct device *uart = DEVICE_DT_GET(DT_CHOSEN(nordic_nus_uart));
      |                                    ^~~~~~~~~~~~~
../../../src/main.c:200:29: warning: 'uart' defined but not used [-Wunused-variable]
  200 | static const struct device *uart = DEVICE_DT_GET(DT_CHOSEN(nordic_nus_uart));
      |                             ^~~~
ninja: build stopped: subcommand failed.

This line builds fine in the peripheral_uart sample but not when added to this audio application.  I have all the required headers included etc. No doubt it is something trivial but I can't see it currently. What could be the issue here? Thank you in advance. 

Parents
  • Hi,

    Could you provide more information on what you try to achieve? Which devices do you try to send Bluetooth data between? What kind of communication would you like to have between the devices?

    Best regards,
    Dejan


  • Hi   Thanks for your reply. I am trying to send Bluetooth data from from an nRF Connect mobile phone application to an nRF5340 audio development kit board (just one way). This already works when using the provided peripheral_uart sample. I am trying to integrate this functionality into the nrf5340_audio application, so that the development board can switch to a broadcast source based on a string that it receives over Bluetooth from the nRF Connect app. 

  • Hi,

    Could you provide more information about your setup? How many audio DKs do you have, how are they connected and which role do they have (gateway or headset)? In which mode do audio DKs work? Do you have one or more gateways?

    Could you elaborate on the connection between the phone and audio kit(s)? To which kit(s) do you want to send Bluetooth data from the phone?

    Best regards,
    Dejan

Reply
  • Hi,

    Could you provide more information about your setup? How many audio DKs do you have, how are they connected and which role do they have (gateway or headset)? In which mode do audio DKs work? Do you have one or more gateways?

    Could you elaborate on the connection between the phone and audio kit(s)? To which kit(s) do you want to send Bluetooth data from the phone?

    Best regards,
    Dejan

Children
Related