![]() Here is a small excerpt of the read method and the USB request complete handler. We have verified that the CP2102 works with Ubuntu versions 7.04 and 8.04. The complete code can be found on pastebin. Recent versions of the linux kernel include support for the CP2102 USB-to-UART Bridge Controller as part of the usb-serial driver, so your Pololu CP2102 should work right out of the box. Maybe someone has a clue what's going wrong here. My code follows the USB skeleton driver from Greg Kroah-Hartman who also reuse the "struct urb" for different reading requests. by allocating a new "struct urb" for each read request via usb_alloc_urb(.) (usually it is allocated once when probing the USB device). A PPS source can be connected to a serial port (usually to the Data Carrier Detect pin) or to a parallel port (ACK-pin) or to a special CPU's GPIOs (this is the common case in embedded systems) but in each case when a new pulse arrives the system must apply to it a timestamp and record it for userland. I can solve the problem by not reusing the "struct urb" but I would like to avoid that. The problem only occurs if the currently active instance is cancelled via "Ctrl + C". Both instances read out data alternatively. ![]() And also reusing the "struct urb" is working. I verified that the ideas are implemented correctly: I have run two instances of "cat /dev/ublox" simultaneously and I got the correct output (only one instance accessed the critical read section at a time). After submitting the USB read request, the calling process is sent to sleep until the asynchronous complete handler is called.Device-specific data like USB endpoint address and so on is held in a device-specific struct called ublox_device.The updated ftp login information is here as well as a linux explanation. ![]() To safe ressources, I reuse the struct urb for different reading requests (see an explanation) 10 posts CP2101 CP2102 CP210x Driver Download and Linux Details 5218 By sparky - Tue 3:01 pm For all those who are wondering about Linux support for the CP2102 USB to UART IC - this is the response I got from SiLabs.Therefore, I use a mutex to protect critical sections. The kernel module methods should be re-entrant.I use following ideas for my implementation: When the active/reading applications is cancelled via "Ctrl + C", the next reading attempt from the other application fails (exactly method call usb_submit_urb(.) returns -EINVAL). But, there is a problem when reading the device with multiple applications simultaneously (I used "cat /dev/ublox" to read indefinitely). I already can probe and read out data from the device successfully. I'm writing a Linux kernel module to read out a GPS device (a u-blox NEO-7) via USB by using the book Linux Device Drivers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |