Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,15 @@
[submodule "make-testsuite/wolfssh"]
path = make-testsuite/wolfssh
url = https://github.com/wolfSSL/wolfssh.git
[submodule "echo-server/wolfssl"]
path = echo-server/wolfssl
url = https://github.com/wolfSSL/wolfssl.git
[submodule "echo-server/wolfssh"]
path = echo-server/wolfssh
url = https://github.com/wolfSSL/wolfssh.git
[submodule "echo-server/FreeRTOS-Kernel"]
path = echo-server/FreeRTOS-Kernel
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
[submodule "echo-server/FreeRTOS-Plus-TCP"]
path = echo-server/FreeRTOS-Plus-TCP
url = https://github.com/FreeRTOS/FreeRTOS-Plus-TCP.git
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ The following examples are available for Espressif devices:
* [ESP32-SSH-Server](./Espressif/ESP8266/ESP8266-SSH-Server/README.md)
SSH-to-UART.

## echo-server

A minimal SSH echo server running on FreeRTOS with FreeRTOS-Plus-TCP networking.
Targets PIC32MZ with Microchip Harmony but runnable on Linux using the FreeRTOS
POSIX simulator and a libpcap-based network interface. Uses a Makefile and has a
preconfigured user_settings.h file.

## make-testsuite

This example isn't manufacturer specific, but it has only been tested on
Expand Down
5 changes: 5 additions & 0 deletions echo-server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.o
*.a
obj/
keys/
echo-server
1 change: 1 addition & 0 deletions echo-server/FreeRTOS-Kernel
Submodule FreeRTOS-Kernel added at 262488
1 change: 1 addition & 0 deletions echo-server/FreeRTOS-Plus-TCP
Submodule FreeRTOS-Plus-TCP added at af6b37
102 changes: 102 additions & 0 deletions echo-server/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/* FreeRTOSConfig.h
*
* Copyright (C) 2026 wolfSSL Inc.
*
* wolfSSH is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H

/* Scheduler */
#define configUSE_PREEMPTION 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
#define configUSE_TICKLESS_IDLE 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 60000000 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES 5
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 8192 )
#define configMAX_TASK_NAME_LEN 16
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_TASK_NOTIFICATIONS 1
#define configTASK_NOTIFICATION_ARRAY_ENTRIES 3
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_COUNTING_SEMAPHORES 1
#define configQUEUE_REGISTRY_SIZE 10
#define configUSE_QUEUE_SETS 0
#define configUSE_TIME_SLICING 1
#define configUSE_NEWLIB_REENTRANT 0
#define configENABLE_BACKWARD_COMPATIBILITY 1
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 5
#define configUSE_MINI_LIST_ITEM 1

/* Memory */
#define configSUPPORT_STATIC_ALLOCATION 0
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 256 * 1024 ) )
#define configAPPLICATION_ALLOCATED_HEAP 0

/* Hook functions */
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCHECK_FOR_STACK_OVERFLOW 0
#define configUSE_MALLOC_FAILED_HOOK 0
#define configUSE_DAEMON_TASK_STARTUP_HOOK 0

/* Stats */
#define configGENERATE_RUN_TIME_STATS 0
#define configUSE_TRACE_FACILITY 0
#define configUSE_STATS_FORMATTING_FUNCTIONS 0

/* Co-routines */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES 1

/* Software timers */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
#define configTIMER_QUEUE_LENGTH 10
#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE

/* Logging — used by FreeRTOS-Plus-TCP's FreeRTOS_printf / FreeRTOS_debug_printf */
#define configPRINTF( X ) printf X

/* Trap errors during development */
#define configASSERT( x )

/* Optional functions */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_xResumeFromISR 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_xTaskGetSchedulerState 1
#define INCLUDE_xTaskGetCurrentTaskHandle 1
#define INCLUDE_uxTaskGetStackHighWaterMark 0
#define INCLUDE_xTaskGetIdleTaskHandle 0
#define INCLUDE_eTaskGetState 0
#define INCLUDE_xEventGroupSetBitFromISR 1
#define INCLUDE_xTimerPendFunctionCall 0
#define INCLUDE_xTaskAbortDelay 0
#define INCLUDE_xTaskGetHandle 0
#define INCLUDE_xTaskResumeFromISR 1

