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

UARTE Callback not called (Using NRFX EasyDMA)

Hi, I am a beginner, during my internship I need to evaluate the nRF9169 DK for cellular applications.

I successfully implemented the communication over serial by using the library "drivers/uart.h". In order to get benefits of EasyDMA features, I decided to focus on the "nrfx_uarte.h" library.

I managed to create an example in blocking mode that works on UARTE2 using the functions nrfx_uarte_init(&inst, &cfg, NULL), nrfx_uarte_tx and nrfx_uarte_rx. But for some reason, when I define a callback as the third parameter of the initialisation function (using async feature) and when I want to TX few bytes: The bytes are well transmitted but the callback is never called (I used the debug to check this). The entire system is like frozen, I don't get any error/reset. The same behaviour happens during RX.

I'm not sure of the methods to debug this, I don't know if the cause can be the configuration of the project, if uarte interrupts are disabled or something else.

I'm working with : nRF Connect SDK V1.2.0 on the Segger environnement.

Please find here the zip of my project : https://drive.google.com/file/d/1qOYnxOO4wu0h6lejDumBVljWkgC8MIKH

Thank you very much for your help.

Lucas

Parents Reply
  • Hi again Lucas, 

    If you have a look here: https://docs.zephyrproject.org/1.9.0/kernel/other/interrupts.html

    You can find that you would need to use IRQ_DIRECT_CONNECT() to match the interrupt to the interrupt handler. 

    But as you mentioned you can use UART2 I assume that you have modified the spm.conf to enable it in the non-secure domain ? 

    I was testing with UART1 and here what I added to make the interrupt works: 

    in prj.conf: 

    CONFIG_NRFX_UARTE1=y
    CONFIG_UART_1_NRF_UARTE=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_UART_1_INTERRUPT_DRIVEN=y
    CONFIG_UART_1_NRF_FLOW_CONTROL=n

    Note: both CONFIG_UART_INTERRUPT_DRIVEN and CONFIG_UART_1_INTERRUPT_DRIVEN are used. 

    And in main.c I called this: 

    IRQ_DIRECT_CONNECT(UARTE1_SPIM1_SPIS1_TWIM1_TWIS1_IRQn, 0, nrfx_uarte_1_irq_handler,0);
    irq_enable(UARTE1_SPIM1_SPIS1_TWIM1_TWIS1_IRQn);

    The nrfx library is bypassing the Zephyr RTOS, so it's why you need to use IRQ_DIRECT_CONNECT() 

Children
Related