Announcement

Collapse
No announcement yet.

How to list ttyACM ?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to list ttyACM ?

    Hi all,

    I'm trying to get a s/w IDE up and running to use with a small STM SBC. To do so I need to know which ttyACM the board is connected to. lsusb returns the following.

    ub@kub-SATELLITE-L870-18V:~$ lsusb
    Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 004: ID 04f3:0103 Elan Microelectronics Corp. ActiveJet K-2024 Multimedia Keyboard
    Bus 001 Device 003: ID 0bda:0138 Realtek Semiconductor Corp. RTS5138 Card Reader Controller
    Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 003: ID 0930:0219 Toshiba Corp. Bluetooth USB Host Controller
    Bus 003 Device 006: ID 0483:3748 STMicroelectronics ST-LINK/V2
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    kub@kub-SATELLITE-L870-18V:~$

    As you can see this does not show ttyACMs. So, how do I get the system todisplay which ttyACM is connected to which device ?

    Best regards,

    Stuart


    #2
    https://stackoverflow.com/questions/...ed-to-a-device

    try looking at dmesg to see some info:.
    Code:
    dmesg | grep tty
    or unplug the connection, wait a few moments, plug it back in and run
    Code:
    dmesg | tail

    Comment


      #3
      Hi claydoh,

      Thank you for such a swift reply. I sort-of followed your advice. First I entered "dmesg | tail" with the following result.

      kub@kub-SATELLITE-L870-18V:~$ dmesg | tail
      [ 61.897832] Bluetooth: RFCOMM TTY layer initialized
      [ 61.897844] Bluetooth: RFCOMM socket layer initialized
      [ 61.897860] Bluetooth: RFCOMM ver 1.11
      [ 92.566315] wlp2s0: authenticate with b0:73:5d:f6:64:5c
      [ 92.588044] wlp2s0: send auth to b0:73:5d:f6:64:5c (try 1/3)
      [ 92.591983] wlp2s0: authenticated
      [ 92.593665] wlp2s0: associate with b0:73:5d:f6:64:5c (try 1/3)
      [ 92.602537] wlp2s0: RX AssocResp from b0:73:5d:f6:64:5c (capab=0x431 status=0 aid=1)
      [ 92.602677] wlp2s0: associated
      [ 92.683636] IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0: link becomes ready

      I then repeated the command and got the following results.

      kub@kub-SATELLITE-L870-18V:~$ dmesg | tail
      [ 92.593665] wlp2s0: associate with b0:73:5d:f6:64:5c (try 1/3)
      [ 92.602537] wlp2s0: RX AssocResp from b0:73:5d:f6:64:5c (capab=0x431 status=0 aid=1)
      [ 92.602677] wlp2s0: associated
      [ 92.683636] IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0: link becomes ready
      [ 1498.876086] usb 3-2: new full-speed USB device number 4 using xhci_hcd
      [ 1499.025621] usb 3-2: New USB device found, idVendor=0483, idProduct=3748, bcdDevice= 1.00
      [ 1499.025626] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      [ 1499.025628] usb 3-2: Product: STM32 STLink
      [ 1499.025630] usb 3-2: Manufacturer: STMicroelectronics
      [ 1499.025632] usb 3-2: SerialNumber: R?nIpIH!E\xc2\x87

      As you can see, the system correctly found the device which seems to be using usb 3-2.

      Using Konsole I cd'ed into /dev and executed an ls -l. This showed that stlinkv2 was linked as follows.

      lrwxrwxrwx 1 root root 15 Apr 19 10:35 stlinkv2_2 -> bus/usb/003/004

      This also shoed many "ttynumber" and "ttySnumber" devces.

      Which ttyACM does usb 3-2 "translate" to ?


      Does Kubuntu use "ttySnumber" instead of "ttyACMnumber" ?

      Lastly, why does "dmesg | tail" show stlink as using usb 3-2 when "ls -l" shows stlink using usb 3-4 ?

      Best regards,

      Stuart

      Comment


        #4
        I have not idea. Kubuntu will behave like any other linux in this regard. Did you read all the comments in that page? There may be other things to look at. And the specific board you have may have certain requirements or need other things to emulate a serial port.

        Sent from my LM-V600 using Tapatalk

        Comment


          #5
          Also make sure you are usung a good data. USB cable.

          I don't think the usb connection info correlates to which tty is used. I *think* that is dependant on what ever chip in the device handles and sets up the port emulation.

          What about

          dmesg | grep tty

          Does this show anything?


          Also make sure you have the package stlink-tools installed. This provides various device udev rules so you shouldn't have to create your own and futz with permissions and groups. I wonder if this will help?
          More info on these tools : https://github.com/stlink-org/stlink
          This is available directly from ubuntu's repos, though the project has slightly more current debs available

          Sent from my LM-V600 using Tapatalk
          Last edited by claydoh; Apr 19, 2021, 05:02 AM.

          Comment


            #6
            Hi claydoh,

            Thank you for more swift responses.

            The USB cable in use is the one supplied by the board maker so it should "do the job".

            The command " dmesg | grep tty" gives the following output (with the board connected).

            kub@kub-SATELLITE-L870-18V:/dev$ dmesg | grep tty
            [ 0.093418] printk: console [tty0] enabled
            kub@kub-SATELLITE-L870-18V:/dev$

            What does tty0 have to do with THE ttyACM that I am trying to find out about ?

            I went to the tutorial on that github website where it stated that my /etc/udev/rules.d directory should contain all three files listed on the
            https://github.com/stlink-org/stlink...c/udev/rules.d website. However, on clicking that link all that happens is that a web page is displayed giving a 404 error.

            As I am unable to acess that webpage, how do I know if my /etc/udev/rules.d directory contains all the relevant files ?
            Currently my /etc/udev/rules.d drectory contains the following.
            kub@kub-SATELLITE-L870-18V:/etc/udev/rules.d$ ls
            49-stlinkv1.rules 49-stlinkv2-1.rules 49-stlinkv2.rules 49-stlinkv3.rules 99-jlink.rules
            kub@kub-SATELLITE-L870-18V:/etc/udev/rules.d$

            Best regards,

            Stuart

            Comment


              #7
              You can open the files in kate or kwrite, iirc the 49-stlinkv2.rules has rules for your device ID

              tty0 has zero to do with acm ttys, the command is just showing all the tty* in use in general.
              You probably need to find more device specific, or st-tools specific help in getting things working, this is quite out of my knowledge. Also note many instructions may assume that you don't have the tools installed or may not be distro-specific, and seem to assume a more in depth knowledge I don't have and can't decipher, at least not while I am working and without a similar device
              .. Anything Ubuntu related or Debian will be useful, unless someone with this sort of hardware happens to notice

              Comment


                #8
                Hi claydoh,

                Thank you for all your help. It is (!) very much appreciated. Perhaps, for the hardware specific details that I need , I need to find a linux hardware site. Thanks again.

                Best regards,

                Stuart

                Comment


                  #9
                  A general Linux or general Ubuntu support resource might still be useful, as well as Reddit, especially places with massive numbers of users, which may yield more with this sort of experience.
                  Last edited by claydoh; Apr 19, 2021, 03:17 PM.

                  Comment

                  Working...
                  X