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

UART usage - I cannot see the light in the SDK

In advance I would like to say I’m sorry for the frustration that this message reflects…Event though I have been using the UART for some time, adding more functionality makes me search documentation for a UART description, and this makes me really frustrated.

I have what I think is a relatively simple need, I want to use UART0 and UART1 on a nRF32840 (both for some RS485 communication).

 

I do not care if it is NRF_DRV, NRFX or APP layer, anything that can be made to work will do!

 

Originally, I thought that selecting between NRF or NRFX was simple; documents suggest that NRF is legacy and I should use the "new" NRFX layer.

So selecting NRFX_UART_ENABLE would be logical and then including nrfx_uart.c driver file.....

But nothing is that simple with this SDK.... there always seems to be a mess of dependencies between configuration macros and files you need to include. and absolutely nothing that documents it (except heavy reading of header files of course ;-). I would love to see. “If you want this layer, tick this in SDK config and include ….”)

Well initial suggestion as above for NRFX just creates a bunch of errors…. so what is the combination needed...

It seems I can choose between using:

1 nrf_drv_uart

2 nrfx_uart

3 nrfx_uarte

4 app_uart

Can anyone suggest settings that will make just one of these options work, it would be highly appreciated and hopefully spare me a lot of testing and experimentation.

What I’m looking for what is a combination of what should be in SDK Config for

NRFX_UARTE section

NRFX_UART section

NRF_DRV (UART_ENABLED) section

APP_UART_ENABLED (+APP_FIFO_ENABLED) section

And any other sections that have dependencies!

I want to be able to call ???_init, send one or more bytes and receive bytes one by one

Parents
  • Starting from scratch again to see if I can find something workable.

    Decided to start with ble_app_template as basis as I have done this before.!

    1 Add a module to run a serial protocol (reduced) using nrf_serial API.

    2 Add nrf_serial.c library

    3 Add nrf_queue.c library

    4 Add include serial directory to compiler path.

    5 To get correct I/O for my board, modified project to use custom_board.h by removing project define BOARD_PCA10056 and replacing it with BOARD_CUSTOM.

    6 Added NRF_SERIAL_ENABLED and NRF_QUEUE_ENABLED to sdk_config.h file and enabled them.

    7 Linker error undefined symbol for all nrf_queue_xxx function….. no clue why… NRF_QUEUE_ENABLED is checked in sdk_config.h and nrf_queue.c is included in the project……

    Stuck again.

  • Aaaaahhhhh enabling legacy layer made i build....

    So a missing NRFX_... define can be enabled by enabling legacy layer. I do not get it - it's a mess.

  • Sorry for being so harsh, but I am sooooo frustrated.

    I already used really long time to get the uart running the first time around, that's when I only needed uart 0, I through that when I needed the second uart, it would be a simple copy paste of the basics. But no way, and now I have used 3 days without any progress.

    Maybe the fastest route is to use the HAL layer and write all the glue myself. But WHY, with 6 different API's to choose from.

  • Oh, that is not all. They change API at every SDK version I worked with since 6 and they API is getting worst every time.  Can't understand why they introduce to sdk_config.h mess.  It was much better before that.

  • Have never tried it without, so I do not know...

    It seems to me that there are a lot of good ideas, both in libraries and setup, but there is too much cross dependencies and absolutely no real documentation... The real important documentation is the overview and descriptions on high level that can get you started and make good choices.

Reply Children
No Data
Related