diff --git a/profinet_stack/osal/CMakeLists.txt b/profinet_stack/osal/CMakeLists.txt index 9b0bce4..1deec0a 100644 --- a/profinet_stack/osal/CMakeLists.txt +++ b/profinet_stack/osal/CMakeLists.txt @@ -21,9 +21,10 @@ project (OSAL VERSION 0.1.0) message("CMakeList.txt: Starting...") if (DEFINED BOARD) - if ( (NOT (${BOARD} STREQUAL "am5718-idk")) AND (NOT (${BOARD} STREQUAL "BeagleBoneAI"))) + if ( (NOT (${BOARD} STREQUAL "am64xx-evm")) AND (NOT (${BOARD} STREQUAL "am5718-idk")) AND (NOT (${BOARD} STREQUAL "BeagleBoneAI"))) message(FATAL_ERROR "BOARD ${BOARD} unsupported!\n" "BOARD can take the following values:\n" + " -- am64xx-evm\n" " -- am5718-idk\n" " -- BeagleBoneAI") else() @@ -65,12 +66,12 @@ configure_file ( ${OSAL_BINARY_DIR}/src/version.h ) #------------------------------------------------------------------------ -# Путь к папке с библиотеками +# пїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ set(INSTALL_PATH ${CMAKE_SOURCE_DIR}/../../libs) -# Путь куда будут копироваться собранная библиотека +# пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ set(INSTALL_PATH_LIB ${INSTALL_PATH}/lib) -#BOARD задается в параметрах запуска cmake, прописано в .vscode/settings.json +#BOARD пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅ cmake, пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅ .vscode/settings.json if (DEFINED BOARD) set(SITARA_DEPOT ${CMAKE_SOURCE_DIR}/../../sitara_depot) set(INSTALL_PATH_LIB ${INSTALL_PATH_LIB}/arm_a15/${BOARD}) @@ -80,7 +81,7 @@ else() set(INSTALL_PATH_LIB ${INSTALL_PATH_LIB}/x86_64) message(STATUS "Building for x86") endif() -# Путь куда будут копироваться h-файлы +# пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ h-пїЅпїЅпїЅпїЅпїЅ set(INSTALL_PATH_INC ${INSTALL_PATH}/include) #------------------------------------------------------------------------ @@ -88,9 +89,9 @@ set(INSTALL_PATH_INC ${INSTALL_PATH}/include) # Add platform-dependent targets early, so they can be configured by # platform -# Имя библиотеки +# пїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ set(LIB_NAME osal) -# Для отладочной версии в конце добавляем d: osald +# пїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ d: osald if (CMAKE_BUILD_TYPE STREQUAL Debug) set(LIB_NAME ${LIB_NAME}d) endif() diff --git a/profinet_stack/osal/CMakePresets.json b/profinet_stack/osal/CMakePresets.json index 78891a4..211ea5b 100644 --- a/profinet_stack/osal/CMakePresets.json +++ b/profinet_stack/osal/CMakePresets.json @@ -78,7 +78,32 @@ "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } + }, + { + "name": "am64xx_Debug", + "inherits": "default", + "displayName": "am64xx Debug", + "description": "Degub build for am64xx-evm board(arm cortex-a53)", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_TOOLCHAIN_FILE": "${workspaceFolder}/../../sitara_depot/compile/toolchain.cmake", + "BOARD": "am64xx-evm" + }, + "environment": { + "ENV_TARGET_CROSS_COMPILE_PREFIX": "/opt/ti-processor-sdk-linux-am64xx-evm-09.02.00.08/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-", + "ENV_TARGET_SYSTOOT_PATH": "/opt/ti-processor-sdk-linux-am64xx-evm-09.02.00.08/linux-devkit/sysroots/aarch64-oe-linux" + } + }, + { + "name": "am64xx_Release", + "inherits": "am64xx_Debug", + "displayName": "am64xx Release", + "description": "Release build for am64xx-evm board(arm cortex-a53)", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } } + ], "buildPresets": [ @@ -105,6 +130,14 @@ { "name": "BeagleBoneAI Release", "configurePreset": "BeagleBoneAI_Release" - } + }, + { + "name": "am64xx Release", + "configurePreset": "am64xx_Release" + }, + { + "name": "am64xx Debug", + "configurePreset": "am64xx_Debug" + } ] } \ No newline at end of file diff --git a/profinet_stack/p-net/CMakeLists.txt b/profinet_stack/p-net/CMakeLists.txt index d9c35bd..3b5aabb 100644 --- a/profinet_stack/p-net/CMakeLists.txt +++ b/profinet_stack/p-net/CMakeLists.txt @@ -21,9 +21,10 @@ project (PROFINET VERSION 0.2.0) message("CMakeList.txt: Starting...") if (DEFINED BOARD) - if ( (NOT (${BOARD} STREQUAL "am5718-idk")) AND (NOT (${BOARD} STREQUAL "BeagleBoneAI"))) + if ( (NOT (${BOARD} STREQUAL "am64xx-evm")) AND (NOT (${BOARD} STREQUAL "am5718-idk")) AND (NOT (${BOARD} STREQUAL "BeagleBoneAI"))) message(FATAL_ERROR "BOARD ${BOARD} unsupported!\n" "BOARD can take the following values:\n" + " -- am64xx-evm\n" " -- am5718-idk\n" " -- BeagleBoneAI") else() @@ -179,12 +180,12 @@ configure_file ( ) #------------------------------------------------------------------------ -# Путь к папке с библиотеками +# пїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ set(INSTALL_PATH ${CMAKE_SOURCE_DIR}/../../libs) -# Путь куда будут копиороваться собранная библиотека +# пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ set(INSTALL_PATH_LIB ${INSTALL_PATH}/lib) -#BOARD задается в параметрах запуска cmake, прописано в .vscode/settings.json +#BOARD пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅ cmake, пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅ .vscode/settings.json if (DEFINED BOARD) set(SITARA_DEPOT ${CMAKE_SOURCE_DIR}/../../sitara_depot) set(INSTALL_PATH_LIB ${INSTALL_PATH_LIB}/arm_a15/${BOARD}) @@ -195,7 +196,7 @@ else() message(STATUS "Building for x86") endif() -# Путь куда будут копироваться h-файлы +# пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ h-пїЅпїЅпїЅпїЅпїЅ set(INSTALL_PATH_INC ${INSTALL_PATH}/include) set(OSAL_NAME osal) @@ -210,9 +211,9 @@ endif() # Add platform-dependent targets early, so they can be configured by # platform -# Имя библиотеки +# пїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ set(LIB_NAME profinet) -# Для отладочной версии в конце добавляем d: osald +# пїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ d: osald if (CMAKE_BUILD_TYPE STREQUAL Debug) set(LIB_NAME ${LIB_NAME}d) endif() diff --git a/profinet_stack/p-net/CMakePresets.json b/profinet_stack/p-net/CMakePresets.json index 78891a4..49af364 100644 --- a/profinet_stack/p-net/CMakePresets.json +++ b/profinet_stack/p-net/CMakePresets.json @@ -78,7 +78,31 @@ "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } - } + }, + { + "name": "am64xx_Debug", + "inherits": "default", + "displayName": "am64xx Debug", + "description": "Degub build for am64xx-evm board(arm cortex-a53)", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_TOOLCHAIN_FILE": "${workspaceFolder}/../../sitara_depot/compile/toolchain.cmake", + "BOARD": "am64xx-evm" + }, + "environment": { + "ENV_TARGET_CROSS_COMPILE_PREFIX": "/opt/ti-processor-sdk-linux-am64xx-evm-09.02.00.08/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-", + "ENV_TARGET_SYSTOOT_PATH": "/opt/ti-processor-sdk-linux-am64xx-evm-09.02.00.08/linux-devkit/sysroots/aarch64-oe-linux" + } + }, + { + "name": "am64xx_Release", + "inherits": "am64xx_Debug", + "displayName": "am64xx Release", + "description": "Release build for am64xx-evm board(arm cortex-a53)", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } ], "buildPresets": [ @@ -105,6 +129,14 @@ { "name": "BeagleBoneAI Release", "configurePreset": "BeagleBoneAI_Release" - } + }, + { + "name": "am64xx Debug", + "configurePreset": "am64xx_Debug" + }, + { + "name": "am64xx Release", + "configurePreset": "am64xx_Release" + } ] } \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 14c83a9..1aa75d2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,9 +5,10 @@ project (PROFINET_IO_DEV VERSION 0.0.1) message("CMakeList.txt: Starting...") if (DEFINED BOARD) - if ( (NOT (${BOARD} STREQUAL "am5718-idk")) AND (NOT (${BOARD} STREQUAL "BeagleBoneAI"))) + if ( (NOT (${BOARD} STREQUAL "am64xx-evm")) AND (NOT (${BOARD} STREQUAL "am5718-idk")) AND (NOT (${BOARD} STREQUAL "BeagleBoneAI"))) message(FATAL_ERROR "BOARD ${BOARD} unsupported!\n" "BOARD can take the following values:\n" + " -- am64xx-evm\n" " -- am5718-idk\n" " -- BeagleBoneAI") else() @@ -39,10 +40,10 @@ if(DEFINED BOARD) include(${SITARA_DEPOT}/compile/sitara_compile_flags.cmake) endif() -# убирает предупреждения nlohman json о GCC7.1 +# пїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ nlohman json пїЅ GCC7.1 add_compile_options(-Wno-psabi) -#Если не собирается с ошибкой линкера undefined reference pthread, то добавить флаг линкера: +#пїЅпїЅпїЅпїЅ пїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅ undefined reference pthread, пїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅ: #add_link_options(-lrt) add_executable(${TARGET_NAME} ./main.cpp ${SRC_FILES}) @@ -60,13 +61,17 @@ elseif(CMAKE_BUILD_TYPE STREQUAL Release) set(LIB_LIST profinet osal ${Boost_LIBRARIES}) endif() -# убирает предупреждения nlohman json о GCC7.1 +# пїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ nlohman json пїЅ GCC7.1 add_compile_options(-Wno-psabi) set(LIB_ARCH_DIR x86_64) if(DEFINED BOARD) - set(LIB_ARCH_DIR arm_a15) + if(${BOARD} STREQUAL "am64xx-evm") + set(LIB_ARCH_DIR arm_a57) + elseif() + set(LIB_ARCH_DIR arm_a15) + endif() endif() set(LINK_PATH ${LIBS_INSTALL_PATH}/lib/${LIB_ARCH_DIR}) @@ -77,10 +82,10 @@ endif() target_link_directories(${TARGET_NAME} PUBLIC ${LINK_PATH}) -#Если не собирается с ошибкой линкера undefined reference pthread, то после ${Boost_LIBRARIES} добавить pthread или -lpthread: +#пїЅпїЅпїЅпїЅ пїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅ undefined reference pthread, пїЅпїЅ пїЅпїЅпїЅпїЅпїЅ ${Boost_LIBRARIES} пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ pthread пїЅпїЅпїЅ -lpthread: #target_link_libraries (${TARGET_NAME} PUBLIC profinet osal ${Boost_LIBRARIES} pthread) -# Для BeagleBoneAI: версия GCC8 нужно указывать stdc++fs(библиотека ) +# пїЅпїЅпїЅ BeagleBoneAI: пїЅпїЅпїЅпїЅпїЅпїЅ GCC8 пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ stdc++fs(пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ ) if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9) set(LIB_LIST ${LIB_LIST} stdc++fs) endif() @@ -93,13 +98,13 @@ install( ) install(FILES - # Копирование заглушки скрипта установки параметров сети. - # Если не копировать, то в недрах pnet после fork вызовется exit и - # вызовутся деструкторы объектов, что может привести к непредвиденным последствиям. + # пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅ. + # пїЅпїЅпїЅпїЅ пїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ, пїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅпїЅ pnet пїЅпїЅпїЅпїЅпїЅ fork пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ exit пїЅ + # пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ, пїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ. ${CMAKE_CURRENT_SOURCE_DIR}/set_network_parameters - #Копирование файла конфигурации + #пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ ${CMAKE_CURRENT_SOURCE_DIR}/program_configure.json - #Копирование тестового файла конфигурации устройства Profinet + #пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ пїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅпїЅ Profinet ${CMAKE_CURRENT_SOURCE_DIR}/profinet_device_configure.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/bin ) \ No newline at end of file diff --git a/src/CMakePresets.json b/src/CMakePresets.json index a8d9d7a..d16d444 100644 --- a/src/CMakePresets.json +++ b/src/CMakePresets.json @@ -78,6 +78,30 @@ "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } + }, + { + "name": "am64xx_Debug", + "inherits": "default", + "displayName": "am64xx Debug", + "description": "Degub build for am64xx-evm board(arm cortex-a53)", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_TOOLCHAIN_FILE": "${workspaceFolder}/../sitara_depot/compile/toolchain.cmake", + "BOARD": "am64xx-evm" + }, + "environment": { + "ENV_TARGET_CROSS_COMPILE_PREFIX": "/opt/ti-processor-sdk-linux-am64xx-evm-09.02.00.08/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-", + "ENV_TARGET_SYSTOOT_PATH": "/opt/ti-processor-sdk-linux-am64xx-evm-09.02.00.08/linux-devkit/sysroots/aarch64-oe-linux" + } + }, + { + "name": "am64xx_Release", + "inherits": "am64xx_Debug", + "displayName": "am64xx Release", + "description": "Release build for am64xx-evm board(arm cortex-a53)", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } } ], @@ -105,6 +129,14 @@ { "name": "BeagleBoneAI Release", "configurePreset": "BeagleBoneAI_Release" + }, + { + "name": "am64xx Release", + "configurePreset": "am64xx_Release" + }, + { + "name": "am64xx Debug", + "configurePreset": "am64xx_Debug" } ] } \ No newline at end of file