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

2 UART with BLE example on nRF52840.

Sir, 

I have seen example pgm for communication between UART and BLE, and another pgm which communicates between 2 UARTs.  But for my project I need 2 UARTs and the BLE together.

Datas I want to receive from UART0, and push the datas (after some coding) to the UART1 and the BLE. 

Is it possible? Please help to do this!

  • Hi

    Yes, I don't see why this shouldn't be possible, although we do not have any examples on how to do this. I suggest you start out with our serial UARTES example (SDK_15.2.0_9412b96\nRF5_SDK_15.2.0_9412b96\examples\peripheral\serial_uartes), and implement ble_uart communication there. 

    Best of luck and regards,

    Simon

  • Flashed that program. But not working as the pgm says.

    I connected a serial to usb connector to the rx and tx pins. When I write some datas into the UART, the echo is not getting.

    Is this possible to initialize a new UART in the ble UART pgm?

  • Yes, that would be another way to go about it. You should still look at the serial_uartes example to see how two UARTs are initialized in one program. Make sure not to give them identical names to avoid confusion.

    Best regards,

    Simon

  • Sir,

    SDK 15.2 ble_uart program is not advertising. But SDK 15.0 is perfect. So can I initialize the UART1 in that SDK 15.0 ble_uart program?

    And what all steps I want to do to perform the above operation?

  • Hi

    Are you getting any errors when the SDK15.2 is not advertising? Please specify. 

    You can't merge an SDK15.2 project with an SDK15.0 as there will be compilation errors, so you will have to use the 15.2 version for multiple UARTE projects. If you have made any changes to the original ble_app_uart example in SDK15.2 that might cause the errors, I suggest you start with a fresh example.

    I see that you will likely have to change quite a bit in the ble_app_uart example to make it work with the serial_uarte example seeing as uarte and uart is not the same exact thing. Again I would urge you to start out with the serial_uartes example, and incorporate BLE from the ble_app_uart example, as I think this would be the easiest way to accomplish what you want.

    I can't do the work of merging these files for you, as this is your project, but I can give you some pointers and advice. Start with merging the sdk_config.h files to enable BLE in the example, and add the necessary header, component and library files. Then you have to implement these functionalities into your main.c file. Keep in mind that this is not going to be an easy task.

    Best regards,

    Simon

Related