|
||
---|---|---|
.. | ||
README.md | ||
default_conf.ftl | ||
include.am | ||
main.c | ||
myFilesystem.h | ||
userio_template.h | ||
wolfssh_test.c | ||
wolfssh_test.h |
README.md
wolfSSH for STM32 Cube IDE
The wolfSSH Cube Pack can be found here and is dependent on the wolfCrypt
library.
Dependencies
wolfCrypt
The wolfCrypt crypto library is required to build/run the wolfSSH pack.
RTOS
The wolfSSH pack core functionality can be built without an RTOS but to build/run the tests, FreeRTOS will have to be added as a middlware.
Input/Output
By default, the wolfSSH pack uses a dummy custom IO implementation. The user is expected to be provide their own implementation in ide/STM32CUBE/userio_template.h
. Alternatively, they can enable LwIP and configure wolfSSH to use it.
Building and Running Tests
-
The first step is to set up the wolfCrypt library in your ST project following the guide here https://github.com/wolfSSL/wolfssl/blob/master/IDE/STM32Cube/README.md. To run the wolfSSH unit tests, name the entry function
wolfSSHTest
instead ofwolfCryptDemo
. -
Then install the wolfSSH Cube Pack in the same manner as the wolfSSL pack with CUBEMX.
-
Open the project
.ioc
file and click theSoftware Packs
drop down menu and thenSelect Components
. Expand thewolfSSH
pack and check all the components. -
In the
Software Packs
configuration category of the.ioc
file, click on the wolfSSH pack and enable the library by checking the box. -
The Pack defaults to using custom IO provided by the user. Modify
ide/STM32CUBE/userio_template.h
to supply the custom IO. If you'd like to use LwIP instead, configure the wolfSSH IO settings in the.ioc
to enable LwIP compatibilty. You'll also have to enable LwIP in theMiddleware
configuration category of the project. Enable theLWIP_DNS
option in the LwIP configuration settings. -
Save your changes and select yes to the prompt asking about generating code.
-
Build the project and run the unit tests.
Notes
-
Make sure to make these changes to redirect the printf's to the UART.
-
If looking to enable filesystem support (required for SFTP), the pack assumes the user has defined their own filesystem in
wolfssh/myFilesystem.h
. That file will originally contain a dummy filesystem. If going the FATFS route, make sure to replace#define WOLFSSH_USER_FILESYSTEM
with#define WOLFSSH_FATFS
in thewolfSSL.I-CUBE-wolfSSH_conf.h
header file. The wolfSSL Cube Pack also defaults to disabling filesystem support so make sure to remove#define NO_FILESYSTEM
fromwolfSSL.I-CUBE-wolfSSL_conf.h
. -
If building with LwIP and you encounter the error
multiple definition of 'errno'
inMiddlewares/Third_Party/LwIP/system/OS/sys_arch.c
, modify the file as shown below.
#if defined(LWIP_SOCKET_SET_ERRNO) && defined(LWIP_PROVIDE_ERRNO)
- int errno;
+ extern int errno;
#endif