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

UARTE multiple instance with new nrfx exam

Hello,

I would like to use the two UARTEs available on nRF52840 with external asynchronous chips.

I've started a new development with the last sdk (15.3.0) and would like to know if there is a clear example on how to initialize the peripherals.

I'd like to use the UARTES on interrupt but I can't figure out how to use the new nrfx drivers.

Best regards,

JY

Parents
  • Hi Jean-Yves

    Have you taken a look at the new nrf_serial driver in nRF5 SDK v15.3.0?

    It is well suited for asynchronous UART devices, and will use the nrfx_uarte driver under the hood. 

    There is an example for this driver in the examples/peripheral/serial folder in the SDK. 

    While this example only uses a single UART, you should be able to register two instances of the driver as long as you enable the required peripherals in the sdk_config.h file. 

    Best regards
    Torbjørn

  • Hi,

    I just realized I work with uart example and not serial example. Sorry for the mistake.

    In this example, modifications in sdk_config.h still doesn't seem's to have any effect on the software behavior.

    Regards,

    JY

  • Hi Jean-Yves

    The reason for this is that the SDK has a 'legacy' layer, that converts the old pre-NRFX defines to the new NRFX defines. 

    In the case of the UART this is the UART0_ENABLED and UART1_ENABLED define that you can also find in sdk_config.h

    If you disable UART0_ENABLED it should cause a build error, and if you enabled UART1_ENABLED you should be able to use both of the UART's. 

    Best regards
    Torbjørn

Reply
  • Hi Jean-Yves

    The reason for this is that the SDK has a 'legacy' layer, that converts the old pre-NRFX defines to the new NRFX defines. 

    In the case of the UART this is the UART0_ENABLED and UART1_ENABLED define that you can also find in sdk_config.h

    If you disable UART0_ENABLED it should cause a build error, and if you enabled UART1_ENABLED you should be able to use both of the UART's. 

    Best regards
    Torbjørn

Children
No Data
Related