forked from wolfSSL/wolfssl
Merge pull request #7636 from gojimmypi/PR-ESP8266-Make-Clarification
Clarify WOLFSSL_ROOT location for ESP8266 make builds
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -413,6 +413,14 @@ user_settings_asm.h
|
|||||||
/IDE/Espressif/**/sdkconfig
|
/IDE/Espressif/**/sdkconfig
|
||||||
/IDE/Espressif/**/sdkconfig.old
|
/IDE/Espressif/**/sdkconfig.old
|
||||||
|
|
||||||
|
# ESP8266 RTOS SDK has a slightly different sdkconfig filename to exclude:
|
||||||
|
/IDE/Espressif/**/sdkconfig.debug
|
||||||
|
/IDE/Espressif/**/sdkconfig.release
|
||||||
|
|
||||||
|
# Always include Espressif makefiles (typically only used for ESP8266)
|
||||||
|
!/IDE/Espressif/**/Makefile
|
||||||
|
!/IDE/Espressif/**/component.mk
|
||||||
|
|
||||||
# MPLAB
|
# MPLAB
|
||||||
/IDE/MPLABX16/wolfssl.X/dist/default/
|
/IDE/MPLABX16/wolfssl.X/dist/default/
|
||||||
/IDE/MPLABX16/wolfssl.X/.generated_files
|
/IDE/MPLABX16/wolfssl.X/.generated_files
|
||||||
|
@@ -39,6 +39,10 @@
|
|||||||
#
|
#
|
||||||
PROJECT_NAME := wolfssl_client
|
PROJECT_NAME := wolfssl_client
|
||||||
|
|
||||||
|
# Optionally include component source when print path (needs work to then properly build)
|
||||||
|
#
|
||||||
|
# include components/wolfssl/component.mk
|
||||||
|
|
||||||
MY_PRIVATE_CONFIG ?= n
|
MY_PRIVATE_CONFIG ?= n
|
||||||
USE_MY_PRIVATE_WSL_CONFIG ?= n
|
USE_MY_PRIVATE_WSL_CONFIG ?= n
|
||||||
USE_MY_PRIVATE_MAC_CONFIG ?= n
|
USE_MY_PRIVATE_MAC_CONFIG ?= n
|
||||||
@@ -132,3 +136,4 @@ EXTRA_COMPONENT_DIRS = $(IDF_PATH)/examples/common_components/protocol_examples_
|
|||||||
|
|
||||||
# The Standard Espressif IDF include:
|
# The Standard Espressif IDF include:
|
||||||
include $(IDF_PATH)/make/project.mk
|
include $(IDF_PATH)/make/project.mk
|
||||||
|
|
||||||
|
@@ -83,11 +83,75 @@ Reminder that we build with `make` and not `cmake` in VisualGDB.
|
|||||||
|
|
||||||
Build files will be created in `[project directory]\build`
|
Build files will be created in `[project directory]\build`
|
||||||
|
|
||||||
## ESP-IDF make Commandline (version 3.5 or earlier for the ESP8266)
|
See notes below if building a project in a directory other than the examples.
|
||||||
|
|
||||||
|
Problems?
|
||||||
|
|
||||||
|
- Try deleting any existing `sdkconfig` file and/or `./build` directory to start fresh.
|
||||||
|
- Be sure the RTOS SDK is installed and properly configured.
|
||||||
|
|
||||||
|
## ESP-IDF `make` Commandline (version 3.5 or earlier for the ESP8266)
|
||||||
|
|
||||||
|
In-place example build:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export IDF_PATH=~/esp/ESP8266_RTOS_SDK
|
||||||
|
export PATH="$PATH:$HOME/esp/xtensa-lx106-elf/bin"
|
||||||
|
cd /mnt/c/workspace/wolfssl-master/IDE/Espressif/ESP-IDF/examples/wolfssl_client
|
||||||
|
make clean
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
|
When building a in a *different directory*, for example assuming the `wolfssl_client` in the wolfssl examples
|
||||||
|
directory is copied to the `C:\test\demo` directory in Windows. (aka ` /mnt/c/test/demo` in WSL),
|
||||||
|
with a clone of wolfSSL `master` branch in `C:\workspace\wolfssl-master`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp -r /mnt/c/workspace/wolfssl-master/IDE/Espressif/ESP-IDF/examples/wolfssl_client/* /mnt/c/test/demo
|
||||||
|
```
|
||||||
|
|
||||||
|
Modify the project `./components/wolfssl/component.mk` file. Adjust `WOLFSSL_ROOT` setting, in this case to a value of:
|
||||||
|
|
||||||
|
`WOLFSSL_ROOT := ../../../../workspace/wolfssl-master`
|
||||||
|
|
||||||
|
Ensure the path is *relative* to the project `component.mk` file location and *not* absolute.
|
||||||
|
|
||||||
|
Note the location of the component makefile in this case is `c:\test\demo\components\wolfssl\component.mk`.
|
||||||
|
Thus we need to navigate up 4 parents to the root of `C:\` to find `/mnt/c` in WSL.
|
||||||
|
|
||||||
|
Proceed to run `make` from the project directory as usual:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# setup environment as needed
|
||||||
|
export IDF_PATH=~/esp/ESP8266_RTOS_SDK
|
||||||
|
export PATH="$PATH:$HOME/esp/xtensa-lx106-elf/bin"
|
||||||
|
|
||||||
|
# copy and navigate to project directory
|
||||||
|
mkdir -p /mnt/c/test/demo
|
||||||
|
cp -r /mnt/c/workspace/wolfssl-master/IDE/Espressif/ESP-IDF/examples/wolfssl_client/* /mnt/c/test/demo
|
||||||
|
cd /mnt/c/test/demo
|
||||||
|
|
||||||
|
# Clean
|
||||||
|
rm -rf ./build
|
||||||
|
rm sdkconfig
|
||||||
|
make clean
|
||||||
|
|
||||||
|
# Edit ./components/wolfssl/component.mk and set WOLFSSL_ROOT value
|
||||||
|
# WOLFSSL_ROOT := ../../../../workspace/wolfssl-master
|
||||||
|
|
||||||
|
# build the example project
|
||||||
|
make
|
||||||
|
```
|
||||||
|
|
||||||
|
When using `make` there should be details in the build log to indicate
|
||||||
|
the assigned path, and the equivalent, fully-qualified path of `WOLFSSL_ROOT`.
|
||||||
|
|
||||||
```
|
```
|
||||||
export IDF_PATH=~/esp/ESP8266_RTOS_SDK
|
************* wolfssl_client *************
|
||||||
|
*********** wolfssl component ************
|
||||||
|
WOLFSSL_ROOT defined: ../../../../workspace/wolfssl-master
|
||||||
|
WOLFSSL_ROOT actual: /mnt/c/workspace/wolfssl-master
|
||||||
|
********** end wolfssl component **********
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -158,7 +222,7 @@ Command:
|
|||||||
|
|
||||||
```
|
```
|
||||||
cd /mnt/c/workspace/wolfssl-$USER/IDE/Espressif/ESP-IDF/examples/wolfssl_server
|
cd /mnt/c/workspace/wolfssl-$USER/IDE/Espressif/ESP-IDF/examples/wolfssl_server
|
||||||
. /mnt/c/SysGCC/esp32/esp-idf/v5.1/export.sh
|
. /mnt/c/SysGCC/esp32/esp-idf/v5.2/export.sh
|
||||||
idf.py flash -p /dev/ttyS19 -b 115200 monitor
|
idf.py flash -p /dev/ttyS19 -b 115200 monitor
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@@ -18,7 +18,9 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
$(info *********** wolfssl component ************)
|
||||||
|
|
||||||
|
#
|
||||||
# Component Makefile
|
# Component Makefile
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
@@ -48,14 +50,57 @@
|
|||||||
# define it here:
|
# define it here:
|
||||||
CFLAGS +=-DWOLFSSL_USER_SETTINGS
|
CFLAGS +=-DWOLFSSL_USER_SETTINGS
|
||||||
|
|
||||||
|
# Note that 4 source files created by autogen are excluded here.
|
||||||
|
#
|
||||||
|
# See these files commented out, below. Adjust as needed for your application:
|
||||||
|
#
|
||||||
|
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/async.o
|
||||||
|
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/selftest.o
|
||||||
|
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfcrypt_first.o
|
||||||
|
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfcrypt_last.o
|
||||||
|
|
||||||
|
|
||||||
# NOTICE: the WOLFSSL_ROOT setting MUST be relative!
|
# NOTICE: the WOLFSSL_ROOT setting MUST be relative!
|
||||||
# See https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/api-guides/build-system.html?highlight=must+relative#optional-component-specific-variables
|
# See https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/api-guides/build-system.html?highlight=must+relative#optional-component-specific-variables
|
||||||
# In the wolfSSL GitHub examples for Espressif:
|
# In the wolfSSL GitHub examples for Espressif:
|
||||||
# https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples
|
# https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples
|
||||||
# When this wolfssl component.mk makefile is in [project]/components/wolfssl
|
# When this wolfssl component.mk makefile is in [project]/components/wolfssl
|
||||||
# The root is 7 directories up from here:
|
# The root is 7 directories up from here (the location of of this component.mk):
|
||||||
WOLFSSL_ROOT := ../../../../../../..
|
WOLFSSL_ROOT := ../../../../../../..
|
||||||
|
|
||||||
|
# To set the location of a different location, it is best to use relative paths.
|
||||||
|
#
|
||||||
|
# Set WOLFSSL_ROOT to a relative path from the current component directory.
|
||||||
|
# For example, if the wolfssl_client is copied from the examples to test:
|
||||||
|
#
|
||||||
|
# cp -r /IDE/Espressif/ESP-IDF/examples/wolfssl_client/* /mnt/c/test/demo
|
||||||
|
#
|
||||||
|
# we run make in /mnt/c/test/demo
|
||||||
|
# component is in /mnt/c/test/demo/components/wolfssl
|
||||||
|
# wolfssl is in /mnt/c/workspace/wolfssl-master
|
||||||
|
#
|
||||||
|
# "/mnt/c" is 4 directories up:
|
||||||
|
# 2 for `./test/demo` from where we run `make`, plus
|
||||||
|
# 2 more from the location of `component.mk` located
|
||||||
|
# in `[currect directory]/components/wolfssl`.
|
||||||
|
#
|
||||||
|
# Thus we need 4 parent reference to find the relative path to wolfSSL:
|
||||||
|
# WOLFSSL_ROOT := ../../../../workspace/wolfssl-master
|
||||||
|
|
||||||
|
# Optional CFLAGS (make works without these; for reference only)
|
||||||
|
# CFLAGS += -I$(WOLFSSL_ROOT)/wolfssl
|
||||||
|
# CFLAGS += -I$(WOLFSSL_ROOT)/wolfssl/wolfcrypt
|
||||||
|
# CFLAGS += -I$(WOLFSSL_ROOT)/wolfssl/wolfcrypt/port/Espressif
|
||||||
|
|
||||||
|
abs_WOLFSSL_ROOT := $(shell realpath $(WOLFSSL_ROOT))
|
||||||
|
|
||||||
|
# print-wolfssl-path-value:
|
||||||
|
# @echo "WOLFSSL_ROOT defined: $(WOLFSSL_ROOT)"
|
||||||
|
# @echo "WOLFSSL_ROOT actual: $(abs_WOLFSSL_ROOT)"
|
||||||
|
|
||||||
|
$(info WOLFSSL_ROOT defined: $(WOLFSSL_ROOT))
|
||||||
|
$(info WOLFSSL_ROOT actual: $(abs_WOLFSSL_ROOT))
|
||||||
|
|
||||||
# NOTE: The wolfSSL include directory (e.g. user_settings.h) is
|
# NOTE: The wolfSSL include directory (e.g. user_settings.h) is
|
||||||
# located HERE in THIS project, and *not* in the wolfSSL root.
|
# located HERE in THIS project, and *not* in the wolfSSL root.
|
||||||
COMPONENT_ADD_INCLUDEDIRS := .
|
COMPONENT_ADD_INCLUDEDIRS := .
|
||||||
@@ -64,7 +109,6 @@ COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/.
|
|||||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfssl
|
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfssl
|
||||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfssl/wolfcrypt
|
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfssl/wolfcrypt
|
||||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfssl/wolfcrypt/port/Espressif
|
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)/wolfssl/wolfcrypt/port/Espressif
|
||||||
COMPONENT_ADD_INCLUDEDIRS += $(WOLFSSL_ROOT)wolfssl/wolfcrypt/port/Espressif
|
|
||||||
# COMPONENT_ADD_INCLUDEDIRS += $ENV(IDF_PATH)/components/freertos/include/freertos
|
# COMPONENT_ADD_INCLUDEDIRS += $ENV(IDF_PATH)/components/freertos/include/freertos
|
||||||
# COMPONENT_ADD_INCLUDEDIRS += "$ENV(IDF_PATH)/soc/esp32s3/include/soc"
|
# COMPONENT_ADD_INCLUDEDIRS += "$ENV(IDF_PATH)/soc/esp32s3/include/soc"
|
||||||
|
|
||||||
@@ -120,7 +164,7 @@ COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/aes.o
|
|||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/arc4.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/arc4.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asm.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asm.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asn.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/asn.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/async.o
|
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/async.o # autogen exclusion
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/blake2b.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/blake2b.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/blake2s.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/blake2s.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/camellia.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/camellia.o
|
||||||
@@ -144,7 +188,7 @@ COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ed25519.o
|
|||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ed448.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ed448.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/error.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/error.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/evp.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/evp.o
|
||||||
# COMPONENT_OBJS += $(WOLFSSL_ROOT)wolfcrypt/src/ext_kyber.o
|
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ext_kyber.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ext_lms.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ext_lms.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ext_xmss.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ext_xmss.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/falcon.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/falcon.o
|
||||||
@@ -176,7 +220,7 @@ COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/rc2.o
|
|||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ripemd.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/ripemd.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/rsa.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/rsa.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sakke.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sakke.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/selftest.o
|
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/selftest.o # autogen exclusion
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha256.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha256.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha3.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/sha3.o
|
||||||
@@ -213,8 +257,8 @@ COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_lms.o
|
|||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_pkcs11.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_pkcs11.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_port.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_port.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_xmss.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wc_xmss.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfcrypt_first.o
|
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfcrypt_first.o # autogen exclusion
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfcrypt_last.o
|
# COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfcrypt_last.o # autogen exclusion
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfevent.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfevent.o
|
||||||
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfmath.o
|
COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/wolfmath.o
|
||||||
|
|
||||||
@@ -246,5 +290,7 @@ COMPONENT_OBJS += $(WOLFSSL_ROOT)/wolfcrypt/src/port/Espressif/esp_sdk_wifi_lib.
|
|||||||
##
|
##
|
||||||
## wolfcrypt
|
## wolfcrypt
|
||||||
##
|
##
|
||||||
# COMPONENT_PRIV_INCLUDEDIRS += $(PROJECT_PATH)/components/wolfssl/include
|
## COMPONENT_PRIV_INCLUDEDIRS += $(PROJECT_PATH)/components/wolfssl/include
|
||||||
COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)wolfcrypt/src
|
## COMPONENT_SRCDIRS += $(WOLFSSL_ROOT)/wolfcrypt/src
|
||||||
|
|
||||||
|
$(info ********** end wolfssl component **********)
|
||||||
|
Reference in New Issue
Block a user