wolfssl/IDE/STM32Cube
David Garske ad7e636e34 Adds STM32H7 support. Tested on NUCLEO-H753ZI board.
STM32H753ZI at 480MHz

```
Running wolfCrypt Benchmarks...
------------------------------------------------------------------------------
 wolfSSL version 4.4.1
------------------------------------------------------------------------------
wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each)
RNG                250 KB took 1.047 seconds,  238.777 KB/s
AES-128-CBC-enc      4 MB took 1.004 seconds,    3.623 MB/s
AES-128-CBC-dec      4 MB took 1.004 seconds,    3.623 MB/s
AES-192-CBC-enc      4 MB took 1.000 seconds,    3.613 MB/s
AES-192-CBC-dec      4 MB took 1.000 seconds,    3.613 MB/s
AES-256-CBC-enc      4 MB took 1.000 seconds,    3.613 MB/s
AES-256-CBC-dec      4 MB took 1.000 seconds,    3.613 MB/s
AES-128-GCM-enc      3 MB took 1.004 seconds,    3.380 MB/s
AES-128-GCM-dec      3 MB took 1.004 seconds,    3.356 MB/s
AES-192-GCM-enc      3 MB took 1.004 seconds,    3.380 MB/s
AES-192-GCM-dec      3 MB took 1.003 seconds,    3.359 MB/s
AES-256-GCM-enc      3 MB took 1.000 seconds,    3.369 MB/s
AES-256-GCM-dec      3 MB took 1.004 seconds,    3.356 MB/s
CHACHA             850 KB took 1.020 seconds,  833.333 KB/s
CHA-POLY           650 KB took 1.015 seconds,  640.394 KB/s
POLY1305             4 MB took 1.004 seconds,    4.037 MB/s
SHA-256              3 MB took 1.004 seconds,    3.088 MB/s
HMAC-SHA256          3 MB took 1.004 seconds,    3.015 MB/s
RSA     2048 public         78 ops took 1.023 sec, avg 13.115 ms, 76.246 ops/sec
RSA     2048 private         4 ops took 1.682 sec, avg 420.500 ms, 2.378 ops/sec
DH      2048 key gen         6 ops took 1.165 sec, avg 194.167 ms, 5.150 ops/sec
DH      2048 agree           6 ops took 1.165 sec, avg 194.167 ms, 5.150 ops/sec
ECC      256 key gen        96 ops took 1.004 sec, avg 10.458 ms, 95.618 ops/sec
ECDHE    256 agree          50 ops took 1.027 sec, avg 20.540 ms, 48.685 ops/sec
ECDSA    256 sign           64 ops took 1.000 sec, avg 15.625 ms, 64.000 ops/sec
ECDSA    256 verify         32 ops took 1.039 sec, avg 32.469 ms, 30.799 ops/sec
Benchmark complete
Benchmark Test: Return code 0
```
2020-06-11 15:17:29 -07:00
..
Boards Adds STM32H7 support. Tested on NUCLEO-H753ZI board. 2020-06-11 15:17:29 -07:00
README.md
include.am Adds STM32H7 support. Tested on NUCLEO-H753ZI board. 2020-06-11 15:17:29 -07:00
main.c
wolfSSL.wolfSSL_conf.h Adds STM32H7 support. Tested on NUCLEO-H753ZI board. 2020-06-11 15:17:29 -07:00
wolfssl_example.c
wolfssl_example.h

README.md

wolfSSL STM32 Example for STM32 Cube IDE

This example includes:

  • wolfCrypt test
  • wolfCrypt benchmark
  • wolfSSL TLS client/server test using in-memory transfers

These examples use the CubeMX Hal for STM32. If you'd like to use the older Standard Peripheral library undefine WOLFSSL_STM32_CUBEMX in user_settings.h.

Requirements

Setup

  1. Using the STM32CubeMX tool, load the <wolfssl-root>/IDE/STM32Cube/Boards/*.ioc file for your target.
  2. Adjust the HAL options based on your specific micro-controller.
  3. Enable the security RNG/HASH/CRYPT if available.
  4. Enable the RTC and UART if available.
  5. Add wolfSSL via Additional Software and check/configure wolfSSL.
  6. Generate source code.

Configuration

The settings for the wolfSTM32 project are located in <wolfssl-root>/IDE/STM32Cube/wolfSSL.wolfSSL_conf.h. The section for hardware platform may need to be adjusted depending on your processor and board:

  • To enable STM32F2 support define WOLFSSL_STM32F2.
  • To enable STM32F4 support define WOLFSSL_STM32F4.
  • To enable STM32F7 support define WOLFSSL_STM32F7.
  • To enable STM32L4 support define WOLFSSL_STM32L4.
  • To enable STM32L5 support define WOLFSSL_STM32L5.
  • To enable STM32WB support define WOLFSSL_STM32WB.

The L5 and WB55 support ECC PKA acceleration, which is enabled with WOLFSSL_STM32_PKA.

To disable hardware crypto acceleration you can define:

  • #define NO_STM32_HASH
  • #define NO_STM32_CRYPTO

To enable the latest CubeMX HAL support please use: #define STM32_HAL_V2

If you are using FreeRTOS make sure your FreeRTOSConfig.h has its configTOTAL_HEAP_SIZE increased.

The TLS client/server benchmark example requires about 76 KB for allocated tasks (with stack) and peak heap.

Example Output

....MENU

.t. WolfCrypt Test
.b. WolfCrypt Benchmark
.l. WolfSSL TLS Bench
.e. Show Cipher List

Please select one of the above options:

Support

For questions please email support@wolfssl.com