Skip to content

Commit

Permalink
Automatic catchup to commit 41958285b07c715ed7375b4d0db45feb7598f8f7
Browse files Browse the repository at this point in the history
4195828 Remove path that does not exist from mutilatorrc
209a0bd Backport of github commits
0e48fbf test_dcp: Fix set_ip_suite_count
6930de2 pf_cmina: Fix ARP response after factory reset
11942a9 ports: Remove side effects from CC_ASSERT calls
079abf3 Add evaluation readme
0ea545f Add initial mutilator configuration
7ee3ba8 Add jenkins file to repository
51d1643 Add i.MX8MM Getting Started Guide
d547e11 Adjust sample GSDML order no
6e9ede5 Point the cmake/tools submodule to the latest commit (with i.MX)
4d2026d Add i.MX8MM porting layer

Based-On-Commit: 41958285b07c715ed7375b4d0db45feb7598f8f7
Change-Id: Icb9dc31ade7c1a8dfdf94104a6266b763d4ed9ec
  • Loading branch information
rt-labs bot committed May 6, 2024
1 parent 8a14ce4 commit d4dc3b8
Show file tree
Hide file tree
Showing 8 changed files with 385 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Evaluation version

This repository contains an evaluation version of **P-Net**, a P-Net stack
for Profinet Device implementations. It is especially well suited for
embedded systems where resources are limited and efficiency is crucial.
It is written in C and can be run on an RTOS such as rt-kernel, FreeRTOS,
or on Linux.

It does not contain any ports and cannot be built without adding additional sources.

See [readme](../README.md) for more information on the complete version of the stack and the [releases](https://github.com/rtlabs-com/p-net/releases) for binary downloads for common targets.

This version of P-Net can be used for evaluation purposes
only. Contact <[email protected]> if you intend to use this stack in a
product or if you need assistance during evaluation. The commercial
version of this stack is supplied with full sources.
2 changes: 2 additions & 0 deletions requirements.jenkins.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gcovr
-r doc/requirements.txt
144 changes: 144 additions & 0 deletions requirements.jenkins.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.jenkins.in -o requirements.jenkins.txt
accessible-pygments==0.0.4
# via pydata-sphinx-theme
alabaster==0.7.16
# via sphinx
babel==2.14.0
# via
# pydata-sphinx-theme
# sphinx
beautifulsoup4==4.12.3
# via pydata-sphinx-theme
breathe==4.34.0
certifi==2024.2.2
# via requests
chardet==5.2.0
# via reportlab
charset-normalizer==3.3.2
# via requests
codespell==2.2.2
colorlog==6.8.2
# via gcovr
commonmark==0.9.1
# via recommonmark
docutils==0.17.1
# via
# breathe
# myst-parser
# pydata-sphinx-theme
# recommonmark
# rst2pdf
# sphinx
# sphinx-jinja
gcovr==7.2
graphviz==0.20.1
idna==3.7
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==7.1.0
# via rst2pdf
jinja2==3.1.3
# via
# gcovr
# myst-parser
# rst2pdf
# sphinx
# sphinx-jinja
lxml==5.2.1
# via gcovr
markdown-it-py==2.2.0
# via
# mdit-py-plugins
# myst-parser
markupsafe==2.1.5
# via jinja2
mdit-py-plugins==0.3.5
# via myst-parser
mdurl==0.1.2
# via markdown-it-py
myst-parser==0.18.1
packaging==24.0
# via
# pydata-sphinx-theme
# rst2pdf
# sphinx
pillow==10.3.0
# via reportlab
pydata-sphinx-theme==0.15.2
# via sphinx-book-theme
pyenchant==3.2.2
# via sphinxcontrib-spelling
pygments==2.17.2
# via
# accessible-pygments
# gcovr
# pydata-sphinx-theme
# rst2pdf
# rstcloth
# sphinx
pyyaml==6.0.1
# via
# myst-parser
# rst2pdf
# rstcloth
# sphinxcontrib-kroki
recommonmark==0.7.1
reportlab==4.2.0
# via rst2pdf
requests==2.31.0
# via
# sphinx
# sphinxcontrib-kroki
rst2pdf==0.99
rstcloth==0.5.3
smartypants==2.0.1
# via rst2pdf
snowballstemmer==2.2.0
# via sphinx
soupsieve==2.5
# via beautifulsoup4
sphinx==5.3.0
# via
# breathe
# myst-parser
# pydata-sphinx-theme
# recommonmark
# rstcloth
# sphinx-book-theme
# sphinx-copybutton
# sphinx-jinja
# sphinxcontrib-kroki
# sphinxcontrib-programoutput
# sphinxcontrib-spelling
sphinx-book-theme==1.0.1
sphinx-copybutton==0.5.1
sphinx-jinja==2.0.2
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-kroki==1.3.0
sphinxcontrib-programoutput==0.17
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
sphinxcontrib-spelling==8.0.0
tabulate==0.8.10
# via rstcloth
tomli==2.0.1
# via gcovr
typing-extensions==4.11.0
# via
# myst-parser
# pydata-sphinx-theme
urllib3==2.2.1
# via requests
zipp==3.18.1
# via importlib-metadata
9 changes: 9 additions & 0 deletions src/device/pf_cmina.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,15 @@ int pf_cmina_set_default_cfg (pnet_t * net, uint16_t reset_mode)
0,
sizeof (net->cmina_nonvolatile_dcp_ase.station_name));

