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

How to use UART on nrf52832 together with Zephyr RTOS?

Hi guys,

Does anybody know how to send the sensor data from the nrf52832 device to the terminal when it is not connected directly to the PC with USB cable. I tried with FTDI cable and connected wires to the propriety pins, but I am still not able to see anything in my Minicom terminal. Do you maybe know how can I fix this? Can I do that using UART or something else? I will appreciate a lot if you have an example to show me how can start solving this problem. Thanks a lot in advance and kind regards!!

Parents
  • Hello,

    It should not be a problem to view UART data on minicom if you have a working setup. Are you using the nRF52 DK or a custom/third-party board?

    FTDI cable and connected wires to the propriety pins, but I am still not able to see anything in my Minicom terminal.

     Which pins did you connect?

  • I am using the nRF52dk_nRF52832 board and running the Zephyr on it. Do you maybe have the example how can I configure and use the UART communication, because I found some example but not relevant for Zephyr. Do you maybe have some example where I can see how to configure the related pins and way of communication? I used 5V, GND and Tx (P0.06) pins on my board, and 5V, GND and Rx pins on the FTDI cable.

  • Thanks for the clarification, but could you please confirm if you're using the nRF52 DK (link), or is it a different board. I'm asking because the DK board already comes with an on-board serial bridge (via the Jlink) so you don't need any external FTDI cable. To test the UART communication, you can use the simple echo sample in \ncs\zephyr\samples\subsys\console\echo. TX is connected to P0.06 by default.

    Please note that supplying 5v directly may cause permanent damage to the chip. The same applies to the UART bus, the voltage must not exceed VDD+0.3V.

  • I use the same nRF52 DK board as you send me in this link. But, what to do in my case when I disconnected my board from my laptop and connected the relevant pins to my emulator (which emulates the environmental power sources)? How to flash the example in that case and see the output (in my case for example output will be 2.7V)?

Reply Children
  • I assumed the requirement was to get UART/USB communication with your PC to work. It would be good to know what the actual purpose/goal of using an external serial bridge and power source is. You can't program the device through the UART interface unless you already have FW supporting DFU over UART running on your device.

    And please make sure the voltage on the FTDI is the same as the VDD voltage going into the nRF52 so the TX and RX line doesn't exceed VDD+0.3V as mentioned earlier.

  • Well, I will try to explain again from the scratch because I think that maybe we did not understand each other very well. I used the example for sensing the temperature and humidity (zephyr/sample/sensor/dht) and everything works correct when my board (nRF52 DK same as you sent me before link) is connected via USB to my laptop. In that case I can open the Minicom terminal and see the output. Now, instead of USB I will try to use the external power source (Environmental Emulator) which will give the necessary power and enable my board to work properly and read the sensor data. In that case, I will disconnect my board (put the USB aside) and connect it to my emulator. When I do that, I am not able to see output in Minicom and because of that my main question is how to enable that. How can I see my outputs in case when my board is not directly connected via USB? Is that possible using UART or some other method? That is my main question. With Arduino I used FTDI cable and the configuration for that was very simple. Can I now use FTDI cable to see outputs or not? I hope that now I described my problem in more detail. Regards!!

  • I looked up the specification for this sensor (dht22?) and see that the min. operating voltage 3.3v. So I guess the regulated output supplied from the USB was too low to properly drive the sensor. The 5V from the USB is actually regulated down to v3.3, but the board includes a reverse protection diode which further drops the VDD to about 2.7V. You can however bypass this diode by shorting SB10 (solder bridge) as shown in the "Power supply" section of the DK user guide and thus eliminate the voltage drop.

    As for the external FDTI cable and supply, are you supplying less than 3.6V to both the FTDI and the nRF52 DK now? And have you made sure that your FDTI cable is actually supporting I/O operations below 5V? Some cables may be limited to 5 volts.

  • I really don't know, but based on my previous experiments I was able to connect FTDI on 3.3V on my Arduino board. Can you suggest me now what is the best for me to do. Let say, for example how can I print "Hello World!" in my Minicom terminal if my device is not directly connected via USB as the main power source? I connect my device with the emulator which gives me 3.3V and I want to enable the terminal to read that output? Based on our conversation, I am still little bit confused if it is possible to do using the FTDI cable? Do you have any example to send me or method to explain me? Thanks in advance!

Related