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

Using BLE NUS SERVICE without UART

Hello

I would like to send my sensor data to a mobile application using BLE SDK 15. Someone suggested me to go through the BLE NUS SERVICE example which was a good one. I understood a lot of things but now my sensor values are coming on analog pins and not on UART pins. How do i send those values? Would i have to create a whole new service for doing this or could i somehow modify the same example to work according to my needs. Thanks!  

  • Hello Edvin and Arshdeep!

    I am following to this thread. I want to know how to remove UART from the NUS example. In sdk_config.h, I did "#define APP_UART_ENABLED 0" and "#define UART_ENABLED 0". In main.c, I commented out "uart_event_handle()" and "uart_init()" functions. Still I get following errors in retarget.c file:

    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol app_uart_get (referred from retarget.o).
    .\_build\nrf52810_xxaa.axf: Error: L6218E: Undefined symbol app_uart_put (referred from retarget.o).

    How to handle this?

  • It sounds like you have removed the uart related .c-files, but still have some references to them. Make sure that you comment out all functions using app_uart_get() and app_uart_put, in addition to commenting out the lines that include "app_uart.h", "app_fifo.h" and "nrf_drv_uart.h".

    BR,

    Edvin

  • Hi , I am trying to do a similar thing. Where did you find the NUS Service example? I am using thee SDK 15.2 but I have only the ble_template and ble_app_uart examples... 

  • Hi , I am trying to do sth similar to arshdeep in the post. Send data via BLE from a custom PCB chip that has nrf52382. I start with the ble_template example in the SDK 15.2. The reason I don't start with ble_app_uart is that that does not work on my PCB device (device doesn't advertise when I flash it). 

    I am editting the ble_template to add NUS service, so that I can use nus_data_send() function. 
    However, when I do so, the code on the device doesn't give me anything, moreover my pcb custom device doesn't even advertise!! 


    Would you have any ideas pertaining this? I can share my code if you would like. It's the ble_template ex as is with just a few edits. 
    Thank you very much!! :) 

  • ble_app_uart is the example that uses the NUS service. Regarding your other post, where you explain nothing happens when you flash the ble_app_uart example:

    How do you flash it? Through your IDE? What IDE do you use?

    Unless you are using Segger Embedded Studio, you need to flash the SoftDevice first. Did you do that?

    Without any modifications this example should also start advertising, and you should be able to detect it with nRF Connect for Mobile or Desktop (Note: It will not show up on your Mobile Settings->bluetooth page.

    For this example to work you will also need to program the softdevice.

    The softdevice for nRF52832 is the .hex file located in:

    SDK15.2.0\components\softdevice\s132\hex\

    You can program it using nRF Connect for Desktop or Nordic Command Line Tools.

    Best regards,

    Edvin

Related