-
Notifications
You must be signed in to change notification settings - Fork 899
Tidy up Espressif ESP32 test and benchmark examples #5800
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
Conversation
Run crypt, bench, client and server on my MCU, ESP32-D0WDQ6-V3. Crypt and Bench work fine! On client and server, I am seeing many message like below:
We would want to display these message when user sets verbose to high? |
@@ -0,0 +1,23 @@ | |||
# Espressif Updates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want these new files to get bundled into the wolfSSL dist? They will need added to one of the include.am's if so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question. I don't know. What are the benefits of including in wolfSSL dist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little subjective if this UPDATE.md would be helpful or not in the distribution, I'd recommend though giving the dist bundle a try and making sure all files wanted are in it. On a unix like system with autoconf this is doing something like "./configure && ./config.status && make dist-zip" which will make the wolfssl-X.X.X.zip distribution having similar files to what would be sent out in release bundles.
@kaleb-himes I've added a few commits to address your suggestions. I've also added 4 new files for VisualGDB projects created when I was testing the Also - there's a new default stack size of 55,000 for the benchmark sdkconfig. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few small things.
wolfcrypt/src/sha256.c
Outdated
*/ | ||
InitSha256(sha256); /* unlock mutex, set mode to ESP32_SHA_INIT */ | ||
ESP_LOGE("sha256", "ERROR: hardware unlock needed in wc_Sha256Free"); | ||
ESP_LOGV("sha256", "ERROR: hardware unlock needed in wc_Sha256Free"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This indicates "ERROR" but is flagged as verbose. Please fix the message or leave as LOGE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text of the message has been updated.
@@ -0,0 +1,30 @@ | |||
#pragma once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am okay with pragma, but the #ifndef _TIME_HELPER_H
syntax is more portable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not aware of portability issues. Noted and changed.
|
||
#ifdef __cplusplus | ||
} /* extern "C" */ | ||
#endif No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure you have a new line at end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
|
||
#ifndef TIME_ZONE | ||
#define TIME_ZONE "PST-8" | ||
#endif // !#define TIME_ZONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use C style /* */
comments. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
/* free slot array */ | ||
void my_atmel_free(int slotId) | ||
{ | ||
if(slotId >= 0 && slotId < ATECC_MAX_SLOT){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (
and ) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
/* allocate slot depending on slotType */ | ||
int my_atmel_alloc(int slotType) | ||
{ | ||
int i, slot = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ATECC_INVALID_SLOT
, not -1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes, much better.
Description
This PR addresses #5795 and cleans up the benchmark and test Espressif examples.
Of particular interest:
wolfcrypt/test.c
now returnsargs.return_code
whenWOLFSSL_ESPIDF
is defined. (here)wolfcrypt/test.h
now declaresint wolf_test_task(void)
whenWOLFSSL_ESPIDF
is defined. (here)Other changes:
setup.sh
no longer copies benchmark.c(.h) to local project directory.benchmark/main
andtest/main
filenames fromhelper.c
tomain.c
, cleaned up code.main.h
main/CMakeLists.txt
to use onlymain.c
main
andwolfssl
for projectCMakeLists.txt
libs/Tigard.cfg
file for Tigard JTAG debugger.sdkconfig.defaults
with compiler optimizations and stack check.time_helper
for wolfssl_testssl_misc.c
in component cmake to fix warning: #warning ssl_misc.c does not need to be compiled separately from ssl.cFixes zd# (n/a)
Testing
Delete
wolfssl
component in ESP-IDFcomponents
directory. Reminder: there may be multiple versions inesp32\esp-idf\vX.Y.Z
Install fresh wolfssl component with
./setup.sh
from ESP-IDF directory.Assuming Espressif ESP-IDF in
/mnt/c/SysGCC/esp32/esp-idf
(e.g. VisualGDB), ensure ESP-IDF environment is configured:Assuming ESP32 on COM20 / ttyS20:
Observe output.
Successful output examples added to benchmark and test README.md files.
Checklist