Vortex86DX Based Board for Robotics..

Hi All,

I have looked and searched, and have not had much luck in finding information to do what is needed for this board. I am hoping someone out there might have some insight into how to approach this scenario.

This board contains registers in PCI configuration space for accessing configuration for devices (SPI, PWM, Etc). This board isn’t plug and play, and it has no power management, no ACPI. The devices do not show in Device Manager.

I have read about the issues regarding CF8 and CFC being accessed from user mode, and am aware that hard system crashes are possible with this approach. That said, I have been able to access and control these registers in a way that has worked, but it is far from “correct”, as I have found from this forum.

I simply need to be able to access various control / setup registers of this device in PCI Configuratoin Space from User Mode code, through a driver, no buffering, just request / response, back to a .Net application. I’m not even interested in using the IRQ features of the devices, I think polling will be sufficient.

This is for a hobby (robotics), and not software I will sell or market. The driver software and register access code, I will likely pubish as freeware / open source. The vendor simply does not have Windows XP device drivers available. The device I’m using is a Roboard, info available at www.roboard.com (I am not affiliated with them in any way other than I bought one of their boards for personal use).

If someone can steer me in the proper direction, or perhaps even a code sample demonstrating what is needed for this type of driver, I can likely pick up and go from there.

If you need more information, let me know, I will be happy to elaborate.

Thanks!

on this board you have so many com ports and usb port also .

if you can access PCI configuration in firmware then
if u are aware about the firmware of board then its better that you use usb interface for reading/writing PCI register. using usb u can make simple protocol which will read/Write registers of PCI configuration.

for .net application com port will be best for h/w access. otherwise for other h/w interface you need to create one lib for accessing h/w driver interface.

if you want to access PCI configuration through expansion slot then u can refer PCI samples provided in WDK for pci drivers.

for .net application you need to create one lib(.dll) which will interact with ur driver and give result of read/write registers to user.

wrote in message news:xxxxx@ntdev…
> Hi All,
>
> I have looked and searched, and have not had much luck in finding
> information to do what is needed for this board. I am hoping someone out
> there might have some insight into how to approach this scenario.
>
> This board contains registers in PCI configuration space for accessing
> configuration for devices (SPI, PWM, Etc). This board isn’t plug and play,
> and it has no power management, no ACPI. The devices do not show in Device
> Manager.
>
> I have read about the issues regarding CF8 and CFC being accessed from
> user mode, and am aware that hard system crashes are possible with this
> approach. That said, I have been able to access and control these
> registers in a way that has worked, but it is far from “correct”, as I
> have found from this forum.
>
> I simply need to be able to access various control / setup registers of
> this device in PCI Configuratoin Space from User Mode code, through a
> driver, no buffering, just request / response, back to a .Net application.
> I’m not even interested in using the IRQ features of the devices, I think
> polling will be sufficient.
>
> This is for a hobby (robotics), and not software I will sell or market.
> The driver software and register access code, I will likely pubish as
> freeware / open source. The vendor simply does not have Windows XP device
> drivers available. The device I’m using is a Roboard, info available at
> www.roboard.com (I am not affiliated with them in any way other than I
> bought one of their boards for personal use).
>
> If someone can steer me in the proper direction, or perhaps even a code
> sample demonstrating what is needed for this type of driver, I can likely
> pick up and go from there.
>
> If you need more information, let me know, I will be happy to elaborate.
>
> Thanks!

Since the vendor does support WinXP for this board,
the best bet is to ask the vendor. You can’t be the first person who needs
to access
these functions.
Maybe they won’t provide you with ready .NET interface, but at the very
least
they should give a clue for a driver or native (c/c++) app.
Can you tell us what exactly they adviced? Have they told you to use cf8/fcf
ports?

– pa

Paras, interesting information, I think I understand, and will look into a few options there. I do need to use the PWM ports (24 in all, I will need 21) on board - I can’t add an outboard serial device for these functions, I just don’t have space for that. :slight_smile: I don’t have a need to access a device in the MiniPCI slot directly, just the functions integrated into the Vortex Chip.

Pavel, the vendor provides some libraries that ultimately use CFC / CF8 writes via WinIO, direct to the CF8 / CFC ports from the C++ source they provide for download. The source they provide gives some high-level capability, but doesn’t use any driver other than WinIO to talk direct to IO. I am interested in multithreading some functionality from managed .Net (VB actually), and their library isn’t really built for that. For example, they include some capability for moving RC Servos via PWM, but without accel / decel, or the ability to dynamically change movements in progress. To perform a move with their code, it’s a set-and-forget procedure that returns whenever the move is complete.

