-2

To activate the RTS and CTS pins on Beaglebone, I followed several routes, but unfortunately I did not get any further.

1) the activation of the RXD and TXD was easier. I entered the command at uEnv.txt:

root@beaglebone:/boot# nano uEnv.txt
cmdline=coherent_pool=1M quiet cape_universal=enable
dtb=am335x-boneblack-emmc-overlay.dtb

then I can directly activate the pins in the code

//UART1
system("config-pin P9.26 uart"); // RXD
system("config-pin P9.24 uart"); // TXD
// UART4
system("config-pin P9.11 uart"); // RXD
system("config-pin P9.13 uart"); // TXD

if I want to activate a RTS or a CTS pin with this way,

system("config-pin P9.20 uart"); // CTS

I get the error message

Pin is not modifyable: P9_20 i2c2_sda

information:

root@beaglebone:~# config-pin -l P9_20
Pin is not modifyable: P9_20 i2c2_sda

2) I also used a second way, I commented on the komand at uEnv.txt.

# cmdline = coherent_pool = 1M quiet cape_universal = enable

  I restarted Beaglebone and prepared that:

root@beaglebone:/lib/firmware# cat $SLOTS
 0: PF----  -1
 1: PF----  -1
 2: PF----  -1
 3: PF----  -1
 4: P-O-L-   0 Override Board Name,00A0,Override Manuf,BB-UART4
 5: P-O-L-   1 Override Board Name,00A0,Override Manuf,BB-UART1
 6: P-O-L-   2 Override Board Name,00A0,Override Manuf,BB-UART4-RTSCTS
 7: P-O-L-   3 Override Board Name,00A0,Override Manuf,BB-UART1-RTSCTS

in this case, my code hangs at read function, which responds to code as if UART is not enabled

3) I also tried the command before

capemgr.enable_partno=BB-UART1,BB-UART4

my code also hangs in the read function.

Can someone say what should I do?

gsamaras
  • 66,800
  • 33
  • 152
  • 256
Ayoub
  • 11
  • 1

1 Answers1

0

It is an expected behaviour. If you revise the am335x-bone-common.dtsi file. You will see that if the i2c is enabled. You can not use uart1 rts and cts pin. So that, you should disable the i2c or assign to other pins then, you should mux the cts and rts pin in the pin muxing.

i2c2_pins: pinmux_i2c2_pins {
        pinctrl-single,pins = <
            0x178 (PIN_INPUT_PULLUP | MUX_MODE3)    /* uart1_ctsn.i2c2_sda */
            0x17c (PIN_INPUT_PULLUP | MUX_MODE3)    /* uart1_rtsn.i2c2_scl */
        >;
    };

https://github.com/beagleboard/linux/blob/4.1/arch/arm/boot/dts/am335x-bone-common.dtsi

in the .dts file disable i2c2 like that

&i2c2 {
    status = "disabled";
};
erenbasturk
  • 394
  • 2
  • 8
  • can you tell me exactly what to do to deactivate I²C? or how can I enable the CTS and RTS pins for UART1 and UART4? because i know how to count on the pins 0x178 and 0x17c and how to set the mode I only know that I have the pins: P9_20 (Mode 0 for CTS UART1), P9_19 (Mode 0 for RTS UART1), P8_35 (Mode 6 for CTS UART4), P8_33 (Mode 6 for RTS UART4), – Ayoub Dec 19 '18 at 08:55
  • are the pins in the code piece what you wrote, are they now set for UART or for I²C? – Ayoub Dec 19 '18 at 09:31
  • I did that and also restarted Beaglebone, but I still have the same error messages: Pin is not modifyable: P9_20 i2c2_sda, Pin is not modifyable: P9_19 i2c2_scl, Invalid mode: uart (for pin P8_35), Invalid mode: uart (for pin P8_33) – Ayoub Dec 19 '18 at 12:03
  • I made the changes in am335x-bone-common.dtsi should compile this and put it somewhere? so that I notice the changes? When I try to compile the file with `dtc -O dtb -o am335x-bone-common.dtb -b 0 -@ am335x-bone-common.dtsi` but I get the error: `Error: am335x-bone-common.dtsi: 9.1-2 syntax error` `FATAL ERROR: Unable to parse input tree` – Ayoub Dec 19 '18 at 15:04