-
Notifications
You must be signed in to change notification settings - Fork 99
microchip example and filesystem port #790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
48fa1e0
add example code for MPLABX use
JacobBarthelmeh 41cef33
fix numbering in README steps
JacobBarthelmeh f859821
adding inital function mapping
JacobBarthelmeh c4acd86
progress on microchip fs port
JacobBarthelmeh 3a4c75f
compiling with port changes, needs work for runtime use
JacobBarthelmeh 604d1e8
ls command working
JacobBarthelmeh 7067b20
clear stat struct before use and treat mount as directory
JacobBarthelmeh 4f9e6b5
remove some trailing white space and initialize get current drive buffer
JacobBarthelmeh 5fb496b
add chmod support, update readme and example app
JacobBarthelmeh 79d32d0
create library build exmaple
JacobBarthelmeh ff9dabe
fix typo
JacobBarthelmeh 6e8ea49
remove extra debug log message and commented out stat items
JacobBarthelmeh ae5fa76
update include.am for correct mplabx files
JacobBarthelmeh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
| # wolfSSH MPLABX | ||
|
|
||
| This is example project to create a wolfSSH library and example code for adding | ||
| a wolfSSH echoserver to a MPLABX project. | ||
|
|
||
| Tested on a ATSAMV71Q21B with MPLABX version 6.20. | ||
|
|
||
| ### Building wolfSSH library | ||
|
|
||
| The library project is located at ide/mplabx/wolfssh.X | ||
|
|
||
| - First open wolfssh.X with MPLABX IDE then click on "CM" content manager and | ||
| import the ide/mplabx/wolfssh.X/mcc-manifest-generated-success.yml file. | ||
| - Click apply. | ||
| - Next click "MCC" and "generate". | ||
| - To build from the command line, do the following after the XC32 toolchain has | ||
| been installed. | ||
|
|
||
| ``` | ||
| cd ide/mplabx/wolfssh.X | ||
| make | ||
| ``` | ||
|
|
||
| - To build using the IDE open the project ide/mplabx/wolfssh.X and click build. | ||
|
|
||
|
|
||
| This will produce a wolfssh.X.a library in the directory | ||
| ide/mplabx/wolfssh.X/dist/default/production/wolfssh.X.a | ||
|
|
||
| The application and wolfSSL must be built with the same user_settings.h as the | ||
| wolfSSH library was built with! Differences in macro's defined for | ||
| configuration will cause undefined behavior and potential crashes. | ||
|
|
||
| ### Building an example app | ||
|
|
||
| 1) Adjust the "Preprocessor macros" to include WOLFSSL_USER_SETTINGS and add an | ||
| include path to ide/mplabx/user_settings.h. | ||
| 2) Remove the generated app.c from Source File | ||
| 3) Link to the wolfssh.X.a library. Properties->Libraries->Add Library/Object | ||
| File... | ||
| 4) Right click on the project and add existing item. Select ide/mplabx/wolfssh.c | ||
| 5) Increase the heap size to 200,000 by right clicking on the project, selecting | ||
| "Properties"->"x32-ld" | ||
|
|
||
| Notes: | ||
|
|
||
| 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. | ||
|
|
||
| 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``` |
This file contains hidden or 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,12 @@ | ||
| # vim:ft=automake | ||
| # All paths should be given relative to the root | ||
|
|
||
| EXTRA_DIST+= ide/mplabx/README.md | ||
| EXTRA_DIST+= ide/mplabx/user_settings.h | ||
| EXTRA_DIST+= ide/mplabx/wolfssh.c | ||
|
|
||
| EXTRA_DIST+= wolfssh.X/Makefile | ||
| EXTRA_DIST+= wolfssh.X/mcc-manifest-generated-success.yml | ||
| EXTRA_DIST+= wolfssh.X/wolfssh.mc3 | ||
| EXTRA_DIST+= wolfssh.X/nbproject/configurations.xml | ||
| EXTRA_DIST+= wolfssh.X/nbproject/project.xml | ||
This file contains hidden or 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,47 @@ | ||
| #ifndef USER_SETTINGS_H | ||
| #define USER_SETTINGS_H | ||
|
|
||
| /* include Microchip configuration first and then make additional changes */ | ||
| #include "configuration.h" | ||
|
|
||
| #include <stddef.h> | ||
|
|
||
| /* Turn on filesystem support for SFTP use */ | ||
| #undef NO_FILESYSTEM | ||
|
|
||
| /* wolfSSH configuration macros */ | ||
| #define WOLFSSL_WOLFSSH | ||
| #ifndef NO_FILESYSTEM | ||
| #define WOLFSSH_SFTP | ||
| #endif | ||
| #define DEFAULT_WINDOW_SZ 16384 | ||
| #define WOLFSSH_NO_HMAC_SHA2_512 | ||
|
|
||
| /* do not use dirent with wolfSSL */ | ||
| #define NO_WOLFSSL_DIR | ||
|
|
||
| /* avoid the defualt settings in older wolfssl versions from | ||
| * wolfssl/wolfcryt/settings.h */ | ||
| #undef MICROCHIP_PIC32 | ||
|
|
||
| #undef TFM_TIMING_RESISTANT | ||
| #define TFM_TIMING_RESISTANT | ||
|
|
||
| #undef ECC_TIMING_RESISTANT | ||
| #define ECC_TIMING_RESISTANT | ||
|
|
||
| /* In older versions of wolfSSL (5.7.6 and older) the strcasecmp and strncasecmp | ||
| * were dependent on the macro MICROCHIP_PIC32. Defining them here overrides | ||
| * that. */ | ||
| #if (__XC32_VERSION >= 1000) && (__XC32_VERSION < 4000) | ||
| #define XSTRCASECMP(s1,s2) strcasecmp((s1),(s2)) | ||
| #define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n)) | ||
| #else | ||
| #define XSTRCASECMP(s1,s2) strcmp((s1),(s2)) | ||
| #define XSTRNCASECMP(s1,s2,n) strncmp((s1),(s2),(n)) | ||
| #endif | ||
|
|
||
| /* allow signature wrapper api for wolfSSH use */ | ||
| #undef NO_SIG_WRAPPER | ||
|
|
||
| #endif |
This file contains hidden or 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,113 @@ | ||
| # | ||
| # There exist several targets which are by default empty and which can be | ||
| # used for execution of your targets. These targets are usually executed | ||
| # before and after some main targets. They are: | ||
| # | ||
| # .build-pre: called before 'build' target | ||
| # .build-post: called after 'build' target | ||
| # .clean-pre: called before 'clean' target | ||
| # .clean-post: called after 'clean' target | ||
| # .clobber-pre: called before 'clobber' target | ||
| # .clobber-post: called after 'clobber' target | ||
| # .all-pre: called before 'all' target | ||
| # .all-post: called after 'all' target | ||
| # .help-pre: called before 'help' target | ||
| # .help-post: called after 'help' target | ||
| # | ||
| # Targets beginning with '.' are not intended to be called on their own. | ||
| # | ||
| # Main targets can be executed directly, and they are: | ||
| # | ||
| # build build a specific configuration | ||
| # clean remove built files from a configuration | ||
| # clobber remove all built files | ||
| # all build all configurations | ||
| # help print help mesage | ||
| # | ||
| # Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and | ||
| # .help-impl are implemented in nbproject/makefile-impl.mk. | ||
| # | ||
| # Available make variables: | ||
| # | ||
| # CND_BASEDIR base directory for relative paths | ||
| # CND_DISTDIR default top distribution directory (build artifacts) | ||
| # CND_BUILDDIR default top build directory (object files, ...) | ||
| # CONF name of current configuration | ||
| # CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) | ||
| # CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) | ||
| # CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) | ||
| # CND_PACKAGE_DIR_${CONF} directory of package (current configuration) | ||
| # CND_PACKAGE_NAME_${CONF} name of package (current configuration) | ||
| # CND_PACKAGE_PATH_${CONF} path to package (current configuration) | ||
| # | ||
| # NOCDDL | ||
|
|
||
|
|
||
| # Environment | ||
| MKDIR=mkdir | ||
| CP=cp | ||
| CCADMIN=CCadmin | ||
| RANLIB=ranlib | ||
|
|
||
|
|
||
| # build | ||
| build: .build-post | ||
|
|
||
| .build-pre: | ||
| # Add your pre 'build' code here... | ||
|
|
||
| .build-post: .build-impl | ||
| # Add your post 'build' code here... | ||
|
|
||
|
|
||
| # clean | ||
| clean: .clean-post | ||
|
|
||
| .clean-pre: | ||
| # Add your pre 'clean' code here... | ||
| # WARNING: the IDE does not call this target since it takes a long time to | ||
| # simply run make. Instead, the IDE removes the configuration directories | ||
| # under build and dist directly without calling make. | ||
| # This target is left here so people can do a clean when running a clean | ||
| # outside the IDE. | ||
|
|
||
| .clean-post: .clean-impl | ||
| # Add your post 'clean' code here... | ||
|
|
||
|
|
||
| # clobber | ||
| clobber: .clobber-post | ||
|
|
||
| .clobber-pre: | ||
| # Add your pre 'clobber' code here... | ||
|
|
||
| .clobber-post: .clobber-impl | ||
| # Add your post 'clobber' code here... | ||
|
|
||
|
|
||
| # all | ||
| all: .all-post | ||
|
|
||
| .all-pre: | ||
| # Add your pre 'all' code here... | ||
|
|
||
| .all-post: .all-impl | ||
| # Add your post 'all' code here... | ||
|
|
||
|
|
||
| # help | ||
| help: .help-post | ||
|
|
||
| .help-pre: | ||
| # Add your pre 'help' code here... | ||
|
|
||
| .help-post: .help-impl | ||
| # Add your post 'help' code here... | ||
|
|
||
|
|
||
|
|
||
| # include project implementation makefile | ||
| include nbproject/Makefile-impl.mk | ||
|
|
||
| # include project make variables | ||
| include nbproject/Makefile-variables.mk |
This file contains hidden or 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,29 @@ | ||
| # This file has been autogenerated by MPLAB Code Configurator. Please do not edit this file. | ||
|
|
||
| manifest_file_version: 1.0.0 | ||
| project: wolfssh | ||
| creation_date: 2025-04-02T16:56:35.669-06:00[America/Denver] | ||
| operating_system: Mac OS X | ||
| mcc_mode: IDE | ||
| mcc_mode_version: v6.20 | ||
| device_name: ATSAMV71Q21B | ||
| compiler: XC32 4.35 | ||
| mcc_version: 5.5.0 | ||
| mcc_core_version: 5.7.0 | ||
| content_manager_version: 5.0.1 | ||
| is_mcc_offline: false | ||
| is_using_prerelease_versions: false | ||
| mcc_content_registries: https://registry.npmjs.org/ | ||
| device_library: {library_class: com.microchip.mcc.harmony.Harmony3Library, name: Harmony | ||
| V3, version: 1.5.5} | ||
| packs: {name: SAMV71_DFP, version: 4.12.237} | ||
| modules: | ||
| - {name: core, type: HARMONY, version: v3.13.1} | ||
| - {name: csp, type: HARMONY, version: v3.18.0} | ||
| - {name: filex, type: HARMONY, version: v6.2.1_rel} | ||
| - {name: CMSIS_5, type: HARMONY, version: 5.9.0} | ||
| - {name: littlefs, type: HARMONY, version: v2.10.1} | ||
| - {name: wolfssl, type: HARMONY, version: v5.4.0} | ||
| - {name: net, type: HARMONY, version: v3.11.0} | ||
| - {name: crypto, type: HARMONY, version: v3.8.1} | ||
| - {name: CMSIS-FreeRTOS, type: HARMONY, version: v10.5.1} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.