nrf54L15 : Unable to use UARTE00 P2.0, P2.2, P2.3, P2.4 not able to send data.

Hello,

I am not able to send any data through the pins of port P2 using Pins : P2.0, P2.2, P2.3, P2.4 , while the pins P1.11, P1,10, and P1.4, P1.5 are working properly.

I referred to this issue and tried to configure accordingly, but still unable to send and receive data. I am using the DK, 

I tried to call nrfx_power_constlat_mode_request(); as well, but I am not sure where I am going wrong.

Parents
  • Hi,

    I can see I had the other case, did you also see my follow up reply about board configurator?

    Kenneth

  • Hello,

    Sorry for the Late Response.

    I did not understand what I need to configure in the Board Configurator. Are we talking about the application in nrf connect for Desktop?

  • Yes, but I can see that the app doesn't support this as of yet, it's planned end of September.

    Kenneth

  • Hello, 

    I wanted to use P2.02 as RXD and P2.03 as TXD in NRF54L15. I am using a custom board. 

    My configuration looks like this on the dts File :

        /omit-if-no-ref/ uart00_default: uart00_default {
            group1 {
                psels = <NRF_PSEL(UART_TX, 2, 3)>;
            };
            group2 {
                psels = <NRF_PSEL(UART_RX, 2, 2)>;
                // bias-pull-up;
            };
        };
    
        /omit-if-no-ref/ uart00_sleep: uart00_sleep {
            group1 {
                psels = <NRF_PSEL(UART_TX, 2, 3)>,
                    <NRF_PSEL(UART_RX, 2, 2)>;
                low-power-enable;
            };
        };
    /////////////////////////////////////////////////////////////////////////////////////////////////////////
    &uart00 {
        compatible = "nordic,nrf-uarte";
        status = "okay";
        current-speed = <9600>;
        pinctrl-0 = <&uart00_default>;
        pinctrl-1 = <&uart00_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    #include "header.h"
    
    #define UART_USB_NODE   DT_NODELABEL(uart00)
    const struct device *uart_dev_usb= DEVICE_DT_GET(UART_USB_NODE);
    char usb_buff[10] = {0};
    const struct uart_config uart_cfg_usb = {
     .baudrate = 9600,
     .parity = UART_CFG_PARITY_NONE,
     .stop_bits = UART_CFG_STOP_BITS_1,
     .data_bits = UART_CFG_DATA_BITS_8,
     .flow_ctrl = UART_CFG_FLOW_CTRL_NONE
    };
    
    static void uart_usb_cb(const struct device *dev, struct uart_event *evt, void *user_data)
    {
    //LOG_INF("uart_cb enum = %d\n\r",evt->type);
     switch (evt->type)
     {
        case UART_TX_DONE:
            printk("UART_TX_DONE \r\n");
        // do something
        break;  
        case UART_TX_ABORTED:
        // do something
        break;
    
    
        case UART_RX_RDY:
            f.gnss_uart_rx_F = 1;
            printk("RX Data :  %s\r\n",usb_buff);
    
            break;  
        case UART_RX_BUF_REQUEST:
        // do something
        break;  
        case UART_RX_BUF_RELEASED:
           
        // do something
        break;
        case UART_RX_DISABLED:
            uart_rx_enable(dev, (uint8_t *)usb_buff, sizeof(usb_buff), 500 * 1000);
            break;  
        case UART_RX_STOPPED:
        // do something
        break;
        default:
        break;
     }
    }
    
    void USB_init(void)
    {  
        int err = 0;
        if (!device_is_ready(uart_dev_usb))
            printk("err : device_is_ready\r\n");
        else
            printk("no err : device_is_ready\r\n");
    
        err = uart_configure(uart_dev_usb, &uart_cfg_usb);  
        if (err == -ENOSYS)
        {
            printk("err = %d : uart_configure\r\n", err);
            // return -ENOSYS;
        }
        else
        {
            printk("err = %d : uart_configure\r\n", err);
        }
    
        err = uart_callback_set(uart_dev_usb, uart_usb_cb, NULL);
        if (err)
        {
            printk("err = %d : uart_callback_set\r\n", err);
            // return err;
        }
        else
        {
            printk("err = %d : uart_callback_set\r\n", err);
        }
        uart_rx_enable(uart_dev_usb, (uint8_t *)usb_buff, sizeof(usb_buff), 1000*1000);
    }
    
    void USB_printk(char *data,int len)
    {
        int err = uart_tx(uart_dev_usb, data, len, 100);
        printk("err = %d\r\n", err);
    }

    Also Before transmitting, I used the function : 
    nrfx_power_constlat_mode_request();
    I am using a loopback format.
    I am using P1.4, P1.5 and P1.10, and P1.11 also, but did not face any issue while using those.
    Is there something i need to change? Am I going wrong somewhere?
Reply Children
  • Hello, 

    Thankyou For Confirming.

    We figured that out later. We need this UART for logging.and we want to use only TX. So I guess it be possible to use P2.2 as TX (Swapping with P2.3) for UARTE00?

  • varsha@ said:
    So I guess it be possible to use P2.2 as TX (Swapping with P2.3) for UARTE00?

    That should work yes.

    Kenneth

  • Hello,

    Okay, now can you please guide me how am I supposed to use P2.2 as TX and P2.0 as RX in nrf54l15 DK first, so I can use it later on the custom board.

    I feel like Im making a mistake somewhere.

     

    &pinctrl
    {
    	/omit-if-no-ref/ uart00_default: uart00_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 2, 2)>;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 2, 0)>;
    			// bias-pull-up;
    		};
    	};
    
    	/omit-if-no-ref/ uart00_sleep: uart00_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 2, 2)>,
    				<NRF_PSEL(UART_RX, 2, 0)>;
    			low-power-enable;
    		};
    	};
    };
    
    &uart00 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart00_default>;
    	pinctrl-1 = <&uart00_sleep>;
    	pinctrl-names = "default", "sleep";
    };
    
    
    ///////////////////////////////////////////////////////////////////////
    
    #include "header.h"
    
    #define UART_USB_NODE   DT_NODELABEL(uart00)
    const struct device *uart_dev_usb= DEVICE_DT_GET(UART_USB_NODE);
    char usb_buff[10] = {0};
    const struct uart_config uart_cfg_usb = {
     .baudrate = 115200,
     .parity = UART_CFG_PARITY_NONE,
     .stop_bits = UART_CFG_STOP_BITS_1,
     .data_bits = UART_CFG_DATA_BITS_8,
     .flow_ctrl = UART_CFG_FLOW_CTRL_NONE
    };
    
    static void uart_usb_cb(const struct device *dev, struct uart_event *evt, void *user_data)
    {
    //LOG_INF("uart_cb enum = %d\n\r",evt->type);
     switch (evt->type) 
     { 
        case UART_TX_DONE:
            printk("UART_TX_DONE \r\n");
        // do something
        break;  
        case UART_TX_ABORTED:
        // do something
        break; 
    
    
        case UART_RX_RDY:
            printk("UART_RX_RDY \r\n");
            printk("55555555 %s\r\n",usb_buff);
    
            break;  
        case UART_RX_BUF_REQUEST:
        // do something
        break;  
        case UART_RX_BUF_RELEASED:
            
        // do something
        break; 
        case UART_RX_DISABLED:
            uart_rx_enable(dev, (uint8_t *)usb_buff, sizeof(usb_buff), 500 * 1000);
            break;  
        case UART_RX_STOPPED:
        // do something
        break; 
        default:
        break; 
     }
    }
    
    void USB_init(void)
    {   
        int err = 0; 
        if (!device_is_ready(uart_dev_usb)) 
            printk("err : device_is_ready\r\n");
        else
            printk("no err : device_is_ready\r\n");
    
        err = uart_configure(uart_dev_usb, &uart_cfg_usb);  
        if (err == -ENOSYS) 
        {
            printk("err = %d : uart_configure\r\n", err);
            // return -ENOSYS;
        }
        else
        {
            printk("err = %d : uart_configure\r\n", err);
        }
    
        err = uart_callback_set(uart_dev_usb, uart_usb_cb, NULL);
        if (err) 
        {
            printk("err = %d : uart_callback_set\r\n", err);
            // return err;
        }
        else
        {
            printk("err = %d : uart_callback_set\r\n", err);
        }
        uart_rx_enable(uart_dev_usb, (uint8_t *)usb_buff, sizeof(usb_buff), 1000*1000); 
    }
    
    void USB_printk(char *data,int len)
    {
        int err = uart_tx(uart_dev_usb, data, len, 100);
        printk("err = %d\r\n", err);
    }
    
    
    ////////////////////////////////////////////////////////////////
    
    
    #include "header.h"
    #include <nrfx_power.h>
    LOG_MODULE_REGISTER(main);
    
    int main(void)
    {
        int ret = 0;
        LOG_INF("Enter into the main\r\n"); 
        ret = nrfx_power_constlat_mode_request();
        printk("ret = %d\r\n",ret);
        while (1)
        {
            USB_printk("hello\r\n",sizeof("hello\r\n"));
            k_msleep(100);
        }
    }
    
    

    The same code works if the pins are P1.4 and P1.5 and using UART20

  • varsha@ said:
    Okay, now can you please guide me how am I supposed to use P2.2 as TX and P2.0 as RX in nrf54l15 DK first, so I can use it later on the custom board.

    Wait until end of September when the new version of Board controller app is ready that allow disabling the flash that is on the DK where the pins are by default connected, ref Table 3 here:
    https://docs.nordicsemi.com/bundle/ug_nrf54l15_dk/page/UG/nRF54L15_DK/hw_desription/connector_if.html 

    Kenneth

  • In that case, I should be able to use this pin (P2.2 for TX) without any constrain on the custom board. The issue is on the DK right?

Related