-
Notifications
You must be signed in to change notification settings - Fork 45
Add wolfIP STM32 CubeMX Support #19
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 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ea9a8e0
Add wolfIP stm32CubeMX IDE support
aidangarske 306d947
Fix comments/concerns
aidangarske 6632242
Add STM32 HAL Ethernet driver for CubeMX integration
aidangarske 83c99d7
Fix Makefile to use WOLFIP_ENABLE_HTTP for native builds
aidangarske 4aae7f5
Update STM32Cube README and HAL driver
aidangarske 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # wolfIP for STM32 Cube IDE | ||
|
|
||
| The wolfIP Cube Pack can be found [here](https://www.wolfssl.com/files/ide/I-CUBE-wolfIP.pack). | ||
|
|
||
| 1. If you intend to use TLS with wolfIP, the first step is to set up the wolfSSL library in your ST project following the guide here [https://github.com/wolfSSL/wolfssl/blob/master/IDE/STM32Cube/README.md](https://github.com/wolfSSL/wolfssl/blob/master/IDE/STM32Cube/README.md). If not, skip to the next step. | ||
|
|
||
| 2. Install the wolfIP Cube Pack with the steps below. | ||
| - Run the "STM32CubeMX" tool. | ||
| - Under "Manage software installations" pane on the right, click "INSTALL/REMOVE" button. | ||
| - From Local and choose "I-CUBE-wolfIP.pack". | ||
| - Accept the GPLv3 license. Contact wolfSSL at sales@wolfssl.com for a commercial license and support/maintenance. | ||
|
|
||
| 3. Create an STM32 project for your board and open the `.ioc` file. Click the `Software Packs` drop down menu and then `Select Components`. Expand the `wolfIP` pack and check the Core component. If you need the embedded HTTP server, check the HTTP component as well. If you intend to use TLS with wolfIP, check the wolfSSL-IO component. This will enforce the dependency to wolfSSL. | ||
|
|
||
| 4. In the `Software Packs` configuration category of the `.ioc` file, click on the wolfIP pack and enable the library by checking the box. | ||
|
|
||
| 5. Configure the wolfIP settings in the `.ioc` file as needed (DHCP, DNS, socket pool sizes, MTU, etc.). | ||
|
|
||
| 6. Save your changes and select yes to the prompt asking about generating code. | ||
|
|
||
| 7. Build the project. | ||
|
|
||
| ## Notes | ||
| - wolfIP uses zero dynamic memory allocation - all sockets and buffers are pre-allocated at compile time. | ||
| - See `src/port/stm32h563/` for a complete bare-metal example targeting the STM32H563 microcontroller. | ||
| - For questions please email support@wolfssl.com | ||
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,172 @@ | ||
| [#ftl] | ||
| /** | ||
| ****************************************************************************** | ||
| * File Name : ${name} | ||
| * Description : This file provides code for the configuration | ||
| * of the ${name} instances. | ||
| ****************************************************************************** | ||
| [@common.optinclude name=mxTmpFolder+"/license.tmp"/][#--include License text --] | ||
| ****************************************************************************** | ||
| */ | ||
| [#assign s = name] | ||
| [#assign toto = s?replace(".","_")] | ||
| [#assign toto = toto?replace("/","")] | ||
| [#assign toto = toto?replace("-","_")] | ||
| [#assign inclusion_protection = toto?upper_case] | ||
| /* Define to prevent recursive inclusion -------------------------------------*/ | ||
| #ifndef __${inclusion_protection}__ | ||
| #define __${inclusion_protection}__ | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
|
|
||
| /* Includes ------------------------------------------------------------------*/ | ||
| [#if includes??] | ||
| [#list includes as include] | ||
| #include "${include}" | ||
| [/#list] | ||
| [/#if] | ||
|
|
||
| [#-- SWIPdatas is a list of SWIPconfigModel --] | ||
| [#list SWIPdatas as SWIP] | ||
| [#-- Global variables --] | ||
| [#if SWIP.variables??] | ||
| [#list SWIP.variables as variable] | ||
| extern ${variable.value} ${variable.name}; | ||
| [/#list] | ||
| [/#if] | ||
|
|
||
| [#-- Global variables --] | ||
|
|
||
| [#assign instName = SWIP.ipName] | ||
| [#assign fileName = SWIP.fileName] | ||
| [#assign version = SWIP.version] | ||
|
|
||
| /** | ||
| MiddleWare name : ${instName} | ||
| MiddleWare fileName : ${fileName} | ||
| MiddleWare version : ${version} | ||
| */ | ||
| [#if SWIP.defines??] | ||
| [#list SWIP.defines as definition] | ||
| /*---------- [#if definition.comments??]${definition.comments}[/#if] -----------*/ | ||
| #define ${definition.name} #t#t ${definition.value} | ||
| [#if definition.description??]${definition.description} [/#if] | ||
| [/#list] | ||
| [/#if] | ||
|
|
||
|
|
||
|
|
||
| [/#list] | ||
|
|
||
| /* ------------------------------------------------------------------------- */ | ||
| /* Platform */ | ||
| /* ------------------------------------------------------------------------- */ | ||
| #define WOLFIP_STM32_CUBEMX | ||
| #define NO_FILESYSTEM | ||
|
|
||
| /* ------------------------------------------------------------------------- */ | ||
| /* Socket Pool Configuration */ | ||
| /* ------------------------------------------------------------------------- */ | ||
| #if defined(WOLFIP_CONF_MAX_TCP) && WOLFIP_CONF_MAX_TCP > 0 | ||
| #define MAX_TCPSOCKETS WOLFIP_CONF_MAX_TCP | ||
| #else | ||
| #define MAX_TCPSOCKETS 4 | ||
| #endif | ||
|
|
||
| #if defined(WOLFIP_CONF_MAX_UDP) && WOLFIP_CONF_MAX_UDP > 0 | ||
| #define MAX_UDPSOCKETS WOLFIP_CONF_MAX_UDP | ||
| #else | ||
| #define MAX_UDPSOCKETS 2 | ||
| #endif | ||
|
|
||
| #if defined(WOLFIP_CONF_MAX_ICMP) && WOLFIP_CONF_MAX_ICMP > 0 | ||
| #define MAX_ICMPSOCKETS WOLFIP_CONF_MAX_ICMP | ||
| #else | ||
| #define MAX_ICMPSOCKETS 2 | ||
| #endif | ||
|
|
||
| /* ------------------------------------------------------------------------- */ | ||
| /* Buffer Configuration */ | ||
| /* ------------------------------------------------------------------------- */ | ||
| #if defined(WOLFIP_CONF_MTU) && WOLFIP_CONF_MTU > 0 | ||
| #define LINK_MTU WOLFIP_CONF_MTU | ||
| #else | ||
| #define LINK_MTU 1536 | ||
| #endif | ||
|
|
||
| #define RXBUF_SIZE (LINK_MTU * 16) | ||
| #define TXBUF_SIZE (LINK_MTU * 16) | ||
|
|
||
| /* ------------------------------------------------------------------------- */ | ||
| /* Network Configuration */ | ||
| /* ------------------------------------------------------------------------- */ | ||
| #define ETHERNET | ||
| #define MAX_NEIGHBORS 16 | ||
|
|
||
| /* ------------------------------------------------------------------------- */ | ||
| /* Enable/Disable Features */ | ||
| /* ------------------------------------------------------------------------- */ | ||
|
|
||
| /* DHCP Client */ | ||
| #if defined(WOLFIP_CONF_DHCP) && WOLFIP_CONF_DHCP == 1 | ||
| #define WOLFIP_ENABLE_DHCP | ||
| #endif | ||
|
|
||
| /* DNS Client */ | ||
| #if defined(WOLFIP_CONF_DNS) && WOLFIP_CONF_DNS == 1 | ||
| #define WOLFIP_ENABLE_DNS | ||
|
aidangarske marked this conversation as resolved.
Outdated
|
||
| #endif | ||
|
|
||
| /* Loopback Interface */ | ||
| #undef WOLFIP_ENABLE_LOOPBACK | ||
| #if defined(WOLFIP_CONF_LOOPBACK) && WOLFIP_CONF_LOOPBACK == 1 | ||
| #define WOLFIP_ENABLE_LOOPBACK 1 | ||
| #ifndef WOLFIP_MAX_INTERFACES | ||
| #define WOLFIP_MAX_INTERFACES 2 | ||
| #endif | ||
| #else | ||
| #define WOLFIP_ENABLE_LOOPBACK 0 | ||
| #endif | ||
|
|
||
| /* IP Forwarding */ | ||
| #undef WOLFIP_ENABLE_FORWARDING | ||
| #if defined(WOLFIP_CONF_FORWARDING) && WOLFIP_CONF_FORWARDING == 1 | ||
| #define WOLFIP_ENABLE_FORWARDING 1 | ||
| #else | ||
| #define WOLFIP_ENABLE_FORWARDING 0 | ||
| #endif | ||
|
|
||
| #ifndef WOLFIP_MAX_INTERFACES | ||
| #define WOLFIP_MAX_INTERFACES 1 | ||
| #endif | ||
|
|
||
| /* ------------------------------------------------------------------------- */ | ||
| /* Debugging */ | ||
| /* ------------------------------------------------------------------------- */ | ||
| #if defined(WOLFIP_CONF_DEBUG) && WOLFIP_CONF_DEBUG == 1 | ||
| #define DEBUG | ||
| #else | ||
| #undef DEBUG | ||
| #endif | ||
|
|
||
| /* ------------------------------------------------------------------------- */ | ||
| /* wolfSSL Integration */ | ||
| /* ------------------------------------------------------------------------- */ | ||
| /* Define WOLFSSL_WOLFIP to enable wolfSSL IO callbacks for TLS support. | ||
| * Requires wolfSSL Cube Pack to be installed and configured. | ||
| */ | ||
| /* #define WOLFSSL_WOLFIP */ | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
| #endif /* ${inclusion_protection}_H */ | ||
|
aidangarske marked this conversation as resolved.
Outdated
|
||
|
|
||
| /** | ||
| * @} | ||
| */ | ||
|
|
||
| /*****END OF FILE****/ | ||
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
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.