Changing Hardware UART baudrate of nrf52dk in Zephyr?

This is actually a mix of software and hardware question.

Im trying to create a pass through device and I'm currently using the peripheral UART example in zephyr.

Where Android App >> nrf52dk NUS >>> 900MHz RF and vice versa. My 900MHz RF module has baud rate of 9600 and even parity.

1. How do I change the baud rate and parity of hardware UART?

2. Is the USB CDC connected to the nrf52832 chip using pin P0.06 and P0.08?

So while I read the data from usb cdc the data will also be sent to the RF module connected on P0.06 and P0.08 ?

EDIT : add this question

3. From the uart_init function. Tried configuring the baudrate but the communication on app and serial monitor doesnt work afterwards. 
It is confusing to me. It is configuring the hardware UART? but the variable has NUS written in it?

uart = device_get_binding(CONFIG_BT_NUS_UART_DEV);


TIA

Parents
  • Hi,

    Which version of the nRF Connect SDK are you using?

    You can change the initial baud rate for a uart instance in the overlay file for your board, for example for uart0:

    &uart0 {
        current-speed = <9600>;
    };

    CONFIG_BT_NUS_UART_DEV is declared in the Kconfig file in the peripheral_uart folder. It is simply a string which specifies which uart instance should be used.

  • Hello, thank you for reply. I'm using 1.7.1

    Added zephyr/nrf52dk_nrf52832.overlay

    &uart0 {
    	status = "okay";
    	compatible = "nordic,nrf-uarte";
    	current-speed = <9600>;
    	tx-pin = <6>;
    	rx-pin = <8>;
    };

    I want to add this one for parity but it is not recognized.

    nrf-uarte-parity = <UART_CFG_PARITY_EVEN>;


    I'm trying to update the SDK to the latest. Still downloading. Or any other way to modify the parity?

Reply
  • Hello, thank you for reply. I'm using 1.7.1

    Added zephyr/nrf52dk_nrf52832.overlay

    &uart0 {
    	status = "okay";
    	compatible = "nordic,nrf-uarte";
    	current-speed = <9600>;
    	tx-pin = <6>;
    	rx-pin = <8>;
    };

    I want to add this one for parity but it is not recognized.

    nrf-uarte-parity = <UART_CFG_PARITY_EVEN>;


    I'm trying to update the SDK to the latest. Still downloading. Or any other way to modify the parity?

Children
Related