PCI/PCIe card with DMA capability for device driver training - linux

I trying to learn DMA for device drivers with PCI/PCIe devices, and my platform is linux/bsd. I have found quite a few simple PCI boards for training (such as simple digital I/O boards), but none have hardware complex enough to handle DMA. Is anyone on Stackoverflow aware of a PCI/PCIe card with some sort of microprocessor or mcirocontroller that I could program with open-source tools like gcc (e.g. PowerPC, 68HC11, Atmel, 8051, etc.)??
Of course the kicker is low cost...sub USD 300.00 if possible.
I DO NOT WANT an FPGA-based board, because that requires a Windows workstation (usually) for programming the FPGA, as well as all of the time required for creating and working with a PCI/PCIe IP core in the FPGA. Basically, I don't want to spend my time working on the FPGA; I want to work on the device driver! This may be my only option though...

If you don't want to use FPGA, then you have to find a board that has enough info for you to be able to communicate with the PCIe interface of it. Not that many boards come with HW interface document, but if you want or can do this without documentation, you can use one of these boards:
Alibaba 4 Channel MIDI GAME port 3D
Same board on E-bay Alternative 2 on e-bay
You can also get a bit more advanced board like this one, but then you need to know how to communicate with their chipset.
Alibaba 4CH PCIe HDMI Video Capture Card here
If you change your mind for the FPGA, I would really recommend the Altera PCIe board that comes with a reference design and the bit file already per-programmed on the board. It is much more expensive than those, but the biggest benefit is that you have full documentation of the PCIe interface:
Altera Cyclone IV GX Transceiver Starter Kit
Here is the info about their reference design:
Altera PCIe reference design
Hope you find what you are looking for here.

Related

What considerations to make for selecting Bluetooth Chipsets for control of LED via PWM?

I am involved working on new hardware LED products where we are selecting a Bluetooth chipset to use in multiple products controlled by iOS and Android apps, for at minimum the next 3-4 years. Also I am not the developer, a third party will be contracted for this project.
As part of background research, I wanted to ask for feedback from Stack Overflow communities' experience with programming for Bluetooth, more specifically with custom firmware and GPIO PWM for LED?
What kind of challenges did you come across?
Are there any granular details or features to look out for with the hardware?
**Edit: based on first answer-
Requirements:
BLE 5
I do need OTA update capability
Chip size not big constraint, plastic enclosure can accommodate up to 1 inch/25mm or bit more easily.
Not high temp application
Single-chip solution, that will be programmed with our firmware, controlling 4x PWM Channels is ideal for our LED strips, avoiding separate MCU
Cost per unit (lowest average cost/unit)- important factor at volume, TBD
**Qualities I can not gauge well myself, being a designer and not an experienced programmer:
Ease of integration/support (lowest cost of development)
Quality of the chip manufacturer's software tools
Quality of the chips documentation
I have found some questions related with Raspberry Pi that seem generally helpful, but those questions don't help me with features or the support and documentation as related to BT SOCs.
**Edit: Yes I we are only considering BLE, and the NORDIC Semiconductor link I have included below are BLE and BT 5.
NORDIC chips are on my short list, they seem well supported and capable of 3x or 4x PWM channels for example nRF52832 Nordic nRF52832 Spec info. or the newer model RF5340. Does anyone have experience with them?
I really appreciate any answers regarding development considerations with Bluetooth.
I will edit & clarify if needed.
If you wish to support iOS Apps, a BLE device is necessary, BT classic requires a special apple license (for your product) to be able to connect with iOS Apps.
But other than that, your specifications dont really help to rule out ANY chip.
The first question that comes to mind is what other features do you
have already on your specification list that could be satisfied with
a common solution. I.e. if you also need WiFi, don't choose two
separate BLE/WiFi Chips, buy a chip that can do both (it's both
2.4GHz RF). If you need OTA updates for your firmware, choose a chip manufacturer with extensive and well documented tooling.
Consider special requirements:
Do you need a very small chip?
Does it need to be run at high temperatures (i.e. inside a light bulb)?
Do you need to run at ultra-low-power?
Does it need a high performance RF transceiver?
Decide whether you need a single-chip solution, that will be programmed with your firmware, or if your firmware will run on a dedicated microcontroller which is connected to the BLE chip.
Unless you have absolutely no special requirements to narrow down the selection, I'd base my decision along these criteria (not ordered):
Ease of integration (lowest cost of development)
Cost per unit (lowest average cost/unit)
Quality of the chip manufacturer's software tools
Quality of the chips documentation
GPIO-PWM Output should be possible with almost any programmable BLE chip.