Others working with this board that I’m aware of have not achieved full utilization of all board features, let alone in a multithreaded context. Some are using Linux, few if any are using XP and .Net. Some wrapper libraries have been built for use with CSharp (and thereby VB), but they just wrap the C++ library that uses WinIO to write to CFC / CF8. Others are attempting to use the provided libraries, but I have yet to see a fully operational example utilizing several of the integrated devices at once. I have concern that Windows XP might interfere with my use of CF8 / CFC.

Access to the PCI Configuration registers is used while operational, for example, to switch a PWM pin driving a servo signal to Input mode to read a feedback pulse for position from the servo, then back to PWM.

So yes, they have told me to use CFC / CF8, but I am not convinced that this is the right way to access the hardware under XP. :wink:

Thanks!

>This board contains registers in PCI configuration space for accessing configuration for devices (SPI, >PWM, Etc). This board isn’t plug and play, and it has no power management, no ACPI. The devices >do not show in Device Manager.
The specification of the board says that it support PCI. Does the board contains internal PCI bus or the board could plug as a PCI device in PC? If it could be plugged in PC but you could not see it in Device Manager you should figure out why it happened. PCI devices should have PnP capability.
If for some reasons you could not use PCI interface you could also use serial, USB or Ethernet ports, which board contains, to communicate with PC. But in such cases you need to program the board. Either to use existing software or develop by yourself.

Igor Sharovar

This board is complete standalone PC, but does contain a Mini-PCI slot for add-on cards (I have used a VGA card, and eventually will use a WiFi card in this slot). The hardware I’m trying to access is all built in to the chip, and controls pins off the main chip (the Vortex86 is a “system on a chip”). The internal hardware I’m trying to access through the PCI Configuration Registers doesn’t present itself as plug and play devices to Windows XP. I guess you could say these devices inside the Vortex processor act as non-plug and play legacy devices.

>This board is complete standalone PC
Do you run XP on this board?

The internal hardware I’m trying to access through the PCI Configuration Registers doesn’t present >itself as plug and play devices to Windows XP.
Could you elaborate this? Are you going to get addresses of hardware by using PCI Configuration Register? I mean BARs. The configuration of BAR is part of PnP stuff. If PnP doesn’t work in your device I believe you could not get such information from BARs.

Igor Sharovar

wrote in message news:xxxxx@ntdev…

> Pavel, the vendor provides some libraries that ultimately use CFC / CF8
> writes via WinIO, direct to the CF8 / CFC ports
> from the C++ source they provide for download. The source they provide
> gives some high-level capability, but doesn’t use
> any driver other than WinIO to talk direct to IO. I am interested in
> multithreading some functionality from managed .Net
> (VB actually), and their library isn’t really built for that. For example,
> they include some capability for moving RC Servos via
> PWM, but without accel / decel, or the ability to dynamically change
> movements in progress. To perform a move with
> their code, it’s
>a set-and-forget procedure that returns whenever the move is complete.

Aha. So they do recommend the ports way and even provide driver and library.
Now your concern is how to ensure concurrent access from several threads,
correct?

Since this WinIO thing does not synchronize access to these PCI ports,
make your own wrapper around it, to handle serialization.
The lock may need to be hold for more than one library call; you’ll
need to determine granularity of locking from your application logic.

> Others working with this board that I’m aware of have not achieved full
> utilization of all board features, let alone in a
> multithreaded context. Some are using Linux, few if any are using XP and
> .Net. Some wrapper libraries have been built
> for use with CSharp (and thereby VB), but they just wrap the C++ library
> that uses WinIO to write to CFC / CF8. Others
> are attempting to use the provided libraries, but I have yet to see a
> fully operational example utilizing several of the
> integrated devices at once.

Nice! so there even are some examples of such wrappers, and more people
to help understanding the locking requirements.

> I have concern that Windows XP might interfere with my use of CF8 / CFC.

This is already in the responsibility area of the Vortex vendor.
From the XP perspective there is NO difference, how many user applications
access the CF8 / CFC ports. If one is ok, many - with your own sync - are ok
too.
( I’m somewhat puzzled how this works; perhaps all their on-chip
devices sit on internal bus, not affected by CF8 / CFC ports).

Regards,
– pa

> Access to the PCI Configuration registers is used while operational, for
> example, to switch a PWM pin driving a servo signal to Input mode to read
> a feedback pulse for position from the servo, then back to PWM.
>
> So yes, they have told me to use CFC / CF8, but I am not convinced that
> this is the right way to access the hardware under XP. :wink:
>
> Thanks!

