14 Replies Latest reply on Jul 25, 2014 2:17 PM by stragen

    Galileo as Host for USB-To-UART-Adapter not working (ODROID-SHOW Display)

    stragen

      Hello,

      since this week i have the galileo.

      When i ssh into the galileo with official yocto linux on SD Card and connect a usb to uart device (CP210x on my Odroid-Show Display) its not showing a /dev/ttyUSB0 .

      Is always just a /dev/1-1 or with active hub /dev/2-1 and /dev/2-1.1 etc.

      The usb Client and upload over the IDE with /dev/ttyGS0 is working.

       

      When i type $dmesg it shows:

      [ 1564.060400] hub 2-0:1.0: unable to enumerate USB device on port 1

       

      What i tried:

      -newest firmware updated

      -already tried to make via mknod my custom /dev/ttyUSB0

      -tried to delete the ehci driver like they suggested here [Solved] Unable to enumerate USB device (Disabling ehci_hcd) | GeekDevs

      -someone mentioned somewhere its not enough current, but also tried an active usb hub

       

      Do you also have these problems or my usb host just defect and i have to order a new one?

        • 1. Re: Galileo as USB Host not working
          JPMontero_Intel

          Hi

           

          When you plug an USB drive to the USB Host it appears at /media as sda1, if you remove the USB it can be mounted in sdb, sdc, etc . What this means is you have to search for the devices under the /mount directory. Regarding the mouse or keyboard you have to run the dmesg command to see in which directory they are mounted, but I’m not sure how to enable them.

           

          Regards,
          JPMontero_Intel

          • 2. Re: Galileo as USB Host not working
            stragen

            Thank you for your fast response.

            Indeed the Galileo recognizes the mass storage as /dev/sda1, haven't seen that before. But to mount the device is not possible.

            But my main problem is with the "Odroid Show" en:odroidshow [Odroid Wiki] . The Display itself works under my windows and my ubuntu. in the console i just type for example:

            $stty -F /dev/ttyUSB0 500000 //first time for the baud rate

            $sudo echo -ne "text" > /dev/ttyUSB0

            but the yocto linux does not generate a ttyUSB0 for it.

            now i tried:

            $modprobe usbserial vendor=0x10c4 product=0xea60

            and it generates my wanted /dev/ttyUSB0. but to change the baud rate like before does not work(other commands for stty), nor does an echo create a cryptic text(what would happen on win/ubuntu with wront baud rate).

            Because other usb clients also don't really work on my galileo, i thought its maybe a general usb host problem.

            • 3. Re: Galileo as USB Host not working
              Rushang.Karia

              I have a working mouse on the galileo using /dev/event* and /dev/mouse*.

               

              Also are you connecting to USB HOST or USB CLIENT on the galileo. There are two usb ports besides each other. You will mostly be needing host and not client.

              • 4. Re: Galileo as USB Host for ODROID-SHOW Display not working
                stragen

                Thanks for your reply Rushang.Karia. I'm using the the micro-USB-A Slot titled "USB HOST" for my active Hub connected with the Display.

                I updated the title of my thread, because it seems to be a more special problem.

                I'm now using a second Galileo1 to verify my problem and its indeed the same.

                Because the display works with win8 and ubuntu it must be a problem with the yocto.

                Is there somehow the possibility to manually configure the usb device recognition in yocto without recompiling yocto myself?

                 

                Update:

                When i Plugin the Odroid Show Display on my ubuntu $dmesg gives me this:

                 

                [ 6577.596398] usb 1-2: new full-speed USB device number 3 using ohci-pci

                [ 6577.801495] usb 1-2: New USB device found, idVendor=10c4, idProduct=ea60

                [ 6577.801520] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3

                [ 6577.801537] usb 1-2: Product: CP2104 USB to UART Bridge Controller

                [ 6577.801552] usb 1-2: Manufacturer: Silicon Labs

                [ 6577.801567] usb 1-2: SerialNumber: 00875113

                [ 6578.681092] usbcore: registered new interface driver usbserial

                [ 6578.681154] usbcore: registered new interface driver usbserial_generic

                [ 6578.681202] usbserial: USB Serial support registered for generic

                [ 6578.702867] usbcore: registered new interface driver cp210x

                [ 6578.702916] usbserial: USB Serial support registered for cp210x

                [ 6578.702993] cp210x 1-2:1.0: cp210x converter detected

                [ 6578.872460] usb 1-2: reset full-speed USB device number 3 using ohci-pci

                [ 6579.102033] usb 1-2: cp210x converter now attached to ttyUSB0

                 

                So i need to get the cp210x converter to the galileo. Is this somehow possible to copy to the galileo linux without recompiling yocto, so that i still can use the Arduino Ide 1.5.3?

                • 5. Re: Galileo as USB Host for ODROID-SHOW Display not working
                  Rushang.Karia

                  Hi,

                   

                  Yes. If your dmesg log on the galileo already shows that the manufactor/device id was successfully detected and registered that is probably what I would do. I think the cp210x is a kernel configuration. I will check it out in my config file and let you know. If it is then you might need to recompile the kernel,

                   

                  Have you checked if it is possible to use libusb to interact with this display?

                   

                  A useful trick.

                  There is always something simple that I do to check if any new device that I attached got placed in dev directory.

                   

                  Before I attach the device :: ls /dev > old

                  After :: ls /dev > new

                   

                  diff new old

                   

                  This way I come to know if ./dev/ got changed.

                   

                  I'll do some research on your issue and let you know.

                  • 6. Re: Galileo as USB Host for ODROID-SHOW Display not working
                    stragen

                    I marked in bold that the upper $dmesg in my last post was on my ubuntu, that was maybe a bit misleading.

                    Don't know what the CP210x converter is: Maybe this CP210x Linux Driver ? And there also exists a driver written in c from the manufacturer USB to UART Bridge VCP Drivers | Silicon Labs

                    I'm relative new to linux and have no idea about the kernel compilation.

                    I'm also thinking about using libusb somehow for this, but didn't know if the Galileo will execute the program. But when you write it, i will try it next.

                    Thanks for helping me out on this and your trick is great, i was counting the entries before.

                     

                    Here is "$dmesg | grep usb" on Galileo:

                    [1.473164] pci 0000:00:14.2: calling quirk_usb_early_handoff+0x0/0x6c0
                    [1.473260] pci 0000:00:14.3: calling quirk_usb_early_handoff+0x0/0x6c0
                    [1.473574] pci 0000:00:14.4: calling quirk_usb_early_handoff+0x0/0x6c0
                    [4.051095] ACPI: bus type usb registered
                    [4.140708] usbcore: registered new interface driver usbfs
                    [4.241492] usbcore: registered new interface driver hub
                    [4.370514] usbcore: registered new device driver usb

                    [   44.872097] usbcore: registered new interface driver usb-storage

                    [   46.054537] usbcore: registered new interface driver btusb

                    [   46.100426] usbcore: registered new interface driver usbhid

                    [   46.106044] usbhid: USB HID core driver

                    [   98.030166] usb 1-1: new high-speed USB device number 2 using ehci-pci

                    [  117.030332] usb 1-1.3: new full-speed USB device number 3 using ehci-pci

                    [  360.737940] usb 1-1.3: USB disconnect, device number 3

                    [  410.400365] usb 1-1.4: new full-speed USB device number 4 using ehci-pci

                     

                    "$lsusb" says:

                    Bus 001 Device 002: ID 1a40:0101

                    Bus 001 Device 001: ID 1d6b:0002

                    Bus 002 Device 001: ID 1d6b:0001

                    Bus 001 Device 003: ID 10c4:ea60



                    "$diff new old" says:

                    --- new

                    +++ old

                    @@ -1,5 +1,4 @@

                    1-1

                    -1-1.4

                    block 

                    bus

                    char

                     

                     


                     

                    • 7. Re: Galileo as USB Host for ODROID-SHOW Display not working
                      Rushang.Karia

                      i am going to check out the kernel config file today to check if cp210x is enabled by default and I will let you know the process how to do it soon.

                       

                      Meanwhile if you want to play around learning how to compile a kernel for galileo here are the steps:-

                       

                      Requirements :: A BSP build ( Its okay if you dont have one but it will take 2-3 hours to build it)

                       

                      Steps:-

                      1. source the environment to be ready for bitbake ( source poky/en* yocto_build)

                      2. type bitbake linux-yocto-clanton -c menuconfig (This will give you a way to configure kernel options)

                      3. bitbake image-full

                       

                      If you are new to galileo and Linux,

                      Check out AlexT_Intels repositories and blogs for galileo, They are really good. Other good ones are sergeys blog and clayton hofcrocks webpage. You will learn a lot from these sources.

                       

                      Also try getting libusb to work. I think  it should be possible. Try it on ubuntu first.

                       

                      Another useful trick if you use apt-get. if you dont know the exact package name type half and press tab twice. it gives you a nice auto-completion

                      sudo apt-get install libusb { Press <tab> twice to show all the different available packages} and select the one like libusb-*-DEV

                      • 8. Re: Galileo as USB Host for ODROID-SHOW Display not working
                        stragen

                        I was able to compile the standard linux image(image-galileo-full).

                        Afterwards i just activated the needed driver cp210x via "bitbake linux-yocto-clanton -c menuconfig" and compiled again.

                        It marks it as <M>, because its part of another module now(dont know which one).

                        I hoped that it would work now, but still it doesn't know the device.

                        Do you have any idea?

                        • 9. Re: Galileo as USB Host for ODROID-SHOW Display not working
                          Rushang.Karia

                          The <M> means that it can be inserted as a module but is not loaded on default.

                          If you go that option and press <space bar> it will toggle between *, y, n Or M

                           

                          Y means that it is included as default ie statically linked. You might need to do that.

                           

                          Now if you want to know which drivers this driver depends on,

                           

                          modproble <driver_name> in the shell.

                          It will try to load the module and show you which ones are loaded before it in exactly that order

                          However you might need to find the .ko file where your module is located.

                           

                          the .ko files are there in /lib/kernel/linux-yocto-* /  I think

                          Navigate to them and do modprobe.

                          • 10. Re: Galileo as USB Host for ODROID-SHOW Display not working
                            stragen

                            Thanks for helping me again.

                            I tried it, but at the kernel config just <M> or [ ] is possible for CP210x.

                            When searching for the cp210x.ko file, i find a whole bunch of them in different paths of the meta-clanton subfolders.

                            Is there a way to manually say something like "take this cp210x.ko file for the usb device as driver" on the Galileo?

                             

                            On the other side im also still on the libusb code as alternative if the other way its not working.

                            Do i have to add the libusb somehow to the yocto compiler/bitbake thing?

                            I thought maybe to use the developer image from AlexT_Intel to compile my code on the Galileo, if libusb is installed.

                            Update:

                            I found out, that the libusb is not working for usb-to-uart adapters. usb supports no baud rate like an uart (which would be needed for the odroid-show) and so i have to use tty-interface somehow.

                            • 11. Re: Galileo as USB Host for ODROID-SHOW Display not working
                              Rushang.Karia

                              Is there a way to manually say something like "take this cp210x.ko file for the usb device as driver" on the Galileo?

                              There might be but I am not sure.

                               

                              If you want a really good way to port it then I suggest start with an arduino example. Make it run on the galileo using the arduino IDE and then look at the code and start the port process.

                              This makes it really simple to do stuff since you can easily get working arduino examples but not galileo specific FAQ.

                               

                              Let me know if you can get it working using arduino IDE and then perhaps I can look at the code and try to figure out something.

                              • 12. Re: Galileo as Host for USB-To-UART-Adapter not working (ODROID-SHOW Display)
                                stragen

                                I found a thread about another usb-to-uart driver problem: How to access USB host from Linux (Python)?

                                its about the ftdi driver, which is now already included in the dev image from AlexT-Intel. But i'm not able to use this information to find a solution myself.

                                 

                                Rushang.Karia wrote:

                                 

                                If you want a really good way to port it then I suggest start with an arduino example. Make it run on the galileo using the arduino IDE and then look at the code and start the port process.

                                This makes it really simple to do stuff since you can easily get working arduino examples but not galileo specific FAQ.

                                 

                                Let me know if you can get it working using arduino IDE and then perhaps I can look at the code and try to figure out something.

                                I don't understand your suggestion. You suggest, that i should control the display over arduino commands first? with which interface? the linux as operating system doesn't recognize the display, so its not possible i think.

                                • 13. Re: Galileo as Host for USB-To-UART-Adapter not working (ODROID-SHOW Display)
                                  Intel_Raad

                                  - Enable the driver at the Yacto build "bitbake -c menuconfig ...."

                                  - Copy the built image to SD card and boot Galileo from the new image

                                  - Check if the file /lib/modules/3.8.7-yocto-standard/kernel/drivers/usb/serial/cp210x.ko exists and load it using the command "modprobe"

                                  - Check for /dev/ttyUSB0

                                   

                                  If you want it to load during reboot then add to /etc/modules-load.quark/galileo.conf

                                  • 14. Re: Galileo as Host for USB-To-UART-Adapter not working (ODROID-SHOW Display)
                                    stragen

                                    Thank you Intel_Raad,

                                    today i also found the solution and it's like your answer.

                                    With this blog entry from AlexT_Intel (haven't found it before) i got it working:

                                    Reconfiguring Linux kernel and adding drivers into Galileo's Linux image

                                    Now where it is working, i think I will write a short introduction these days to introduce this display to others.