Windows CE 6.0 - USB Drivers at boot up time - windows-ce

I built a new Windows CE image and placed two USB drivers. One for the USB printer and the second for some special device with digital and analog I/O ports.
I have one problem that came out with the drivers while the operating system boots up.
Every time the image boots up it asks to enter the driver's name. (The message is "Unidentified USB Device" Enter the name of the USB device driver) Is there a workaround for this problem ? What does I have to put into a registry?
I did not check if the driver is working after that because of my second problem
with the SQL CE 3.5 in my application.
The similar problem is happening if I not add a driver for example the Audio subsystem.
The OS at boot up scans the devices and finds some new hardware asking to fill the name for the driver.
It is simple to correct the second situation. I only have to check the item in the catalog view and rebuild the image. On behind the ragistry is filled with correct parameters but what am I supposed to do with custom drivers ?

The "Unidentified Device" dialog happens when the USB node is queried and no macthing driver in the OS is found. Which device, specifically, is causing that? You mention both a printer and an I/O device - knowing which device is causing the error will help narrow it down.
When you "added the drivers" to the OS, did you just add the driver binaries, or did you also add the relevant registry entries in the drivers section? Those entries depend on the specific driver, so I can't tell you exactly which keys and values you need.

Related

Can't log in to embedded Linux Buildroot

I'm looking to install Linux onto an Intel Galileo Gen 2 utilizing this and this via installing onto an SD card.
I believe I have successfully done this, as during the boot sequence I am able to select Linux to boot from, however as soon as it starts booting from Linux, I am unable to interact with the Galileo anymore by say typing in my username and password when it comes time to login.
I'm unsure if my peripheral setup is wrong, if I need to install some more drivers to support I/O or something else.
I am viewing the logs from the Galileo via an FTDI cable and currently have a keyboard plugged directly into the Galileo.
Log data
When I boot the Galileo, this is what is logged.
Interestingly, the
flashing cursor stops flashing and is just steady when I get to the
login screen, as if the device is sort of frozen
However if I then
say connect a keyboard, it recognizes it and outputs this log data.
Solved! Turns out it was a faulty FTDI cable!

How can I prevent linux from initializing a USB HID device

I have a USB HID device that can work in two different modes. The selection of modes is based on the sequence of USB enumeration/initialization packets sent to it.
I am using a Raspberry Pi 3 running Raspbian, however I also see the same issue if I compile my code for my desktop Ubuntu distro.
The issue I have is that linux is recognizing the USB device as a HID device and then sending the sequence of commands that it deems necessary to start the device, and this works correctly and starts the device in "Mode 1".
However I need to start the device in "Mode 2" and to do this I need to send a slightly different set of enumeration/initialization commands.
I am new to linux but very experienced with LibUSB and LibUSBDotNet under windows and can get the behavior I desire under windows.
Windows has similar behaviour to linux in that it will enumerate, recognise the device as a USB HID device and then initialise it as it deems fit resulting in the device going into "Mode 1". To prevent windows doing this I can create a LibUSB filter driver for the device, which then replaces the default driver, so windows will now do the initial enumeration, realise that the VID and PID of the device are managed by the LibUSB filter driver (rather than the windows HID driver) and then stop enumeration/initialization - this allows my code to take over and complete the initialization into "Mode 2".
How can I stop Linux from fully enumerating/initializing this device (as I do with windows). Perhaps I need to do something with udev rules or something, but I would have no idea what as I am new to linux.
Any help greatly appreciated
you have right, you have to play with the udev rules.
First of all you have to identify your device. Find the idProduct and the idVendor of your device. You can use:
lsusb
Then in the rules.d folder (/etc/udev/rules.d) create a new file with the name:
10-my-usb.rules
In this file add this line
SUBSYSTEM=="usb",ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="XXXX", MODE="666", GROUP+="plugdev"
Replace the XXXX with the value you get before
Then restart your udev rules:
sudo udevadm trigger
Then unplug and replug normally you can use it

Linux Virtual USB device driver

