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

ble_app_uart_c example not work

Hello!

I have:

  • nRF52840-Preview-DK (pca10056)
  • nRF5_SDK_13.0.0_04a0bfd (s140)

I load **nRF5_SDK_13.0.0_04a0bfd\examples\ble_central\ble_app_uart_c\hex\ble_app_uart_c_pca10056_s140.hex** to first board and **nRF5_SDK_13.0.0_04a0bfd\examples\ble_peripheral\ble_app_uart\hex\ble_app_uart_pca10056_s140.hex** to second board, and it work fine.

Next, I load SoftDevice via nRFgo studio to first board, compile ble_app_uart in IAR and load hex file. It work fine.

Next, I load SoftDevice via nRFgo studio to second board, compile **ble_app_uart_c** in IAR and load hex file. This does not work. I compile **ble_app_uart_c** in Keil and load hex file.  It is not work too: Board get error and reset when try ble_nus_c_tx_notif_enable(p_ble_nus_c) in ble_nus_c_evt_handler... Function  ble_nus_c_tx_notif_enable return NRF_ERROR_INVALID_STATE error, because p_ble_nus_c->handles.nus_tx_cccd_handle == BLE_GATT_HANDLE_INVALID...

Please help me!

  • Hi,

    Have you done any changes/modifications to the code? Did you use the s140_nrf52840_5.0.0-2.alpha_softdevice ?

  • Thank! Yes? it is! I did not any changes/modifications to the code... And I use s140_nrf52840_5.0.0-2.alpha_softdevice... Regards!

  • I’m not seeing this problem when I test this here. You could test with SDK 14, and see if that solves the problem.

    You should also use the latest nRF5 command line tools and Segger J-Link drivers.

    General note on debugging with the SoftDevice: Note that the BLE link will get disconnected when hitting a breakpoint, because the radio will be halted, and the radio will therefore not be able to transmit the necessary packets to keep the connection. The link will disconnected after a timeout given in the connect request (or a connection parameter update).

  • Hello, thank for answert!

    I check SDK14. Hex example work fine. Commpiling in Keil and downloading with SoftDevice work fine too. But commpiling in IAR and downloading with SoftDevice do not work ((( I think it is my mistake, because I use IAR version 6.70.1

    And please, tell me, can I do this on SDK14: I need device whith Long Range (how I know, I must use s140_nrf52840_5.0.0-3.alpha_softdevice), device will be connect to 1 master and 8 slave device, and each device must have client and server NUS (I wanted use l2cap, but support of l2cap was removed)... Is it posible to do? And what example must I use for it? I look to: ble_central\ble_app_uart_c, ble_peripheral\ble_app_uart, ble_central_and_peripheral\experimental\ble_app_att_mtu_throughput (from s140_nrf52840_5.0.0-3.alpha)?

    Regards!

  • Yes, that is most likely the issue. We are using IAR Workbench version 7.80.4 for testing and verification.


    device will be connect to 1 master and 8 slave device

    That is not a problem. The Softdevice have support for 20 concurrent connections, where you can freely configure each link in any combination between Peripheral and Central.

    I wanted use l2cap, but support of l2cap was removed

    I think support for Connection Oriented Channels will be added in S140 when it goes out of alpha. See this post.

    ... Is it posible to do?

    Yes, but unfortunately the ble_app_uart and ble_app_uart_c example does not support this ‘out-of-the-box’ . You will have to combine both the ble_app_uart and ble_app_uart_c examples in order to run both NUS client and server on the same device. The ble_app_att_mtu_throughput or the ble_app_hrs_rscs_relay example should give some idea how to run both server and client on the same device. Get the code working first with support for 1 master and 1 slave. Since you need 8 slave connections, you will also have to implement support for the NUS client to handle this ammunt of devices(only support 1 connection by default). I recommend to take a look at the ble_app_multilink_central example to see how it’s done there. This post could also be a starting point for that.

Related