2

I am trying to send data from PC using minicom program to BeagleBone driver via USB serial adapter cp2102. I am using the driver whose code is here.

I connect the adapter to bbg this way :

  • serial device TX -> beaglebone UART2 RX pin 22
  • serial device RX -> beaglebone UART2 TX pin 21 on the P9 extension.

I added all port data to the device tree, there is a device tree code:

#include "am335x-boneblack.dts"
&am33xx_pinmux {
    uart2_pins: uart2_pins {
        */
        pinctrl-single,pins = < 
            AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLDOWN | MUX_MODE1)
            AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE1)
            >;
    };
};
&uart2 {
    compatible = "serial"; //This is used when identifying a compatible device driver
    status = "okay";   
    pinctrl-names = "default";
    pinctrl-0 = <&uart2_pins>;
};

I open two terminal windows on my PC. In one terminal window ,for the PC end of this experimental serial connection ,I use minicom programm :

sudo minicom ttlUSB0

In another terminal window that presents access to the serial console I enter the command :

cat /dev/hw_serial-48024000

In an open minicom program of the first terminal I enter characters . in the second terminal I wait to receive these characters but no data is coming..

The baud-rate value is set to the same value 115200 in the minicom program and in the BeagleBone driver.

it should look like this(but it doesn't work for me ) enter image description here

RaM
  • 21
  • 3
  • You have only provided a vague summation of what you're doing and some sort of result. You should have read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) before posting. How do you expect us to provide any specific advice without any details? "*i get an error*" -- You are using two (2) computers. Exactly where does this message appear? Which computer/program is generating this message? – sawdust Sep 01 '22 at 17:20
  • thanks for the correction! i will fix it – RaM Sep 04 '22 at 08:03
  • "*I type the cat utility ...*" -- You are still providing a vague summation of what you're doing; post the exact command you entered. Are your confusing descriptions possibly due to having (presumably) two terminal windows open on your PC (i.e. one for the BB serial console, another for the PC end of this experimental serial connection)? You neglect to clearly mention it, but you do have access to the serial console of the BeagleBone, don't you? Perhaps you need to draw a diagram of the connections between your PC and the BeagleBone? – sawdust Sep 04 '22 at 21:36
  • Your Device Tree node is poorly formatted and cluttered with comments, and therefore difficult to read. The `status = "good";` is clearly wrong, and needs to be `status = "okay";` The compatibility string is highly suspect, and is probably already (& correctly) defined in the SoC **.dtsi** file. You clearly need to review the boot log (or **dmesg** command), **/proc/device-tree/**, and **/proc/tty/drivers** to verify that your new serial device is initialized & installed. – sawdust Sep 04 '22 at 21:40
  • thank you very much for your attention to my question! i corrected the text – RaM Sep 06 '22 at 08:14
  • 1
    i input command: debian@beaglebone:~$ cat /proc/misc | grep hw_serial and get: 57 hw_serial-481a8000 58 hw_serial-48024000 – RaM Sep 06 '22 at 09:46
  • Your recent comment seems to indicate that the custom device driver is installed. You could also inspect **/proc/iomem** and **/proc/interrupts**. At this point the likeliest issues are (a) wiring between the PC & BB (are RxD & TxD reversed?) (ground?), and (b) pin multiplexing. For the latter, mount **debugfs**, and then review **/sys/kernel/debug/pinctrl/pinctrl-maps** and//or **/sys/kernel/debug/pinctrl/pinctrl-handles** Perhaps sending from the BB (instead of receiving) would be easier to test, especially if you have an oscilloscope. Trace the TxD signal from the BB to the USB adapter. – sawdust Sep 06 '22 at 21:16
  • sorry, i use cat /proc/iomem with sudo and get:48022000-4802201f : serial ,481aa000-481aa01f : serial – RaM Sep 07 '22 at 09:02
  • there are values in /proc/interrupts :160: 0 INTC 74 Level hw_serial, 161: 0 INTC 45 Level hw_serial – RaM Sep 07 '22 at 09:10
  • If your **/proc/iomem** actually has `48022000-4802201f : serial`, then you seem to have a mapping or DT problem. The UART2 registers exist at `0x48024000`, rather than `0x48022000` (which is UART1), and span 4KB rather than just 32 bytes. Is there any driver claiming the `0x48024000` region? IOW stop being so parsimonious with the information, and add all the salient lines to your question. BTW why do you need to use **sudo**? The permissions for **/proc/iomem** should be `r--r--r--`. – sawdust Sep 07 '22 at 22:29

0 Answers0