industrialNETworXnetx

M T

M T

Hilscher Gesellschaft für Systemautomation mbH

| 10.06.2010 | 07:39 | 0 replies

FAQ: C-Toolkit

As several questions arise from time to time here is a short list of frequently asked questions:

Q: What can the C-Toolkit be used for?
A: The C-Toolkit is meant for driver developers who need to write drivers on a specific operating system to support cifX / comX Modules.

Q: What interfaces does the toolkit support?
A: The Toolkit supports PCI and parallel DPM (e.g. ISA/COMX) interfaces.Since V1.1.0.0 it is possible to use serial DPM interfaces, but special access functions must be provided by the user.

Q: The Distribution contains a Windows Sample Source Code. What can it be used for?
A: The Sample source code shows how a port to a different O/S may be done and is not meant as a driver replacement. It cannot be used without the cifX Device Driver, as user space applications may not access physical hardware.
ATTENTION: This sample can not download new firmware to a cifX PCI card, as this needs physical hardware access to PCI registers.

Q: Does the toolkit contain hardware specific functions (e.g. PCI Busscan)?
A: No. The toolkit only provides access functions to the dual ported memory offered by the netX chip and does not include any host specific code like PCI Busscan, etc. .

Q: Which compilers are supported?
A: There is no hard restriction on the compilers, but the Toolkit is prepared to work with Microsoft compilers, GNU GCC out of the box. Data packets sent to the firmware are defined inside structure and use byte packing functions (#pragma pack(1) or __attribute__((packed))). If your compiler does not support byte packing all packets which are aligned wrong won't work and you will need to modify the Toolkit source.
NOTE: Your compiler must provide the ISO C99 header file "stdint.h" (alternatively a user specific implementation) to provide fixed width data types.

Q: Are there any host Processor Restrictions?
A: The Toolkit supports little-/big-endian host processors (tested up to 64Bit). But the processors must provide 8/16/32 bit access to the dual-ported-memory area. NOTE: This has nothing to do with the physical bus width, but is the way the toolkit will access the DPM (e.g. ldr, ldrh, ldrb on ARM)

Q: How do I port the Toolkit?
A: The Toolkit is contained in the .zip-File under the "Source"-Folder. You will need to include these files into your driver/application. Additionally you will need to provide own implementation of "OS_" and "USER_" Functions described in the Toolkit manual. As a sample you can use those provided in "User" / "OS" Folder of the Windows sample. Now you need to introduce your hardware to the Toolkit by finding them on the PCI bus, or by adding them directly using the function cifXTkitAddDevice(). Afterwards the complete cifX Driver API is available. Depending on the used O/S some further implementation may be needed. This description only shows the rough way to do it

Q: Does the toolkit need an operating system?
A: The C-Toolkit relies on the existence of an operating system to synchronize multiple applications. It is possible to get the toolkit working in polling mode without a "real" operating system. For Interrupt mode an operating system is mandatory to provide events to signal an application.

Q: I only have a small microcontroller which can hardly use the toolkit. May I only use the hardware access functions and toggle the bits myself?
A: It is possible to only use the hardware access functions provided in "cifXHWFunctions.c". You will need to fill out a "DEVICEINSTANCE" structure yourself and call all "DEV_" functions from your driver/application. Note that when using this step the cifX API is not available anymore.

Regards,
MT

Login