This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x Beaglebone RS485 Cape GPIO

Hi,

I'm currently trying to create a linux application (kernel 3.14) on the beaglebone to output rs485 data. I have a serial cape that will produce the rs485, but there is a DE pin on the rs485 transceiver chip that i need to be able to set to high. There are a lot of tutorials i've found relating to using echo commands for the gpio in a terminal connected to the beaglebone, unfortunately none of these have worked.

Is there something in the device tree that i need to modify in order to be able to change this gpio (it's pin 23 (gpio1_0) on the P1 connector of the cape (or P8 on the beaglebone))? As far i as i can see it is in the right mux mode. I'm also using UART1 for this process.

I did wonder if it's something to do with using a very recent version of the kernel on an old board...

Any pointers would be great!

Thanks :)

Jenny

  • Hi Jenny,

    I will ask the SW team to help on this.

  • Hi Jenny,

    There are a lot of tutorials i've found relating to using echo commands for the gpio in a terminal connected to the beaglebone, unfortunately none of these have worked. 

    You mean: 
      echo 32 > /sys/class/gpio/export

      echo "out" > /sys/class/gpio/gpio32/direction

      echo 1 > /sys/class/gpio/gpio32/value 

      echo 0 > /sys/class/gpio/gpio32/value 

    have no effect? You can't see a change in gpio1_0 pin? 

    What are the pinmux settings for this pin in your DTS?

    Best Regards,

    Yordan

  • GPIO1_0 is pin 25 on P8 of the Beaglebone Black/White. This signal is also connected as MMC1_DAT0 to the eMMC, if this is a Beaglebone Black. Please clarify what Beaglebone are you using.
  • Hi Yordan,

    Yes, none of those commands seem to make a difference to the pin,

    There isn't anything in the am335x-bone.dts that i can see relating to the pin, but in am335x-bone-common.dtsi the pin is set to the following:

    0x00 (PIN_OUTPUT_PULLUP | MUX_MODE7)

    this is in the emmc_pins: pinmux_emmc_pins section - it was initially set to a different mode, but i changed it to mode 7 as i think this is the mode to use the pin for the GPIO? after i changed it i rebuilt everthing and transferred the new dtb and boot images over to the beaglebone,

    Thanks

    Jenny

  • Hi Biser,
    It is a beaglebone white, revision A6 with an rs485 cape revision A1
    Thanks
    Jenny

  • Hi Biser,
    It is a beagebone white (v A6) with an RS485 cape (v A1)
    Could it be that i'm using the dtb's for the beaglebone black and somewhere it's getting confused?
    Thanks
    Jenny
  • Hi Jenny,

    Beagle bone white uses am335x-bone.dts & am335x-bone-common.dtsi.

    You should remove the gpio1_0 from the emmc pinmux dts node & create one for the gpio1.
    Then in am335x-bone.dts you could create a node:
    &gpio1 {
    pinctrl-names = "default"
    pinctrl-0 = <&gpio1_pins>;
    status = "okay";
    };

    This should associate the corresponding pin on the expansion connector P8 with gpio1_0, and after that you should be able to execute the user space commands to toggle the gpio.

    Best Regards,
    Yordan
  • Hi Yordan,

    Thanks!

    That made a difference to the initial values of the pin (as to whether i set it as pulldown or pullup in the dts files), however i still can't seem to change it using the echo commands, i've used:

    echo 32 > export

    then navigated into the greated gpio32 folder, then:

    echo out > direction

    echo 1 > value

    echo 0 > value

    echo 1 > value

    but still can't see any difference on the scope when i look at the pins - is it definitely referred to using 32? I'm getting this number from using the fact that it is gpio1_0 and the number should be calculated using 1*32 + 0,

    Thanks :)

    Jenny