Raw data from USB - visual-c++

I haven't used Visual C++ before, however I'm starting a project that will require me to use it.
I want to get raw data from the USB. Almost every website tells me that I need to write a device driver for it first... Well I know that!
But I want to start simple - with my wireless mouse receiver, which obviously has a driver installed, which works. How can I access the contents which that receiver provides to the computer, using Visual C++?

This is a great project - a ton of fun too. Perhaps you can find some resources from this related post. I go into a lot more detail there. But I'll answer a little bit here too.
First off, you definitely don't want to write a driver. The time of writing drivers is mostly behind us. :) At least for what you are trying to do in particular. As I detail in the aforementioned post, we now mostly use HID descriptors to communicate with HID (usb) devices instead of writing drivers. This is awesome because it seriously simplifies the task.
I will highly recommend you or anyone in the same position use the libusbx library. It makes things very simple and straightforward in terms of communicating directly with HID devices. Again, see the post for a much more involved answer, but this should do it. Good luck!

Related

SuperCollider without jack server

One of the requirements in my project is to reduce runtime footprint on an embedded system. It looks like jackd is required on Linux and seem like it's currently a hard dependency and it cannot use libasound directly instead, is it true? It'd be also great to hear from someone who use jackd on an embedded device and could summaries it's resource usage. Although, I'm planing to use BeagleBone with relatively enough memory, I'd rather spare it for a longer delay line instead of running jackd.
Jack is definitely the standard way of doing it for SuperCollider on Linux. There is an AUDIOAPI flag in the cmake build settings - you can set -DAUDIOAPI=portaudio when you make your own build. (There's no direct libasound implementation; supercollider is cross-platform.) However, be warned that the portaudio approach is rarely used and might not even work at the moment. If you need help getting a build working, ask the sc-devel mailing list.
On the other hand I know people have run jack+supercollider on small ARM devices such as beaglebones. You might find it a better use of your time to go with the flow and use jack.

Make an usb video grabber driver

I have buy an usb video grabber on ebay but I haven't received an official device, it's a fake, and this one is the only one fake not supported by Linux. I would like to write the linux driver, but I have no knowledge on driver dev. Where can I find tutorial for driver dev learning on linux?
The device is an easycap dc60++, identified as fushicai usbtv007. More details here : http://linuxtv.org/wiki/index.php/Easycap#Known_Easycap_devices
It works on win7, so I can easily sniff usb protocol.
Thanks you in advance
IMHO, the best way to learn how to develop drivers for the kernel is to take an existing driver (best if it's from mainline) that is similar to what you want and look at how they're doing it. For function references, head to your favourite LXR site and search it up.
You could look up Linux driver development on Google and find some tutorials but I wouldn't recommend it for anything other than to get started since they're likely to be outdated or use deprecated kernel APIs.
Otherwise, there's always libusb if you don't want to get into the world of kernel driver development.
Good luck.
I made an experimental userspace driver for this device:
https://github.com/memeruiz/usbtv007
Hopefully somebody (or me) will take this and make a proper kernel driver for it.
I've made a driver for the device in question (https://lkml.org/lkml/2013/6/10/381). There's a big space for improvement and I'd be very glad if you could get involved.
The following documentation is helpful:
Linux Device Driver, third edition, book.
PDFs: http://lwn.net/Kernel/LDD3/
epub: http://v3.sk/~lkundrak/ldd3/
Video4Linux2 API: http://lwn.net/Articles/203924/
Videobuf2 API: http://lwn.net/Articles/447435/
When it comes to a good example, have a look at the drivers/media/usb tree, particularly the stk1160 driver.
I didn't yet have a look at Federico Ruiz's libusb driver for the device, but it seems he mostly figured out the same things as I did about the hardware. I suggest you take a look at it though, as I'll certainly do.
Also, linux-media list is probably a better place to ask questions like this. I've got here mostly by accident and there certainly are much more capable people on the list.
Have a great day!

Balanced processor/SOC (?) for small embedded system running linux

So, I know Linux kernel is quite "heavy" when considering lower scale embedded systems, but currently but we're a 2 man team trying to see how to create our own embedded system.
I'm the one in charge of all software (the other guy is a HW guy), and thus I would like to re-use existing libraries and frameworks as much as possible, and I would like to bounce off some ideas with gurus around here.
I am fairly comfortable in Linux, but the booting and initialization process is new to me, and I need to dive in to that soon enough. Any book recommendations are welcome as well!
I haven't designed any embedded systems before.. Only own some ARM dev boards (beagleboard and raspberry pi).
Current I have prototype of the software running on beagleboard already, and now we're thinking how to minimize the cost, and to create something our own..
It's a system connected to the internet, and I need to run a tiny web server with some scripting support. Performance wise I don't think it needs to be too powerful.
I would like to minimize all bootloader etc work, since I'm a one man SW team, and just concentrate on the application itself.
Of course I understand that I need to configure our kernel for this, but this is indeed why I thought selecting some SoC would be good, since they usually have some linux and bootloaders ready..
First I thought that Cirrus EP9301 would be perfect, since it seems to be a good package, and not very expensive.. But it seems that it's already in end-of-life, and also support for this is very bad (people on the cirrus forums constantly complain about it).
Are there some good choices for this kind of project, which would enable us "easily" to get linux kernel up and running, with still maintaining some kind of decent BOM (hopefully 20USD or so) ?
Your hardware guy should already know this, but go with an existing reference design. Take the raspberry pi, the beagleboard/bone, open-rd, or any number of other existing systems and clone the part you need. As a result the linux porting will be a matter of removing what you are not using from the reference design instead of adding new stuff and hoping it works. If you go with flat pack parts you can do the work in your garage, if you go with bgas you need the equipment for that or pay someone to do it. (can you tell yet that I hate bgas?).
Is linux a requirement, if not that opens the door to a lot more devices using freertos or chibios or a number of other solutions. the stm32f4 discovery board for example is $20, uses what can barely be called a microcontroller for all the features it has (cortex-m4). Supposedly possible to run uclinux on a cortex-m, but definitely possible to run any number of rtoses and have an ip stack, etc. stellaris (ti.com) has a number of eval boards, one/some with ethernet already (use as a reference design). You can also take the wiznet approach (or a spi ethernet) and use any microcontroller (puts you into the avr/msp430 level and price range). Bang for buck the cortex-m's are good, arm based so comfortable to work with, etc.
Using linux if you are already not an experienced at porting to an embedded platform, and dont want to learn that on this go around, I would definitely go with a clone of an existing design, leverage as much as you can from a project with folks that are experienced at porting linux to a platform. If need be take an existing board (beagle/raspi/openrd) and go through the motions of porting to the platform with the cheat sheet of having access to an existing port, see if you cant get uboot ported and linux booting, etc. (dont really need uboot at all, that is possibly an unnecessary complication, just get dram up and pass the atags, etc to linux and just branch to it, pretty easy to launch linux from bare metal).
You could probably do worse than taking the Broadcom BCM2835 - used on the Raspberry Pi - as your starting point - especially if you want to avoid kernel and boot-loader work and a source of reference schematics. If this proves too expensive, check out other devices in the Broadcom range.
A few bits of advice
You probably want some flash rather than a MMC card interface for production use. eMMC is an option. NAND flash is a nightmare due to rapid component obsolescence and the need to get own and dirty with the MTD drivers.
USB Ethernet will be easier to integrate than a controller hanging off a general purpose bus, but won't perform as well. SmSC seems to be popular source for either
You could also have a look at the work that Olimex is doing with their linux boards. Perhaps even order a som and then combine it with other external components.

NFC Chipset evaluation tool

I need to develope a NFC chipset evaluation tool. i need to connect the NFC board (that includes the NFC chip) to PC (running in Windows). then i need to get all the data of the chip to my PC using a software tool. this is the first time i am trying to do it. i need some advises regarding the first steps. i suppose, i would use a TCP-IP protocol to connect with the chipset. but how exactly it would work? for example, there is a USB-tester... http://www.vconsole.com/client/?page=page&id=13. my tool will be similar to this.
i also need to validate in the low level entry, for the framework.
i need to have a process description for the development of the tool. what are the steps?
thanks for your advices.
You cannot use TCP/IP over a USB/I2C connection. Most test boards come with software that you can use to connect to the board. What you are asking is a very broad question. If you are trying to write your own question, or hook it up to Excel to run tests with, you are progressing down a very time consuming path. People here are willing to help you figure out a question you are stuck on, but not to do all the hard work for you.
Like I said, you are starting on a BIG project, and will need to research A LOT. Then I'd recommend asking specific questions rather than very general questions.
As far as where to start, I'd start by writing down everything you want to know, and then start figuring out how to get each individual piece.

GPS navigation software/SDK for Linux

Is there a (open source or commercial) software solution available for the Linux platform to build a custom embedded navigation device? It should be able to display maps and do routing (just like a TomTom/Navigon/Garmin/... navi device).
Unfortunately all navigation solutions seem to target Windows CE only.
Something based on OpenStreeMap data is not an option, because the map data is IMHO not always good enough for serious routing / driving instructions.
Since I'm searching for a long time now without luck I'm not too restrictive on the implementation details, however it should be possible to extend the software with custom functions or ideally embed the navigation in my own software.
Android with Google Maps comes to my mind, but I'd like to avoid setting up Android for my device.
Alternatively, if there is no such solution, I might use a end-user navigation device if that allows me some kind of communication with my own device to control it.
I'm open for any suggestions, thanks..
There is a huge list here. Take a look if anything suites your needs.

Resources