Then Linux and Java have other ways to deal with this.

The uart is known (should be) as a serial port in the OS, this is something
you can instruct the OS to do.

Check out serial communication in Java and connect through the OS with the
right port.

Gwen


Op do 1 jul. 2021 om 15:51 schreef Radovan Chovan <rado...@gmail.com>:

> I would like to trasmit data via UART4_TXD and receive viac UART4_RXD.
>
> Btw, I try to write to gpio30 and I think I figured out finally how it
> use. Export -> Set Direction -> Read / Write -> Unexport.
>
> Dátum: štvrtok 1. júla 2021, čas: 12:51:05 UTC+2, odosielateľ:
> hel...@deepsoft.com
>
>> At Wed, 30 Jun 2021 23:25:19 -0700 (PDT) beagl...@googlegroups.com
>> wrote:
>>
>> >
>> > config-pin P9_26 gpio
>> > ERROR: open() for /sys/devices/platform/ocp/ocp:P9_26_pinmux/state
>> failed,
>> > No such file or directory
>> >
>> >
>> > write "in" to /sys/class/gpio/gpio14/direction (for input)
>> > write "out" to /sys/class/gpio/gpio14/direction (for output) ... Did
>> you
>> > mean gpio15 (not gpio14)? gpio15 ... UART1_TXD
>> >
>> > I will try UART4_RXD (P9_11 - gpio30) and UART4_TXD (P9_13 - gpio31).
>>
>> Why are you speificly going after UART pins? Are you wanting to actually
>> use
>> the UARTs?
>>
>> >
>> >
>> > Dátum: streda 30. júna 2021, Ä as: 17:21:06 UTC+2, odosielateľ:
>> > hel...@deepsoft.com
>> >
>> > > At Wed, 30 Jun 2021 07:03:38 -0700 (PDT) beagl...@googlegroups.com
>> wrote:
>> > >
>> > > >
>> > > > I tried to use write operation on /sys/class/gpio/gpio14
>> (gpio15)/value,
>> > > > but nothing happens (from
>> > > >
>> https://github.com/RobertPHeller/JAVALinuxGPIO/blob/main/LinuxGPIO.java
>> > > )
>> > > > I figured out that PrintStream doesn't throw exceptions so I tried
>> to
>> > > use
>> > > > FileOutputStream.
>> > > > Then I got exception:
>> > > >
>> > > > java.io.IOException: Operation not permitted
>> > > > at java.io.FileOutputStream.write(Native Method)
>> > > > at java.io.FileOutputStream.write(FileOutputStream.java:290)
>> > > >
>> > > > Read operation via FileInputStream is ok.
>> > > >
>> > > > I run my java application with "sudo".
>> > > >
>> > > > gpio14 ... P9_24 (UART1_TXD)
>> > > > gpio15 ... P9_26 (UART1_RXD)
>> > > > Right?
>> > >
>> > > First of all you need to configure the pins:
>> > >
>> > > config-pin P9_24 gpio
>> > > config-pin P9_26 gpio
>> > > ("config-pin -l P9_24" list the possible options, "config-pin -q
>> P9_24"
>> > > displays the current settings. There is an extended versin of
>> config-pin
>> > > under /opt/source/bb.org-overlays/tools/beaglebone-universal-io/)
>> > >
>> > > You then need to "export" the GPIO pins:
>> > >
>> > > write "14" to /sys/class/gpio/export
>> > > write "15" to /sys/class/gpio/export
>> > >
>> > > You also need to configure the direction:
>> > >
>> > > write "in" to /sys/class/gpio/gpio14/direction (for input)
>> > > write "out" to /sys/class/gpio/gpio14/direction (for output)
>> > >
>> > > (My GPIO class does that in the constructor)
>> > >
>> > > To avoid sudo, you put yourself into the gpio group:
>> > >
>> > > sudo usermod -a -G gpio $USER
>> > >
>> > > then logout and log back in.
>> > >
>> > > >
>> > > >
>> > > > Dátum: utorok 29. júna 2021, Ä as: 16:42:45 UTC+2,
>> odosielateľ:
>> > > Dennis Bieber
>> > > >
>> > > > > On Tue, 29 Jun 2021 07:02:06 -0700 (PDT), in
>> > > > > gmane.comp.hardware.beagleboard.user Radovan Chovan
>> > > > > <rado991-re5jqee...@public.gmane.org> wrote:
>> > > > >
>> > > > > >Thanks for all your comments.
>> > > > > >
>> > > > > >Is there any mapping between /sys/class/gpio and schematic
>> diagram of
>> > > > > >Beaglebone Black board?
>> > > > > >
>> > > > > Does
>> > > > >
>> https://vadl.github.io/beagleboneblack/2016/07/29/setting-up-bbb-gpio
>> > > > > provide any help.
>> > > > >
>> > > > > >I want to use pin P9_24 (UART1_TXD) and P9_26 (UART1_RXD).
>> > > > > >
>> https://beagleboard.org/static/beaglebone/BEAGLEBONE_SCHEM_A3.pdf
>> > > (page
>> > > > > >11/11)
>> > > > > >
>> > > > > P9_24 equates to GPIO15, but in raw pin numbering appears to be
>> 97. As
>> > > > > I recall, there are 32 GPIOs per "CHIP", so that might be the 4th
>> CHIP
>> > > > > (counting from 0), and the second GPIO (again, counting from 0)
>> > > > >
>> > > > > >>> divmod(97, 32)
>> > > > > (3, 1)
>> > > > >
>> > > > > P9_26 -> GPIO14, raw 96...
>> > > > >
>> > > > > >>> divmod(96, 32)
>> > > > > (3, 0)
>> > > > > >>>
>> > > > >
>> > > > > HOWEVER,
>> > > > > debian@beaglebone:~$ gpioinfo
>> > > > > gpiochip0 - 32 lines:
>> > > > > line 0: "MDIO_DATA" unused input active-high
>> > > > > <SNIP>
>> > > > > line 12: "UART1_CTSN" "P9_20" input active-high [used]
>> > > > > line 13: "UART1_RTSN" "P9_19" input active-high [used]
>> > > > > line 14: "UART1_RXD" "P9_26" input active-high [used]
>> > > > > line 15: "UART1_TXD" "P9_24" input active-high [used]
>> > > > > line 16: "GMII1_TXD3" unused input active-high
>> > > > >
>> > > > > indicates that it is CHIP0, and the "line" 14/15 map to the
>> GPIOxx (so
>> > > for,
>> > > > > say, GPIO45 it becomes chip 1, line 13)
>> > > > >
>> > > > > The gpioinfo command is provided by installing the gpiod package.
>> > > > >
>> > > > >
>> > > > > debian@beaglebone:~$
>> > > > >
>> /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -i
>> > > > > p9_26
>> > > > > Pin name: P9_26
>> > > > > Function if no cape loaded: gpio
>> > > > > Function if cape loaded: default gpio gpio_pu gpio_pd gpio_input
>> uart
>> > > can
>> > > > > i2c pru_uart pruin
>> > > > > Function information: gpio0_14 default gpio0_14 gpio0_14 gpio0_14
>> > > gpio0_14
>> > > > > uart1_rxd dcan1_tx i2c1_sda pru_uart pru1_in16
>> > > > > Kernel GPIO id: 14
>> > > > > PRU GPIO id: 46
>> > > > > debian@beaglebone:~$
>> > > > >
>> /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -i
>> > > > > p9_24
>> > > > > Pin name: P9_24
>> > > > > Function if no cape loaded: gpio
>> > > > > Function if cape loaded: default gpio gpio_pu gpio_pd gpio_input
>> uart
>> > > can
>> > > > > i2c pru_uart pruin
>> > > > > Function information: gpio0_15 default gpio0_15 gpio0_15 gpio0_15
>> > > gpio0_15
>> > > > > uart1_txd dcan1_rx i2c1_scl pru_uart pru0_in16
>> > > > > Kernel GPIO id: 15
>> > > > > PRU GPIO id: 47
>> > > > > debian@beaglebone:~$
>> > > > >
>> > > > >
>> > > > > (Unfortunately, that script doesn't tell one what "default" mode
>> IS
>> > > for the
>> > > > > pin, but does have more capability than the compiled config-pin
>> that
>> > > > > replaces it)
>> > > > >
>> > > > >
>> > > > > --
>> > > > > Dennis L Bieber
>> > > > >
>> > > > >
>> > > >
>> > >
>> > > --
>> > > Robert Heller -- Cell: 413-658-7953 <(413)%20658-7953>
>> <(413)%20658-7953> GV: 978-633-5364 <(978)%20633-5364>
>> > > <(978)%20633-5364>
>> > > Deepwoods Software -- Custom Software Services
>> > > http://www.deepsoft.com/ -- Linux Administration Services
>> > > hel...@deepsoft.com -- Webhosting Services
>> > >
>> > >
>> >
>>
>> --
>> Robert Heller -- Cell: 413-658-7953 <(413)%20658-7953> GV: 978-633-5364
>> <(978)%20633-5364>
>> Deepwoods Software -- Custom Software Services
>> http://www.deepsoft.com/ -- Linux Administration Services
>> hel...@deepsoft.com -- Webhosting Services
>>
>> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/5a236cfc-2e19-408b-b1e2-b80ef5e840d6n%40googlegroups.com
> <https://groups.google.com/d/msgid/beagleboard/5a236cfc-2e19-408b-b1e2-b80ef5e840d6n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAFfeaG8v%2BtUjRYDR2i8zm51Fw0cL-0xG%2BBgc7cgq1vtWT%3DpzUg%40mail.gmail.com.

Reply via email to