My goal is to create a virtual USB char device (not block device) for Linux 2.6.32 and above (I use debian squeeze) that would be recognize by the system.
I would like that this device be listed with lsusb as a normal USB device, and that every application could use libusb in order to open the device, and send control message, and make bulk write/read. But behind this virtual device, it's behavior would be set by my application. I want to set it's product ID, it's vendor ID, answer to USB status, and bulk read.
I've read some posts about how to use USB/IP in order to create a virtual USB device, and that's exactly what I want to do
Installation and emulation of virtual USB Device
http://breaking-the-system.blogspot.fr/2014/08/emulating-usb-devices-in-python-with-no.html
But unfortunately, when I tried with 2.6.32 kernel and above, I didn't succeed making it work. So I looked at how to create a kernel module that would create the virtual device :
http://pete.akeo.ie/2011/08/writing-linux-device-driver-for-kernels.html
This one looks great also, but the sample provided doest not indicate how to make it an USB device.
I've seen some post talking about it with windows but none that could help me with Linux.
I would like to avoid buying some USB programmable cards when it can be done with software.
Have anyone any leads on how to make the first methods works under newer kernel, or convert the sample code of the second method for making an USB device ?
I have fixed the code of http://breaking-the-system.blogspot.fr/2014/08/emulating-usb-devices-in-python-with-no.html (first method using USB/IP) to work with linux 4.3.
In the original code are missing USB requests like set configuration and get status. Without the implementation of all USB requests used for the OS driver the code will not work.
The fixed code can be downloaded in https://github.com/lcgamboa/USB-Emulation .
I guess raw-gadget kernel module is the thing that you want?
you can check the dummy_hcd and tests directory inside the repo, it will guide you how to create a virtual USB device

FTDI chip detection issue

I'm trying to do some transactions over serial ftdi interface to an ARM based board. On windows i'm able to detect it but when from virtualbox i'm unable to detect the same.
When i connect the same board to a linux sever box, it gets detected and gives me the port /dev/ttyuSB0. Any idea why Virtualbox does not detect?
By default, your VMs in VirtualBox can't see any of your 'real' hardware. You can "move" a USB device from the host to the guest. (Appears as a disconnect from the host, then a connect to the guest), but it's an odd two-step process:
When the VM isn't running, create a USB "filter" on your device.
Then, when it's running, sometimes it grabs it, and sometimes you must click the USB icon (at the bottom of your running VM window, next to your disk/CD/mouse indicators).
Make sure you have a recent version of VirtualBox. I think before 4.x, the USB support was not included in the free version. But I can confirm it works in 4.1.

How to use USB GPRS Modem on ARM - Windows CE 6.0?

I've been involved with a project where I have to install and use a USB GPRS modem on an ARM board (RSC-W910) with Windows CE 6.0 installed.
The modem is the Sierra Wireless product GL6110 (GL61x0) and I need to use it only for data, making HttpWebRequests (TCP) send/receive XML data. Prefered development tool is C# and .Net Framework 3.5.
When the modem is connected via USB to the board, the error message that appears is saying "Unidentified USB Device" which I believe its normal.
Siera Wireless(SW) provides a driver for ARM920, but it failed to install using 'wceload.exe'. The error was "Setup Failed" that I could see on the small LCD screen attached to the board. To install the driver I connect to the board via Telenet and CAB file is stored on SD card.
Am I right to think that the failure to install the driver could be related to the fact that the Win CE image has RAM-based Registry?
If SW does not provide a driver for the modem, could this mean that I have to develop my own driver? or is there a generic driver that I can use instead?
Will I have to create a new Win CE image for the board to support the modem, or is it possible to use code within the C# application to access it?
Any help will be very much appreciated!
Thanks,
Nick
There's no generic driver, no. Sierra modems generally have CE support (I'm not checked this model, but it's likely to work). What you need is:
A Driver DLL, build for ARM and for CE 6.0 or 7.0 (the CE 5.0 driver model differs, so a CE 5.0 driver probably won't work)
The registry entries the device.exe looks for when the device is enumerated
These sometime come in a CAB, sometimes not. Generally I prefer it when they don't but either will work.
If the CAB file fails to install, it's probably because it's marked for some other platform. I'd use something like WinZip or WinRAR to pull it apart, rename the DLL and extract the necessary reg entries (depends on the CAB format how easy/hard this will be).
Generally, though, you need to copy the driver DLL to the \Windows Folder, then apply the registry entries. Then when the device is plugged in, it will read the registry, which will point it to the DLL, which is then loaded. "Unidentified USB device" typically means the registry entries were not found.
This can all be done without rolling a new OS image, though sometimes a new image is simpler than doing the necessary copying at startup, especially if the device is plugged in at boot.

Resources