Question about Process communication over USB cable - usb

I have some questions regarding communication over USB cable in Linux, in a Host-Target Device environment.(USB2.0) Please help as we are stuck for the below imiplementation.
We have a host PC connected to a target device (Linux OS) through USB cable.
On the target device we need to spawn 3 or 4 child processes. [Using fork() or some equivalent system call]
All the child process should communicate to the host PC independently though there own source file descriptor and sink file descriptors.
As per our experimentation, one process communicates to the PC at a time then the control is given to another process. But our requirement is for simultaneous communication. We are not sure whether USB driver(2.0/3.0) supports this methodology.
Any pointers regarding this will be helpful.
Thank you.
-AD

As per our experimentation, one process communicates to the PC at a time then the control is given to another process.
This is how computers work. Only one thread at a time has control of a particular CPU - when it blocks for i/o or exhausts its quantum, control is given to another thread.
What do you need simultaneity for that you can't manage with sending data one after the other?

USB is a serial bus protocol with a SINGLE DATA BUS, and this means, what you are looking for is not possible.
But we can have 4 different USB COMMUNICATION PIPES which can provide different paths, but NOT simultaneously.

Related

Is there a way to send two udp streams over a xen paravirtualized system taking separate routes over 2 VMs to the same destination computer?

I'm working on my second experiment for my master thesis and my supervisor had some requirements on this experiment and I don't really know how to proceed. Earlier I was thinking that it should be just to forward the packets but now facing the problem hands on I don't know where to begin.
The setup is Computer 1 ->Measurement point->System Under Test->Measurement point-> Computer2
The System Under Test consists of 2 VMs created with the XEN management tool XL.
There is a bridge from computer 1 on the interface "eth0" to "SUT" which is connected to the VM and the same thing on the otherside to computer 2.
I'm going to send 2 UDP streams and compare the timestamps over the measurement points with two servers on computer 2. The streams are going to be separated by port number and keyid for the stream.
My question is how do I make one of the UDP stream take the route through one of the VMs and the other UDP stream to take the other route?

Is I2C master to Master communication possible?

Is it possible for an I2C master device to communicate with another I2C master device ?
Thanks
Yes! As long as it specifies that it can do Multi Master operation, then it can communicate with another Master device. There is a clock synchronization procedure that two masters need to perform. To see how that works, read this PDF, section 4.3.1
I2C FPGA Core from Opencores
Yes it's possible..
But clock synchronization is important part.
Hope u go through above given PDF.

Is simultaneous I2C, SPI and USB communication between multiple MSP430s possible?

I have programmed a couple of MSP430x6xx microcontrollers to serve as Master for some I2C slave devices. One of the MSP430s transfer the data received from I2C slaves to a PC using its built in USB Module. I want to extend this to allow all Micro controllers to send data received from their respective I2C slaves to PC using a common bus system. Will it be feasible to use SPI for transferring the data from all MSP430s to a single MSP430 master(already serving as I2C master and USB device simultaneously) which then transfers it to PC? I would appreciate any other suggestions. Thanks
Yes, it is feasible we will have to write your firmware to handle this. You have to identify on the PC somehow from whom SPI/I2C slave it comes the data. So, your main MSP430xxx will do this adding some kind of header to the data saying the id of the slave device.

USB on Mac OS X

Is it possible to prorgramatically disable/ write protect the USB on MAC OS X ?. Also after a certain interval can it be enabled/ write be allowed. Any links/pointers would be appreciated.
EDIT -
I have been tasked to write a portion of software which will disable the USB drives on all the machines. This is for some customers who do not want their employees to take a USB and copy company sensitive information. But then for certain admins, the USB drives should get enabled by the admin.
It is my understanding that the write-protect tabs/switches on normally writable media physically disable the machine from being able to write to the media, so this oughtn't to be possible in software.
If you post more details on what you're trying to achieve, we might be able to offer some other suggestions.
For example, you might mount the volume as read-only, and after the time period has elapsed your software could change that to read-write access?
This functionality is already supported by the management frameworks on OS X. The simplest way to enable the restrictions would be with a Configuration Profile.
The drive policies only work with mountable volumes, so if you want more granular USB filtering you can use the iokit integration with launchd to specify things at a USB device level. Check this answer for more details on that approach. launchd LaunchEvents keys

USB EHCI: Help with transaction errors

One of our current milestones on our (open source) project at the moment is to complete USB support, and as such we're working hard on drivers at the moment. Our current development focuses on EHCI on both x86 and ARM (OMAP35xx SoC specifically, EHCI-only in the silicon of the board). We have mostly everything running smoothly in a variety of emulators - VMware (free and non-free versions), QEMU, and VirtualBox.
When we do testing on real hardware however, we get absolutely nowhere. The basic routine for device enumeration in our system goes something like this:
Turn on port power (if the option is available) and wait for power to stabilise to the device
Perform a port reset (held for 50 ms) and then wait as long as needed for the reset to complete (while loop)
If the port has a device present, and is enabled, notify the system that a new USB device is available for initialisation.
Send the SET ADDRESS command to assign an address to the device. This is where we run into problems everywhere:
The SETUP transaction for this command completes without error
The zero-length IN transaction (status phase) throws a transaction error, halts the qTD, and disables the port.
Our timing delays are basically the same as Linux's driver (if anything, longer).
According to the USB 2.0 specification, this behaviour is a "Port Error" (section 11.8) but to be completely honest I don't see how to translate its description of a port error into a working solution for our driver. As we are an open source project we also don't have the money to go out and purchase a proper hardware USB protocol analyser to investigate exactly what's going on on the line either.
Has anyone faced a similar problem and knows a solution?
We have identified the cause of this problem has been a timing issue, but in our case the issue was too much of a delay.
By modifying our qTD/QH creation code to create a single QH with multiple linked qTDs associated with it, we've been able to get successful runs on physical hardware.
We also had to use te EHCI 64-bit data structures, which had not been implemented previously.