/* Reset network interface */
pnal_set_ip_suite (
net->pf_interface.main_port.name,
&net->cmina_nonvolatile_dcp_ase.full_ip_suite.ip_suite.ip_addr,
&net->cmina_nonvolatile_dcp_ase.full_ip_suite.ip_suite.ip_mask,
&net->cmina_nonvolatile_dcp_ase.full_ip_suite.ip_suite.ip_gateway,
net->cmina_nonvolatile_dcp_ase.station_name,
true);

pf_file_clear (p_file_directory, PF_FILENAME_IP);
pf_file_clear (p_file_directory, PF_FILENAME_DIAGNOSTICS);
#if PNET_OPTION_SNMP
Expand Down
17 changes: 17 additions & 0 deletions src/drivers/drivers.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#********************************************************************
# _ _ _
# _ __ | |_ _ | | __ _ | |__ ___
# | '__|| __|(_)| | / _` || '_ \ / __|
# | | | |_ _ | || (_| || |_) |\__ \
# |_| \__|(_)|_| \__,_||_.__/ |___/
#
# www.rt-labs.com
# Copyright 2018 rt-labs AB, Sweden.
#
# This software is dual-licensed under GPLv3 and a commercial
# license. See the file LICENSE.md distributed with this software for
# full license information.
#*******************************************************************/
if (PNET_OPTION_DRIVER_ENABLE)
include( src/drivers/lan9662/driver.cmake )
endif()
42 changes: 42 additions & 0 deletions src/drivers/lan9662/add_mera_lib.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#********************************************************************
# _ _ _
# _ __ | |_ _ | | __ _ | |__ ___
# | '__|| __|(_)| | / _` || '_ \ / __|
# | | | |_ _ | || (_| || |_) |\__ \
# |_| \__|(_)|_| \__,_||_.__/ |___/
#
# www.rt-labs.com
# Copyright 2020 rt-labs AB, Sweden.
#
# This software is licensed under the terms of the BSD 3-clause
# license. See the file LICENSE distributed with this software for
# full license information.
#*******************************************************************/


cmake_minimum_required(VERSION 3.14)

# Attempt to find externally built mera library
find_package(mera QUIET)

if (NOT mera_FOUND)
# Download and build mera locally as a static library
# Todo: this is a private repo. Switch to public repo before release
message(STATUS "Fetch mera from github")
include(FetchContent)
FetchContent_Declare(
mera
GIT_REPOSITORY https://github.com/microchip-ung/rtlabs-mera
GIT_TAG b9d43d5
)

FetchContent_GetProperties(mera)
if(NOT mera_POPULATED)
FetchContent_Populate(mera)
set(BUILD_SHARED_LIBS_OLD ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "" FORCE)
add_subdirectory(${mera_SOURCE_DIR} ${mera_BINARY_DIR} EXCLUDE_FROM_ALL)
set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_OLD} CACHE BOOL "" FORCE)
endif()

endif()
154 changes: 154 additions & 0 deletions src/drivers/lan9662/driver.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
#********************************************************************
# _ _ _
# _ __ | |_ _ | | __ _ | |__ ___
# | '__|| __|(_)| | / _` || '_ \ / __|
# | | | |_ _ | || (_| || |_) |\__ \
# |_| \__|(_)|_| \__,_||_.__/ |___/
#
# www.rt-labs.com
# Copyright 2018 rt-labs AB, Sweden.
#
# This software is dual-licensed under GPLv3 and a commercial
# license. See the file LICENSE.md distributed with this software for
# full license information.
#*******************************************************************/

cmake_dependent_option (
PNET_OPTION_DRIVER_LAN9662
"Enable LAN9662 HW Offload driver" OFF
"PNET_OPTION_DRIVER_ENABLE" OFF )