How to send and receive bytes stream between PC and DE2 board

My school project is doing edge detection on DE2 board.
I'm looking for the way to send bytes stream from PC to DE2 board, and after doing edge detection, send data out back to PC.
Any help on general ideas?
Based on the description of the DE2 on the Altera website you have the following IO interfaces on the DE2 board:
Built-in USB-Blaster for FPGA configuration
Line In/Out, Microphone In (24-bit Audio CODEC)
Video Out (VGA 10-bit DAC)
Video In (NTSC/PAL/Multi-format)
RS232
Infrared port
PS/2 mouse or keyboard port
10/100 Ethernet
USB 2.0 (type A and type B)
Expansion headers (two 40-pin headers)
Of these there are 3 that are probably the most suitable for your purpose:
RS232
10/100 Ethernet
USB 2.0 (type A and type B)
Which one to use depends on your bandwidth / latency requirements, reliability, what sort of software interface you need, timescales, previous experience and level of interest.
RS232 should be easy to get working, there are UARTs available on OpenCores that will get you up and running but the bandwidth will be pretty awful.
Writing some RTL that communicates with the PC via Ethernet packets should be pretty straightforward if you assume the network is always reliable. Clearly if you want it to be robust you'll need to look into adding some reliability layer like RUDP.
Communicating via USB is probably the hardest interface from both the RTL and software end of the interface, however if you have an existing example design than you can modify to suit your purpose this might be the best option.
One other possibility worth considering is to embed a processor the Altera NIOS II in the FPGA like and let that handle the interface to your host. You could run a full Linux instance or a bare-metal stack with a dedicated TFTP to transfer data around. There are various examples and tutorials on the web that will help you get started.

HAL layer vs Device driver

In Linux, HAL provides hardware abstraction and device driver too provide hardware abstraction. Can you please clarify me the difference between two ?
The device driver communicates with a specific device at a specific buffer and control flag block location. A hardware abstraction layer abstracts away the details of how specific devices work. For example, the driver for a USB mouse is very different from the driver for a PS2 mouse but at the HAL layer they are both mice and can be treated interchangeably.
I would say that HAL provides hardware abstraction using device drivers. From a certain point of view, no device can work without a driver. HAL goes one step ahead, offering a uniform (or, "easier") API for the application.
You can bypass HAL and talk directly to the device driver, but you can not bypass the device driver and talk directly to the hardware (this last sentence is more or less valid in general, depending on OS and environment).
The main difference is what they provide abstraction for. HAL abstracts processors, device drivers abstract different devices. So in a sense HAL is the "device" driver of the processor or the motherboard in PCs.
Back in the day, every programmer who coded an app also codes drivers for the various hardware that they wanted to support. So, if you have an idea to develop an app which needs to use network capabilities, you also needed to know how to program hardware drivers for the network card. Then came in the HAL.
So instead of having your software and OS directly reaching out to the hardware, there is now a layer in between called the HAL. The HAL lies underneath the operating system layer or within.
Now nobody is allowed to access the hardware, except that they do it through and by the hardware abstraction layer(HAL). Just the HAL is allowed to access the hardware.
Now it's something which is standard. All Devs have to do is make the game/app work with the HAL.
Now we have the drivers. The drivers tell the HAL how to access the actual hardware.
So whoever makes the sound card, they just make a driver that tells the HAL how to access that sound card.
So overall, our software interacts with the HAL, The HAL uses drivers to interact with the hardware. We are telling the HAL how to access that sound card or network card etc. with the use of the drivers.

Cheap development board for Windows CE