/* POSIX port */
#define configPOSIX_STACK_SIZE ( ( unsigned short ) 65536 )

#endif /* FREERTOS_CONFIG_H */
91 changes: 91 additions & 0 deletions echo-server/FreeRTOSIPConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/* FreeRTOSIPConfig.h
*
* Copyright (C) 2026 wolfSSL Inc.
*
* wolfSSH is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wolfSSH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with wolfSSH. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef FREERTOS_IP_CONFIG_H
#define FREERTOS_IP_CONFIG_H

/* Use the backward-compatible single-interface FreeRTOS_IPInit() API */
#define ipconfigIPv4_BACKWARD_COMPATIBLE 1
#define ipconfigUSE_IPv6 0

/* TCP/IP task */
#define ipconfigIP_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
#define ipconfigIP_TASK_STACK_SIZE_WORDS ( configMINIMAL_STACK_SIZE * 4 )

/* Protocol support */
#define ipconfigUSE_TCP 1
#define ipconfigUSE_DNS 0
#define ipconfigUSE_DHCP 0

/* Network tuning */
#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 60
#define ipconfigNETWORK_MTU 1500
#define ipconfigTCP_MSS ( ipconfigNETWORK_MTU - 40 )
#define ipconfigTCP_RX_BUFFER_LENGTH ( 16 * 1024 )
#define ipconfigTCP_TX_BUFFER_LENGTH ( 16 * 1024 )
#define ipconfigTCP_WIN_SEG_COUNT 64

/* Event processing */
#define ipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES 1
#define ipconfigETHERNET_MINIMUM_PACKET_BYTES 0
#define ipconfigBUFFER_PADDING 0
#define ipconfigPACKET_FILLER_SIZE 2
#define ipconfigEVENT_QUEUE_LENGTH ( ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS + 5 )

/* ARP */
#define ipconfigUSE_ARP_REMOVE_ENTRY 1
#define ipconfigUSE_ARP_REVERSED_LOOKUP 1
#define ipconfigARP_CACHE_ENTRIES 6
#define ipconfigMAX_ARP_RETRANSMISSIONS 5
#define ipconfigMAX_ARP_AGE 150

/* TCP parameters */
#define ipconfigTCP_HANG_PROTECTION 1
#define ipconfigTCP_HANG_PROTECTION_TIME 30
#define ipconfigTCP_KEEP_ALIVE 1
#define ipconfigTCP_KEEP_ALIVE_INTERVAL 20

/* Misc */
#define ipconfigZERO_COPY_TX_DRIVER 0
#define ipconfigZERO_COPY_RX_DRIVER 0
#define ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM 0
#define ipconfigDRIVER_INCLUDED_RX_IP_CHECKSUM 0
#define ipconfigSUPPORT_OUTGOING_PINGS 1
#define ipconfigREPLY_TO_INCOMING_PINGS 1
#define ipconfigSUPPORT_SELECT_FUNCTION 0
#define ipconfigFILTER_OUT_NON_ETHERNET_II_FRAMES 1
#define ipconfigBYTE_ORDER pdFREERTOS_LITTLE_ENDIAN
#define ipconfigHAS_DEBUG_PRINTF 0
#define ipconfigHAS_PRINTF 1

/* Linux pcap network interface.
* Override at compile time with -DipconfigNETWORK_INTERFACE_TO_USE=N */
#ifndef ipconfigNETWORK_INTERFACE_TO_USE
#define ipconfigNETWORK_INTERFACE_TO_USE 2
#endif

/* Linux NetworkInterface.c requires these defines */
#define configNETWORK_INTERFACE_TO_USE ipconfigNETWORK_INTERFACE_TO_USE
#define configMAC_ISR_SIMULATOR_PRIORITY ( configMAX_PRIORITIES - 1 )
#define configWINDOWS_MAC_INTERRUPT_SIMULATOR_DELAY ( 2 / portTICK_PERIOD_MS )
#define configNET_MASK0 255
#define configNET_MASK1 255
#define configNET_MASK2 255
#define configNET_MASK3 0

#endif /* FREERTOS_IP_CONFIG_H */
Loading