if (PNET_OPTION_DRIVER_LAN9662)

option(PNET_OPTION_LAN9662_SHOW_RTE_INFO "Show RTE config log message" OFF)
set(PNET_LAN9662_MAX_FRAMES 2 CACHE STRING "Max active CPM and PPM instances")
set(PNET_LAN9662_MAX_IDS 16 CACHE STRING "Max subslots for a frame")

set(PNET_LAN9662_VCAM_BASE 2 CACHE STRING "LAN9662 VCAP base index")
set(PNET_LAN9662_RTP_BASE 4 CACHE STRING "LAN9662 RTP base index")
set(PNET_LAN9662_WAL_BASE 6 CACHE STRING "LAN9662 write action list base index")
set(PNET_LAN9662_RAL_BASE 8 CACHE STRING "LAN9662 read action list base index")

message(STATUS "LAN9662 pnet_driver_options.h configuration")
configure_file (
src/drivers/lan9662/pnet_driver_options.h.in
include/pnet_driver_options.h
)

message(STATUS "Add LAN9662 targets and configurations")

if(TARGET mera)
message(STATUS "LAN9662 mera lib found")
get_target_property(MERA_INCLUDES mera INCLUDE_DIRECTORIES)
else()
message(STATUS "LAN9662 mera lib not found - fetch repo")
include(src/drivers/lan9662/add_mera_lib.cmake)
get_target_property(MERA_INCLUDES mera INCLUDE_DIRECTORIES)
endif()

add_executable(pn_lan9662 "")
add_executable(pn_shm_tool "")

set_target_properties (pn_lan9662 pn_shm_tool
PROPERTIES
C_STANDARD 99
)

add_subdirectory (samples/pn_dev_lan9662)
add_subdirectory (samples/pn_shm_tool)

target_sources(profinet
PRIVATE
${PROFINET_SOURCE_DIR}/src/drivers/lan9662/src/pf_cpm_driver_lan9662.c
${PROFINET_SOURCE_DIR}/src/drivers/lan9662/src/pf_lan9662_mera.c
${PROFINET_SOURCE_DIR}/src/drivers/lan9662/src/pf_mera_trace.c
${PROFINET_SOURCE_DIR}/src/drivers/lan9662/src/pf_mera_trace.c
${PROFINET_SOURCE_DIR}/src/drivers/lan9662/src/pf_rte_uio.c
${PROFINET_SOURCE_DIR}/src/drivers/lan9662/src/pf_sram_uio.c
${PROFINET_SOURCE_DIR}/src/drivers/lan9662/src/pf_ppm_driver_lan9662.c
)

target_include_directories(profinet
PRIVATE
src/drivers/lan9662
src/drivers/lan9662/include
${MERA_INCLUDES}
)

target_link_libraries(profinet
PUBLIC
mera
)

install (
TARGETS mera
EXPORT ProfinetConfig
DESTINATION lib
)

target_include_directories(pn_dev
PRIVATE
src/drivers/lan9662
src/drivers/lan9662/include
)

target_include_directories(pn_lan9662
PRIVATE
samples/pn_dev_lan9662
src/drivers/lan9662
src/drivers/lan9662/include
src/ports/linux
)

target_sources(pn_lan9662
PRIVATE
samples/pn_dev_lan9662/sampleapp_common.c
samples/pn_dev_lan9662/app_utils.c
samples/pn_dev_lan9662/app_log.c
samples/pn_dev_lan9662/app_gsdml.c
samples/pn_dev_lan9662/app_data.c
samples/pn_dev_lan9662/app_shm.c
src/ports/linux/sampleapp_main.c
)

target_compile_options(pn_lan9662
PRIVATE
${APP_COMPILER_FLAGS}
)

target_link_options(pn_lan9662
PRIVATE
-Wl,--gc-sections
)

target_sources(pn_shm_tool
PRIVATE
samples/pn_shm_tool/pn_shm_tool.c
)

target_compile_options(pn_shm_tool
PRIVATE
${APP_COMPILER_FLAGS}
)

target_link_options(pn_shm_tool
PRIVATE
-Wl,--gc-sections
)

target_link_libraries (pn_shm_tool PUBLIC rt pthread)

file(COPY
src/drivers/lan9662/include/driver_config.h
src/drivers/lan9662/include/pnet_lan9662_api.h
DESTINATION include
)

file(COPY
src/ports/linux/set_network_parameters
src/drivers/lan9662/set_profinet_leds
DESTINATION
${PROFINET_BINARY_DIR}/
)

endif()
Loading

0 comments on commit d4dc3b8

Please sign in to comment.