Skip to content

Commit 5fb496b

Browse files
add chmod support, update readme and example app
1 parent 4f9e6b5 commit 5fb496b

7 files changed

Lines changed: 25152 additions & 65 deletions

File tree

ide/mplabx/README.md

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,48 @@
11
This is example code for adding a wolfSSH echoserver to a MPLABX project.
22

3-
The steps to use the code is as follows:
4-
1) Add wolfssh.c source file to project build.
5-
2) Make sure that current MPLABX project handles setting up TCP stack (see MPLABX examples for this /microchip/harmony/XXX/apps/examples/)
6-
3) Add include path to wolfssh root directory.
7-
4) Add preprocessor macro WOLFSSL_USER_SETTINGS (this is so wolfssl/wolfssh includes user_settings.h) to the project properties.
8-
5) Add include path to user_settings.h to project properties.
9-
6) Add APP_SSH_Tasks() and APP_SSH_Initialize() declarations to app.h header file.
10-
7) Add call to APP_SSH_Initialize() to system_init.c
11-
8) Add call to APP_SSH_Tasks() to system_tasks.c
12-
13-
For the current project this was tested with the heap and stack set to 200,000 each. This was not trimed to see the minumum possible heap and stack usage yet. The TX buffer size used was set to 1024. The example needs to use wolfssl versions that are later than 4/5/2018 (mid v3.14.0) for hardware acceleration and versions v3.14.0 and later for software only.
3+
For SAMV71:
4+
5+
1) Import the .mc3 settings. Create a new project for SAMV71, click on CM for content manager. Click "Load Manifest" and select the ide/mplabx/mcc-manifest-samv71.yml file and then click apply.
6+
2) Open MCC then click "Import" and import ide/mplabx/wolfssh-sftp-server-samv71.mc3 and then click "Generate"
7+
3) Adjust the "Preprocessor macros" to include WOLFSSH_IGNORE_FILE_WARN and WOLFSSL_USER_SETTINGS
8+
4) Create a user_sttings.h file in config/sam_v71_xult_freertos that includes config.h i.e.
9+
10+
user_settings.h
11+
```
12+
1 #ifndef USER_SETTINGS_H
13+
2 #define USER_SETTINGS_H
14+
3 #include "config.h"
15+
4 #endif
16+
```
17+
18+
5) Remove the generated app.c from Source Files
19+
6) Download wolfssh into src/third_party/wolfssh, for example:
20+
21+
```
22+
cd src/third_party
23+
git clone git@github.com:wolfssl/wolfssh
24+
```
25+
26+
7) Right click on the project and add existing item. Select src/third_party/wolfssh/ide/mplabx/wolfssh.c
27+
8) Right click on the project and add existing folder. Select src/third_party/wolfssh/src
28+
9) Increase the heap size to 200,000 by right clicking on the project, selecting "Properties"->"x32-ld"
29+
10) In "Header Files"/config/sam_v71_xult_freertos/configuration.h alter the configuration to support wolfSSH
30+
31+
```
32+
// wolfSSH
33+
#define WOLFSSL_WOLFSSH
34+
#ifndef NO_FILESYSTEM
35+
#define WOLFSSH_SFTP
36+
#endif
37+
#define WOLFSSH_NO_HMAC_SHA2_512
38+
#define DEFAULT_WINDOW_SZ 16384
39+
```
40+
41+
If present remove NO_FILESYSTEM and NO_SIG_WRAPPER. Add NO_WOLFSSL_DIR.
42+
43+
44+
Notes:
45+
46+
For the current project this was tested with the heap and stack set to 200,000 each. This was not trimed to see the minumum possible heap and stack usage yet. The TX buffer size used was set to 1024. The example was developed with wolfssh version 1.4.20.
1447

1548
After building and flashing the board a wolfSSH echoserver will be open on port 22 which can be connected to by using the example client bundled with wolfSSH. ```./examples/client/client -u jill -P upthehill -h 192.168.1.120 -p 22```

ide/mplabx/include.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
EXTRA_DIST+= ide/mplabx/README.md
55
EXTRA_DIST+= ide/mplabx/user_settings.h
66
EXTRA_DIST+= ide/mplabx/wolfssh.c
7+
EXTRA_DIST+= ide/mplabx/mcc-manifest-samv71.yml
8+
EXTRA_DIST+= ide/mplabx/wolfssh-sftp-server-samv71.mc3

ide/mplabx/mcc-manifest-samv71.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file has been autogenerated by MPLAB Code Configurator. Please do not edit this file.
2+
3+
manifest_file_version: 1.0.0
4+
project: wolfssh_sftp_server_freertos
5+
creation_date: 2025-03-19T10:17:34.824+07:00[Asia/Jakarta]
6+
operating_system: Mac OS X
7+
mcc_mode: IDE
8+
mcc_mode_version: v6.20
9+
device_name: ATSAMV71Q21B
10+
compiler: XC32 4.35
11+
mcc_version: 5.5.0
12+
mcc_core_version: 5.7.0
13+
content_manager_version: 5.0.1
14+
is_mcc_offline: false
15+
is_using_prerelease_versions: false
16+
mcc_content_registries: https://registry.npmjs.org/
17+
device_library: {library_class: com.microchip.mcc.harmony.Harmony3Library, name: Harmony
18+
V3, version: 1.4.1}
19+
packs: {name: SAMV71_DFP, version: 4.12.237}
20+
modules:
21+
- {name: core, type: HARMONY, version: v3.13.1}
22+
- {name: csp, type: HARMONY, version: v3.18.0}
23+
- {name: CMSIS_5, type: HARMONY, version: 5.9.0}
24+
- {name: wolfssl, type: HARMONY, version: v5.4.0}
25+
- {name: net, type: HARMONY, version: v3.11.0}
26+
- {name: bsp, type: HARMONY, version: v3.17.0}
27+
- {name: crypto, type: HARMONY, version: wolfssl}
28+
- {name: CMSIS-FreeRTOS, type: HARMONY, version: v10.5.1}

0 commit comments

Comments
 (0)