Implementing a new PROFINET device driver
- Define one of the compile switches
PSI_EDDS_CFG_HW_PACKET32,PSI_CFG_EDDS_AFPACKET,PSI_EDDI_CFG_SOCin the build configuration. - Implement a PROFINET device driver with all the functions described above in this section
-
- For EDDS link the Packet32 lower layer table in the structure
EPS_BOARD_EDDS_TYPE. - For EDDI set the corresponding memory sections, start parameter etc. in the structure
EPS_BOARD_EDDI_TYPE.
- For EDDS link the Packet32 lower layer table in the structure
-
Register/install the driver when
EPS_APP_INSTALL_DRV_OPEN()is called. - Set EDD dependent structures at
EPS_PNDEV_OPEN_FCT(see section EPS_PNDEV_OPEN_FCT)
Sample
See one of the EPS drivers such as "eps_wpcapdrv@PNDriver Windows" or "eps_pndevdrv@PNDriver Linux" in section Integration of an EDDS lower layer implementation into PN Device Driver.
Note
If you use a SIEMENS Ethernet adapter such as SOC1 or PNDevDriver as the Ethernet device driver, physically contiguous host memory is needed for fetching and storing Ethernet frames from and into host RAM via DMA. The memory is used for acyclic frames (called NRT memory in PN Stack) and cyclic IO data frames (called CRT memory in PN Stack).
On most OSes like Linux or Windows, this kind of memory can be
allocated only with prioritized access level, e. g. in kernel space.
For example, in PN Driver CP1625 Host example implementation, EPS
solves this problem by using the kernel-mode driver PNDevDriver. The
kernel-mode driver is called in the PN Device Driver. See
\pn_run\src\pnboards\eps\epssys\src\eps_pndevdrv.c.
On an embedded system where the systems integrator designs the memory layout, this memory can be set to a static region in the RAM using a linker file and linker symbols.