I'm looking for a development board for WinCE, preferably with the following connectors:
VGA/DVI for screen
USB for kb/mouse
Ethernet (10Mbit is OK, 100 would be even better ;-) )
Storage (eg: SD/MMC/CF cards)
I'm looking for this, because I want to attend the Imagine Cup , Embedded Systems design. And I'm looking for a challenge, ofcourse ;-).
I found a board called HawkBoard (http://www.hawkboard.org), but I want to know if there are alternatives for about the same price (max $200 incl. shipping/customs/taxes). I need the BSP, ofcourse ;-).
Thanks!
Yvan
The eBox 2300/3300 is a low cost device that has been used for past Imagine Cup challenges. It's x86, comes with a BSP, is in an enclosure, is low cost ($195 or $255) and meets most of your needs.
Of course CE has forever shipped with a reference BSP for x86, so you can usually get just about any x86 device working, though most other devices tend to be pretty big physically.
There are also open source CE BSPs available for the BeagleBoard and GumStix.
The BeagleBoard is a good ARM system that costs $150. It has all the features you want, from the product page:
DVI-D for connecting digital computer monitors
Compatibility with a huge collection of USB peripherals including hubs, keyboards, mice, WiFi, Bluetooth, web cameras, and much more
MMC+/SD/SDIO interface for memory or wireless connectivity
S-Video out for connecting your NTSC or PAL television or wearable visor
Stereo audio in and out for a microphone and headphones or speakers
Power via typical USB chargers for cell phones from your laptop, from an automobile adapter, from batteries, or even from a solar backpack
I never tried Windows CE myself, but a google search suggests it's possible, and there's even a video on YouTube.
Another option is Gumstix, and there's a project on codeplex to help you get Windows CE on it.
I guess it also depends if you want to start something for fun or rather serious.
Check some of the big manufacturers homepages too, so you can see what specifications could
help the realisation of your ideas or set limits to them.
What helps for shure is if you choose a platform, that can be configured easily and its much more fun if you start with something that can work out of the box too.
Here an example, like you can find it on a lot of manufactureres homepages on the web.
http://www.toradex.com/En/Products/Colibri
Colibri modules feature state of the art technology, and aimed at low power systems that require high CPU performance. They are equipped withall the interfaces needed in a modern embedded device.
Colibri T20 features include:
· Dual Core ARM Cortex A9 Processor
· 2 x 1.0GHz Processor Speed
· Full HD 1080p Video (Encode / Decode)
· Powerful 3D Rendering Performance
· True Dual Display
· Up to 12 Megapixel Camera Sensor Support
And if this is to much there are Colibri modules in the family which are in a lower price range with adapted specifications that might fit you needs better.
What I personally think is important, that you know that you can get good support and talk to the right people in person as well.
Give it a shot and good luck.
Regards
Any old PC that has a video adapter that is VESA compliant and a network adapter based on NE2000, realtek RTL8139 or 3COm 3Cx5 can be used as Windows CE target device using the CEPC BSP.
If you have an old 486 or more powerful PC lying unused somewhere in your garage, it's time to resurrect it! :)

Bluetooth UUID discovery

Does anyone know how a bluetooth device could pick up the discoverable devices' device IDs in range?
I am ideally looking for the simplest solution that involves the smallest implimentation of the bluetooth protocols.
A starting point would be good, I just wish to create a device that can store all the device ids of nearby bluetooth devices with minimal power consumption, preferably just using radio frequencies and not SDP and whatever else.
If you can't help me with this, please can you help me find good reading material for low level bluetooth (step by step) communication. The reading online is so high level that I cant work out what is actually sent, when.
Laalto nailed the answer from the Bluetooth spec/stack POV, but your question implies your looking for a stand-alone Bluetooth device - not just a laptop app scanning surrounding devices.
I can only speak for the BT chips that the company I work for manufactures (Cambridge Silicon Radio - CSR) but our chips can do that pretty much out of the box. Our chips have an on-board Virtual Machine sandbox that allows access to the firmware functions and Bluetooth stack of the chip. You can easily write a C code app to run in the virtual machine sandbox, on chip, that periodically scans for discoverable devices around, grab their ids and then download them when connected via USB or Serial, or maybe over BT when a device connects to the listener directly.
www.csr.com and www.csrsupport.com for chips, dev-kits, design references, etc.. etc...
You probably want a module with the extra HW (UARTs, USB etc...) as well as just the chip but you could implement this with something the size of a BlueTooth USB or probably smaller.
It would really help to know more about what your trying to achieve, why you want something that just scans the surrounding bluetooth devices and how big the device needs to be.
Sorry if this sounds like advertising. For balance: Broadcom make BT chips too!
The Bluetooth specs from http://www.bluetooth.org are a good starting place for low-level information. You need an account to access the specs, but you can create one for free.
Basically what you need to do is to go into Inquiry mode periodically and grab the response packets as they arrive. The more time you spend in Inquiry mode, the more likely you will discover devices in range: discoverable devices enter the Inquiry Scan mode only relatively rarely; it takes some time (10.24s at least with older Bluetooth versions) to scan all the possible frequencies in the Inquiry/Inquiry Scan frequency hopping schemes. And even then you can have suboptimal radio conditions.
For implementation I suggest you at least start with existing Bluetooth libraries such as BlueZ and do not attempt to create your own from scratch.

Resources