Skip to content

Commit 081731b

Browse files
Merge pull request #7392 from gojimmypi/PR-Espressif-wolfcrypt-test
Update Espressif Examples and Libraries
2 parents d22991b + 5cab707 commit 081731b

81 files changed

Lines changed: 5581 additions & 1138 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

IDE/Espressif/ESP-IDF/README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ESP-IDF Port
22

33
These Espressif examples have been created and tested with the latest stable release branch of
4-
[ESP-IDF V5.1](https://docs.espressif.com/projects/esp-idf/en/release-v5.1/esp32/get-started/index.html).
5-
The prior version 4.4 ESP-IDF is still supported, however version 5.1 or greater is recommended.
4+
[ESP-IDF V5.2](https://docs.espressif.com/projects/esp-idf/en/release-v5.2/esp32/get-started/index.html).
5+
The prior version 4.4 ESP-IDF is still supported, however version 5.2 or greater is recommended.
66
Espressif has [a list of all ESP-IDF versions](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/versions.html).
77

88
See the latest [Espressif Migration Guides](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/migration-guides/index.html).
@@ -44,6 +44,28 @@ default configuration items in the wolfssl `settings.h`. With the latest version
4444
wolfSSL, some of these defaults can be disabled with `NO_ESPIDF_DEFAULT` and customized
4545
in your project `user_settings.h` as desired.
4646

47+
The `user_settings.h` include file should not be explicitly included in an project source files. Be
48+
sure to include `settings.h` (which pulls in `user_settings.h`) before any other wolfSSL include files.
49+
50+
A new project should also include a compiler option suc as `CFLAGS +=-DWOLFSSL_USER_SETTINGS"` to ensure
51+
the `user_settings.h` is included properly. See the [template example](https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/examples/template/main/main.c).
52+
53+
```
54+
#ifdef WOLFSSL_USER_SETTINGS
55+
#include <wolfssl/wolfcrypt/settings.h>
56+
#ifndef WOLFSSL_ESPIDF
57+
#warning "Problem with wolfSSL user_settings."
58+
#warning "Check components/wolfssl/include"
59+
#endif
60+
#include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
61+
#else
62+
/* Define WOLFSSL_USER_SETTINGS project wide for settings.h to include */
63+
/* wolfSSL user settings in ./components/wolfssl/include/user_settings.h */
64+
#error "Missing WOLFSSL_USER_SETTINGS in CMakeLists or Makefile:\
65+
CFLAGS +=-DWOLFSSL_USER_SETTINGS"
66+
#endif
67+
```
68+
4769
See the respective project directory:
4870

4971
`[project-dir]/components/wolfssl/user_settings.h`
@@ -116,15 +138,15 @@ See the specific examples for additional details.
116138

117139
## Setup for Linux (wolfSSL local copy)
118140

119-
This is a legacy method for installation. It is recommended to use the new `CMakeLists.txt` to point to wolfSSL source code.
141+
This is an alternate method for installation. It is recommended to use the new `CMakeLists.txt` to point to wolfSSL source code.
120142

121143
1. Run `setup.sh` at _/path/to_`/wolfssl/IDE/Espressif/ESP-IDF/` to deploy files into ESP-IDF tree
122144
2. Find Wolfssl files at _/path/to/esp_`/esp-idf/components/wolfssl/`
123145
3. Find [Example Programs](https://github.com/wolfSSL/wolfssl/tree/master/IDE/Espressif/ESP-IDF/examples) under _/path/to/esp_`/esp-idf/examples/protocols/wolfssl_xxx` (where xxx is the project name)
124146

125147
## Setup for Windows
126148

127-
This is a legacy method for installation. It is recommended to use the new `CMakeLists.txt` to point to wolfSSL source code.
149+
This is an alternate method for installation. It is recommended to use the new `CMakeLists.txt` to point to wolfSSL source code.
128150

129151
1. Run ESP-IDF Command Prompt (cmd.exe) or Run ESP-IDF PowerShell Environment
130152
2. Run `setup_win.bat` at `.\IDE\Espressif\ESP-IDF\`

IDE/Espressif/ESP-IDF/dummy_test_paths.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* wolfcrypt/test/test_paths.h
22
*
3-
* Copyright (C) 2006-2023 wolfSSL Inc.
3+
* Copyright (C) 2006-2024 wolfSSL Inc.
44
*
55
* This file is part of wolfSSL.
66
*

IDE/Espressif/ESP-IDF/examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ These are the core examples for wolfSSL:
1010

1111
- [Test](./wolfssl_test/README.md)
1212

13-
- [TLS Client](./wolfssl_client/README.md)
13+
- [TLS Client](./wolfssl_client/README.md). See also [CLI Client](https://github.com/wolfSSL/wolfssl/tree/master/examples/client) and [more TLS examples](https://github.com/wolfSSL/wolfssl-examples/tree/master/tls).
1414

15-
- [TLS Server](./wolfssl_server/README.md)
15+
- [TLS Server](./wolfssl_server/README.md). See also [CLI Server](https://github.com/wolfSSL/wolfssl/tree/master/examples/server)
1616

1717
## Other Espressif wolfSSL Examples
1818

IDE/Espressif/ESP-IDF/examples/template/VisualGDB/wolfssl_template_IDF_v5.1_ESP32.vgdbproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<ToolchainID>
1919
<ID>com.visualgdb.xtensa-esp32-elf</ID>
2020
<Version>
21-
<GCC>12.2.0</GCC>
21+
<GCC>13.2.0</GCC>
2222
<GDB>12.1</GDB>
2323
<Revision>1</Revision>
2424
</Version>
@@ -67,8 +67,8 @@
6767
<EnableFastUpToDateCheck>true</EnableFastUpToDateCheck>
6868
<ESPIDFExtension>
6969
<IDFCheckout>
70-
<Version>release/v5.1</Version>
71-
<Subdirectory>esp-idf/v5.1</Subdirectory>
70+
<Version>release/v5.2</Version>
71+
<Subdirectory>esp-idf/v5.2</Subdirectory>
7272
<Type>ESPIDF</Type>
7373
</IDFCheckout>
7474
<COMPort>COM37</COMPort>

IDE/Espressif/ESP-IDF/examples/template/components/wolfssl/CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2006-2023 wolfSSL Inc.
2+
# Copyright (C) 2006-2024 wolfSSL Inc.
33
#
44
# This file is part of wolfSSL.
55
#
@@ -45,6 +45,11 @@ else()
4545
endif()
4646
message(STATUS "THIS_USER = ${THIS_USER}")
4747

48+
if( "$ENV{IDF_PATH}" STREQUAL "" )
49+
message(FATAL_ERROR "IDF_PATH Environment variable not set!")
50+
else()
51+
string(REPLACE "\\" "/" THIS_IDF_PATH "$ENV{IDF_PATH}")
52+
endif()
4853

4954
# COMPONENT_NAME = wolfssl
5055
# The component name is the directory name. "No feature to change this".
@@ -158,8 +163,8 @@ if(CMAKE_BUILD_EARLY_EXPANSION)
158163
idf_component_register(
159164
REQUIRES "${COMPONENT_REQUIRES}"
160165
PRIV_REQUIRES # esp_hw_support
161-
esp_timer
162-
driver # this will typically only be needed for wolfSSL benchmark
166+
# esp_timer
167+
# driver # this will typically only be needed for wolfSSL benchmark
163168
)
164169

165170
else()
@@ -363,6 +368,10 @@ else()
363368
"\"${WOLFSSL_ROOT}/wolfssl/\""
364369
"\"${WOLFSSL_ROOT}/wolfssl/wolfcrypt/\""
365370
"\"${RTOS_IDF_PATH}/\""
371+
# wolfSSL release after v5.7 includes WiFi, time, and mem/debug helpers
372+
"${THIS_IDF_PATH}/components/esp_event/include"
373+
"${THIS_IDF_PATH}/components/esp_netif/include"
374+
"${THIS_IDF_PATH}/components/esp_wifi/include"
366375
)
367376

368377

0 commit comments

Comments
 (0)