-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
1,707 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# Copyright (c) 2023 ZettaScale Technology | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
# which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
# | ||
# Contributors: | ||
# Błażej Sowa, <[email protected]> | ||
# | ||
name: freertos_plus_tcp | ||
|
||
on: | ||
push: | ||
branches: [ '**' ] | ||
pull_request: | ||
branches: [ '**' ] | ||
|
||
jobs: | ||
build: | ||
name: Build on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: jwlawson/[email protected] | ||
- name: Install requirements | ||
run: | | ||
sudo apt update | ||
sudo apt install -y ninja-build libslirp-dev | ||
- name: Build examples | ||
run: | | ||
cd examples/freertos_plus_tcp | ||
cmake -Bbuild -G"Ninja Multi-Config" | ||
cmake --build ./build --config Debug | ||
cmake --build ./build --config Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# | ||
# Copyright (c) 2023 Fictionlab sp. z o.o. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
# which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
# | ||
# Contributors: | ||
# Błażej Sowa, <[email protected]> | ||
|
||
cmake_minimum_required(VERSION 3.20) | ||
project(zenohpico_freertos_plus_tcp_examples) | ||
|
||
set(CMAKE_SYSTEM_NAME "Generic") | ||
set(CMAKE_C_STANDARD 11) | ||
|
||
include(../../cmake/helpers.cmake) | ||
set_default_build_type(Release) | ||
|
||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(SLIRP REQUIRED slirp) | ||
|
||
add_library(slirp INTERFACE) | ||
target_link_libraries(slirp INTERFACE ${SLIRP_LINK_LIBRARIES}) | ||
target_include_directories(slirp INTERFACE ${SLIRP_INCLUDE_DIRS}) | ||
target_compile_options(slirp INTERFACE -Wno-error) | ||
|
||
include(FetchContent) | ||
|
||
FetchContent_Declare(freertos_kernel | ||
GIT_REPOSITORY "https://github.com/FreeRTOS/FreeRTOS-Kernel.git" | ||
GIT_TAG "V10.6.1" | ||
) | ||
|
||
FetchContent_Declare(freertos_plus_tcp | ||
GIT_REPOSITORY "https://github.com/FreeRTOS/FreeRTOS-Plus-TCP.git" | ||
GIT_TAG "34148c3" | ||
GIT_SUBMODULES "" | ||
) | ||
|
||
add_library(freertos_config INTERFACE) | ||
target_include_directories(freertos_config SYSTEM INTERFACE include) | ||
target_compile_options(freertos_config INTERFACE -Wno-error) | ||
|
||
set(FREERTOS_HEAP "3" CACHE STRING "" FORCE) | ||
set(FREERTOS_PORT "GCC_POSIX" CACHE STRING "" FORCE) | ||
set(FREERTOS_PLUS_TCP_NETWORK_IF "LIBSLIRP" CACHE STRING "" FORCE) | ||
set(FREERTOS_PLUS_TCP_BUFFER_ALLOCATION "2" CACHE STRING "" FORCE) | ||
|
||
FetchContent_MakeAvailable(freertos_kernel freertos_plus_tcp) | ||
|
||
set(BUILD_SHARED_LIBS OFF) | ||
set(WITH_FREERTOS_PLUS_TCP ON) | ||
set(ZENOH_DEBUG 3) | ||
configure_include_project(ZENOHPICO zenohpico zenohpico "../.." zenohpico "https://github.com/eclipse-zenoh/zenoh-pico" "") | ||
|
||
target_link_libraries(zenohpico | ||
freertos_kernel | ||
freertos_plus_tcp | ||
) | ||
target_compile_definitions(zenohpico | ||
PUBLIC | ||
Z_FEATURE_MULTI_THREAD=1 | ||
Z_FEATURE_LINK_TCP=1 | ||
Z_FEATURE_SCOUTING_UDP=1 | ||
Z_FEATURE_LINK_UDP_UNICAST=1 | ||
Z_FEATURE_LINK_UDP_MULTICAST=0 | ||
Z_CONFIG_SOCKET_TIMEOUT=1000 | ||
) | ||
|
||
add_library(main OBJECT main.c) | ||
target_link_libraries(main | ||
freertos_kernel | ||
freertos_plus_tcp | ||
) | ||
|
||
function(add_example name) | ||
add_executable(${name} ${name}.c) | ||
target_link_libraries(${name} | ||
main | ||
freertos_kernel | ||
freertos_plus_tcp | ||
zenohpico | ||
) | ||
endfunction() | ||
|
||
add_example(z_get) | ||
add_example(z_pub_st) | ||
add_example(z_pub) | ||
add_example(z_pull) | ||
add_example(z_put) | ||
add_example(z_queryable) | ||
add_example(z_scout) | ||
add_example(z_sub_st) | ||
add_example(z_sub) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// | ||
// Copyright (c) 2023 Fictionlab sp. z o.o. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License 2.0 which is available at | ||
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
// which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// | ||
// Contributors: | ||
// Błażej Sowa, <[email protected]> | ||
|
||
#ifndef FREERTOS_CONFIG_H | ||
#define FREERTOS_CONFIG_H | ||
|
||
#include "bits/pthread_stack_min.h" | ||
|
||
/* Core options */ | ||
#define configUSE_PREEMPTION 1 | ||
#define configTICK_RATE_HZ ((TickType_t)1000) | ||
#define configMAX_PRIORITIES (56) | ||
#define configMINIMAL_STACK_SIZE ((uint16_t) PTHREAD_STACK_MIN) | ||
#define configMAX_TASK_NAME_LEN (16) | ||
#define configUSE_16_BIT_TICKS 0 | ||
#define configQUEUE_REGISTRY_SIZE 0 | ||
#define configTASK_NOTIFICATION_ARRAY_ENTRIES 1 | ||
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0 | ||
|
||
/* Hook function related definitions. */ | ||
#define configUSE_IDLE_HOOK 0 | ||
#define configUSE_TICK_HOOK 0 | ||
#define configUSE_MALLOC_FAILED_HOOK 0 | ||
#define configUSE_DAEMON_TASK_STARTUP_HOOK 0 | ||
#define configUSE_SB_COMPLETED_CALLBACK 0 | ||
|
||
/* Enable/Disable features */ | ||
#define configSUPPORT_STATIC_ALLOCATION 1 | ||
#define configSUPPORT_DYNAMIC_ALLOCATION 1 | ||
#define configUSE_MUTEXES 1 | ||
#define configUSE_RECURSIVE_MUTEXES 1 | ||
#define configUSE_COUNTING_SEMAPHORES 1 | ||
#define configUSE_CO_ROUTINES 0 | ||
#define configUSE_TIMERS 0 | ||
#define configUSE_TRACE_FACILITY 0 | ||
#define configUSE_QUEUE_SETS 0 | ||
#define configUSE_NEWLIB_REENTRANT 0 | ||
|
||
/* Set the API functions which should be included */ | ||
#define INCLUDE_vTaskPrioritySet 1 | ||
#define INCLUDE_uxTaskPriorityGet 1 | ||
#define INCLUDE_vTaskDelete 1 | ||
#define INCLUDE_vTaskCleanUpResources 0 | ||
#define INCLUDE_vTaskSuspend 1 | ||
#define INCLUDE_vTaskDelayUntil 1 | ||
#define INCLUDE_vTaskDelay 1 | ||
#define INCLUDE_xTaskGetSchedulerState 1 | ||
#define INCLUDE_xTimerPendFunctionCall 1 | ||
#define INCLUDE_xQueueGetMutexHolder 1 | ||
#define INCLUDE_uxTaskGetStackHighWaterMark 1 | ||
#define INCLUDE_eTaskGetState 1 | ||
#define INCLUDE_xTimerPendFunctionCall 0 | ||
|
||
#endif /* FREERTOS_CONFIG_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// Copyright (c) 2023 Fictionlab sp. z o.o. | ||
// | ||
// This program and the accompanying materials are made available under the | ||
// terms of the Eclipse Public License 2.0 which is available at | ||
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
// which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// | ||
// Contributors: | ||
// Błażej Sowa, <[email protected]> | ||
|
||
#ifndef FREERTOS_IP_CONFIG_H | ||
#define FREERTOS_IP_CONFIG_H | ||
|
||
// Driver specific | ||
#define ipconfigBYTE_ORDER pdFREERTOS_LITTLE_ENDIAN | ||
#define ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES 1 | ||
#define ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM 0 | ||
#define ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM 1 | ||
#define ipconfigZERO_COPY_RX_DRIVER 1 | ||
#define ipconfigZERO_COPY_TX_DRIVER 1 | ||
#define ipconfigUSE_LINKED_RX_MESSAGES 1 | ||
#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60 | ||
|
||
// Enable/Disable features | ||
#define ipconfigUSE_IPv4 1 | ||
#define ipconfigUSE_IPv6 1 | ||
#define ipconfigUSE_DHCP 1 | ||
#define ipconfigUSE_DHCPv6 0 | ||
#define ipconfigUSE_RA 0 | ||
#define ipconfigUSE_DNS 1 | ||
#define ipconfigUSE_TCP 1 | ||
#define ipconfigUSE_ARP_REMOVE_ENTRY 0 | ||
#define ipconfigUSE_ARP_REVERSED_LOOKUP 0 | ||
#define ipconfigSUPPORT_SELECT_FUNCTION 0 | ||
#define ipconfigSUPPORT_OUTGOING_PINGS 0 | ||
#define ipconfigUSE_NETWORK_EVENT_HOOK 1 | ||
#define ipconfigUSE_DHCP_HOOK 0 | ||
|
||
// DHCP | ||
#define ipconfigMAXIMUM_DISCOVER_TX_PERIOD (pdMS_TO_TICKS(1000U)) | ||
#define ipconfigDHCP_REGISTER_HOSTNAME 1 | ||
|
||
#define ipconfigIP_TASK_PRIORITY (configMAX_PRIORITIES - 2) | ||
#define ipconfigIP_TASK_STACK_SIZE_WORDS (configMINIMAL_STACK_SIZE * 5) | ||
|
||
// Set ipconfigBUFFER_PADDING on 64-bit platforms | ||
#if INTPTR_MAX == INT64_MAX | ||
#define ipconfigBUFFER_PADDING 14U | ||
#endif | ||
|
||
#endif /* FREERTOS_IP_CONFIG_H */ |
Oops, something went wrong.