This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with porting nxp uart driver for nrf52840-dk

Hi i am involved in sdk5 based uart porting project

i can run example project and receive/send data to/from nrf52840-dk .

the problem is when i dig deep into the project i found more than one implementations of uart driver

nrfx_uart, nrf_drv_uart, and nrf_uart.

my task is to write an abstraction layer code and i am not sure which driver to use as base.

overall goal is to write init deint and write functions.

an easy example is appreciated

Parents
  • Hi,

    There are two implementations of the nrfx driver, one for the UART (without EasyDMA), and the other for the UARTE — Universal asynchronous receiver/transmitter with EasyDMA. With the latter being recommended for new designs.

    Also note that most of our SDK examples are using the nrfx drivers via the legacy layer as mentioned in the "Migration guide for nrfx drivers" section of the SDK documentation.

    Attached below is a small demo sample I made for the nrfx_uarte driver. The driver documentation can be found here: UART (note is shows usage with the legacy AP, but it is very similiar to the nrfx api):

    8424.nRF5_SDK17.1.0_uart_nrfx.zip

    Best regards,

    Vidar

  • I have some luck with your answer

    i am able to write init and deinit functions but i could not work on second instant or uart now

    i am using following to create instant 0 of nrf52840-dk

    #define APP_UART_DRIVER_INSTANCE 0

    static nrf_drv_uart_t uart_instent = NRF_DRV_UART_INSTANCE(APP_UART_DRIVER_INSTANCE);

    however when i try creating second instant 

    #define APP_UART_SECOND_DRIVER_INSTANCE 1

    static nrf_drv_uart_t uart_instent2 = NRF_DRV_UART_INSTANCE(APP_UART_SECOND_DRIVER_INSTANCE);

    i get following error.

    'NRFX_UARTE1_INST_IDX' undeclared here (not in a function); did you mean 'NRFX_UARTE0_INST_IDX'?

    Any idea how to perform it?

Reply
  • I have some luck with your answer

    i am able to write init and deinit functions but i could not work on second instant or uart now

    i am using following to create instant 0 of nrf52840-dk

    #define APP_UART_DRIVER_INSTANCE 0

    static nrf_drv_uart_t uart_instent = NRF_DRV_UART_INSTANCE(APP_UART_DRIVER_INSTANCE);

    however when i try creating second instant 

    #define APP_UART_SECOND_DRIVER_INSTANCE 1

    static nrf_drv_uart_t uart_instent2 = NRF_DRV_UART_INSTANCE(APP_UART_SECOND_DRIVER_INSTANCE);

    i get following error.

    'NRFX_UARTE1_INST_IDX' undeclared here (not in a function); did you mean 'NRFX_UARTE0_INST_IDX'?

    Any idea how to perform it?

Children
Related