> This board is complete standalone PC, but does contain a Mini-PCI slot for add-on cards

And it can be plugged to another PC as a PCI device? correct?


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

xxxxx@yahoo.com wrote:

Access to the PCI Configuration registers is used while operational, for example, to switch a PWM pin driving a servo signal to Input mode to read a feedback pulse for position from the servo, then back to PWM.

That’s a stupid hardware design. That’s not how PCI configuration space
was intended to be used.

So yes, they have told me to use CFC / CF8, but I am not convinced that this is the right way to access the hardware under XP. :wink:

Well, no, but if the device is not seen as a PnP device, and thus does
not provide an opportunity for you to attach a driver, there simply is
no alternative. There is no “blessed” way to access the configuration
space of another device.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Igor,

Yes, I run XP on this board. My intention is to build higher level capabilities using .Net, so XP fits. :slight_smile: Though Windows CE might be better, it’s not the same .Net Framework that I’m more comfortable with.

For I2C and Servo devices, there are “Base Address” registers that can be set to define a base address for functions that can then be accessed in IO space. Other registers must be read to obtain “default” base addresses (GPIO, SPI). Some devices are in the North Bridge, others in the South Bridge. Typical PCI Config Address Register values would be: 80003800h + (Addr AND FCh) for South Bridge, 80000000h + (Addr AND FCh) for North Bridge. These devices are never identified by XP through add new hardware, or searching, and no “Other Devices” entries in device manager.

Pavel,

You are correct, the register classes I have built in .Net thus far do exactly what you describe, they searlize calls to CF8 / CFC (ReadDWord / WriteDWord functions) within my application. The part I’m looking to replace would be the actual ReadDWord / WriteDWord functions that use WinIO for direct port access, in order to not conflict with other devices that may attempt to access PCI Configuration Space outside of my program by Windows XP itself.

I also am not clear on how the devices are connected internally, from what I have read so far, this is not a “normal” means of device control.

I would love to see a real driver for this board from the vendor, but I do not think that will happen, certainly not soon enough for me to move on with the code I have written so far. I do not believe what I’m trying to do has been done before, to utilize the board’s capabilities to the extent physically possible. I think up to now, people have been content with the capability provided with the library provided from the vendor- but it limits the possibilities. :wink:

Maxim,

No, it can not be plugged into a PCI slot. It contains a slot, but is not made to occupy a slot.

Tim,

Ok, it’s stupid… :slight_smile: But, it’s a 1ghz PC with Audio Line Out, Mic In, 24 pins of GPIO or PWM, 256 mb RAM, MicroSD for a hard drive, 8 channels A/D, serial ports (TTL, RS-232, RS485), USB, LAN, etc, all in a board that consumes 2W of power. It’s purpose built for what I want to do, and there is nothing out there that suits as well. Maybe incorrect regarding PCI device implementation, but it’s my only realistic option for this application. :wink:

Regarding accessing the device- that’s why I’m asking, wasn’t sure if there was a way to use some filter driver or some such to intervene somewhere in the PCI Config calls, some means that might work.

What sort of devices typically call out to CF8 / CFC during normal operation? I may make a monitor application just to read CF8 back to check for activity, that is probably my next step to understand if anything else is going to cause a problem.

THANKS!

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
>> This board is complete standalone PC, but does contain a Mini-PCI slot
>> for add-on cards
>
> And it can be plugged to another PC as a PCI device? correct?

No, it is a tiny SoC with connector for a mini PCI card. See the PDF on
their site.
But the question is about accessing some internal on-chip functions.

–pa

>Typical PCI Config Address Register values would be: 80003800h + (Addr AND FCh) for South >Bridge, 80000000h + (Addr AND FCh) for North Bridge.
If you already know a physical address you could use MmMapIoSpace to get a virtual address. This virtual address you could use to read memory.

Igor Sharovar

wrote in message news:xxxxx@ntdev…

> Typical PCI Config Address Register values would be: 80003800h + (Addr AND
> FCh) for South Bridge, 80000000h + (Addr AND FCh) for North Bridge.

Well, for some chipsets WIndows indeded maps PCI config space to “well
known”
memory addresses. If your system has such “well known” mapping, of course
it is better than these ports. A very simple kernel driver can access this
memory.

>These devices are never identified by XP through add new hardware, or
>searching, and no “Other Devices” entries in device manager.

Nothing surprisinhg here. As mentioned by Jake O. in
http://blogs.msdn.com/b/doronh/archive/2010/05/06/arbitration-and-translation-part-3.aspx



Good luck.
– pa