Nordic nRF52832 - UART redefining the pins?


frv
 

Hi Zephyr community,

So far I couldn't see where the default UART rx/tx pin mapping (RX = 8 and TX = 6) is happening in the Zephyr code.
I want to run the hci_uart on the nRF52832 SoC to implement just the BLE connectivity.

I'm wondering can the default UART pinning of RX/TX/CTS/.. be re-programmed in the nrf52_pca10040.overlay file.

E.g something like this:



Probably HW flow control is "always" required for h4 communication?!

Thanks in advance,

Best regards,
Frank


Carles Cufi
 

Hi there,

 

The default PINs are configured in the board .dts file:

https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/arm/nrf52_pca10040/nrf52_pca10040.dts#L95

 

You can indeed change them in you .overlay file.

 

Hardware flow-control is not required but highly recommended.

 

Regards,

 

Carles

 

From: devel@... <devel@...> On Behalf Of frv via Lists.Zephyrproject.Org
Sent: 08 April 2019 13:04
To: devel@...
Cc: devel@...
Subject: [Zephyr-devel] Nordic nRF52832 - UART redefining the pins?

 

Hi Zephyr community,

 

So far I couldn't see where the default UART rx/tx pin mapping (RX = 8 and TX = 6) is happening in the Zephyr code.

I want to run the hci_uart on the nRF52832 SoC to implement just the BLE connectivity.

 

I'm wondering can the default UART pinning of RX/TX/CTS/.. be re-programmed in the nrf52_pca10040.overlay file.

 

E.g something like this:

 

 

Probably HW flow control is "always" required for h4 communication?!

 

Thanks in advance,

 

Best regards,

Frank


frv
 

Hi Carles,

Finally I got it up and running :).

So indeed changing the pinning in the overlay file did the trick, although I also had to redefine the cts/rts despite not using them as one of the values was used by my new RX pin value. 

Also I had to downgrade speed to 115200 instead of default 1000000.
I was a little bit surprised when baudrate/speed is set in the configuration it can no longer be adjusted in the btattach command.
E.g. If 1000000 is set in the overlay file it can not be set as btattach -B /dev/ttyUSB0 -S 115200 or at least it will not work.

Also I had to set explicit the -N to disable "flow control" when using the btattach command despite it was set in the nrf52.conf file.

So after a little bit of puzzling with parameters I got the result I wanted to have.

In our final design we will use the "hardware flow control" of course and use as baudrate 1M but in my setup the RS232/USB converter was limited to 115200.

Best regards,
Frank