Tidy up Espressif ESP32 test and benchmark examples#5800
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.
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.
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.
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. |
…essif_fix_5795
dgarske
left a comment
There was a problem hiding this comment.
Looks good, just a few small things.
| */ | ||
| 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.
This indicates "ERROR" but is flagged as verbose. Please fix the message or leave as LOGE.
There was a problem hiding this comment.
The text of the message has been updated.
| @@ -0,0 +1,30 @@ | |||
| #pragma once | |||
There was a problem hiding this comment.
I am okay with pragma, but the #ifndef _TIME_HELPER_H syntax is more portable.
There was a problem hiding this comment.
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.
Make sure you have a new line at end.
|
|
||
| #ifndef TIME_ZONE | ||
| #define TIME_ZONE "PST-8" | ||
| #endif // !#define TIME_ZONE |
There was a problem hiding this comment.
Use C style /* */ comments. Thanks!
| /* free slot array */ | ||
| void my_atmel_free(int slotId) | ||
| { | ||
| if(slotId >= 0 && slotId < ATECC_MAX_SLOT){ |
| /* allocate slot depending on slotType */ | ||
| int my_atmel_alloc(int slotType) | ||
| { | ||
| int i, slot = -1; |
There was a problem hiding this comment.
Use ATECC_INVALID_SLOT, not -1.
There was a problem hiding this comment.
ah yes, much better.
Description
This PR addresses #5795 and cleans up the benchmark and test Espressif examples.
Of particular interest:
wolfcrypt/test.cnow returnsargs.return_codewhenWOLFSSL_ESPIDFis defined. (here)wolfcrypt/test.hnow declaresint wolf_test_task(void)whenWOLFSSL_ESPIDFis defined. (here)Other changes:
setup.shno longer copies benchmark.c(.h) to local project directory.benchmark/mainandtest/mainfilenames fromhelper.ctomain.c, cleaned up code.main.hmain/CMakeLists.txtto use onlymain.cmainandwolfsslfor projectCMakeLists.txtlibs/Tigard.cfgfile for Tigard JTAG debugger.sdkconfig.defaultswith compiler optimizations and stack check.time_helperfor wolfssl_testssl_misc.cin component cmake to fix warning: #warning ssl_misc.c does not need to be compiled separately from ssl.cFixes zd# (n/a)
Testing
Delete
wolfsslcomponent in ESP-IDFcomponentsdirectory. Reminder: there may be multiple versions inesp32\esp-idf\vX.Y.ZInstall fresh wolfssl component with
./setup.shfrom 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