STM32F411 W5500 Coremark Test over SSL
This project is a test to compare the performance of two case.
First is using two stm32, and Second is using one stm32 to send data over SSL.
Overview
This project is a test to compare the performance of two case.
First case is using two stm32, send data that receving via spi communication from another stm32 to OpenSSL server on PC.
Second case is using one stm32, only send data to OpenSSL server on PC.
In both cases, the same amount of data is transmitted in the same cycle.
Test condition
- CPU : stm32F411RE
- CPU Clock : 100MHz
- SPI : 25Mbps / Full duplex / use DMA
- send data size : 2048
- send data cyclel : 10ms
- PC server : OpenSSL v.3.1.4
- Benchmark : Coremark v1.0 (Iteration 10000)
Hardware
<Dual MCU test>
- SPI2
STM32(PB13) <--- (CLK) ---> STM32(PB13)
STM32(PB14) <--- (MISO) ---> STM32(PB14)
STM32(PB15) <--- (MOSI) ---> STM32(PB15)
- SPI1
STM32(PA5) <--- (CLK) ---> W5500
STM32(PA6) <--- (MISO) ---> W5500
STM32(PA7) <--- (MOSI) ---> W5500
<Singel MCU test>
- SPI1
STM32(PA5) <--- (CLK) ---> W5500
STM32(PA6) <--- (MISO) ---> W5500
STM32(PA7) <--- (MOSI) ---> W5500
Software
<Structure>
- Dual MCU test
In the first case, on Board1 there are two tasks created: a send task and a coremark task. The send task is responsible for transmitting data via SPI, while the coremark task executes the Coremark tool.
On Board2, when SPI data is received, triggering an interrupt, the send task is executed by releasing a semaphore.
The send task sends the received data to the openssl server over the w5500.
To prevent SPI interrupts before transmitting, a stop signal is sent to the SPI master via GPIO pins. Once the transmission to the server is complete, a start signal is sent.
- Single MCU test
Second case, there are two tasks created: transfer tasks and core mark tasks. The transmission task serves to transmit data through the W5500, and the core mark task executes the core mark tool.
<mbedTLS configuration>
MBEDTLS_AES_C | Option to enable the module supporting the AES encryption algorithm. |
MBEDTLS_BASE64_C | Option to enable the module performing Base64 encoding and decoding. |
MBEDTLS_BIGNUM_C | Option to enable the module used for large integer operations. |
MBEDTLS_CAMELLIA_C | Option to enable the module supporting the Camellia encryption algorithm. |
MBEDTLS_CERTS_C | Option to enable the module providing authentication functionality using pre-defined certificates and keys. |
MBEDTLS_CIPHER_C | Option to enable the module handling symmetric and asymmetric encryption algorithms. |
MBEDTLS_DEBUG_C | Option to enable logging and debugging features. |
MBEDTLS_ENTROPY_C | Option to enable the module ensuring secure random number generation. |
MBEDTLS_MD_C / MBEDTLS_MD5_C | Options to enable the module supporting hash functions. |
MBEDTLS_OID_C | Option to enable the module handling Object Identifiers (OIDs). |
MBEDTLS_PLATFORM_C | Option to enable the module allowing platform-dependent function replacement in the mbedTLS library. |
MBEDTLS_RSA_C | Option to enable the module supporting RSA encryption and digital signature algorithms. |
MBEDTLS_SHA256_C | Option to enable the module supporting the SHA-256 hash function. |
MBEDTLS_SHA512_C | Option to enable the module supporting the SHA-512 hash function. |
MBEDTLS_SSL_TLS_C | Option to enable the module supporting the TLS/SSL protocols. |
MBEDTLS_X509_USE_C | Option to enable the module using X509 certificates. |
MBEDTLS_X509_CRT_PARSE_C | Option to enable the module parsing X509-formatted certificates. |
MBEDTLS_ECP_MAX_BITS | Option to set the maximum number of bits used in elliptic curve cryptography. |
MBEDTLS_ECP_WINDOW_SIZE_ENABLE | Option to enable window-based optimization in elliptic curve cryptography. |
MBEDTLS_ECP_WINDOW_SIZE | Option to set the window size used in elliptic curve cryptography. |
MBEDTLS_ECP_FIXED_POINT_OPTIME_ENABLE | Option to enable fixed-point-based optimization in elliptic curve cryptography. |
MBEDTLS_ECP_FIXED_POINT_OPTIM | Option to set the fixed-point optimization used in elliptic curve cryptography. |
MBEDTLS_ENTROPY_MAX_SOURCES_ENABLE / MBEDTLS_ENTROPY_MAX_SOURCES | Options to enable and set the maximum number of entropy sources for random number generation. |
MBEDTLS_SSL_MAX_CONTENT_LEN_ENABLE / MBEDTLS_SSL_MAX_CONTENT_LEN | Options to enable and set the maximum content length in TLS/SSL. |
MBEDTLS_SSL_CIPHERSUITES_ENABLE / MBEDTLS_SSL_CIPHERSUITES | Options to enable and set the TLS/SSL cipher suites. |
MBEDTLS_HAVE_ASM | Option to enable assembly code optimization. |
MBEDTLS_NO_UDBL_DIVISION | Option to disable the default implementation for integer division for integers larger than 64 bits. |
MBEDTLS_PLATFORM_MEMORY | Option to specify that the mbedTLS library should use platform-specific memory management functions. |
MBEDTLS_AES_ROM_TABLES | Option to store tables used in AES encryption in ROM to conserve RAM. |
MBEDTLS_ECP_NIST_OPTIM | Option to enable optimizations for NIST curves. |
MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES / MBEDTLS_NO_PLATFORM_ENTROPY | Options to disable the use of default entropy sources or platform-provided entropy sources. |
MBEDTLS_CIPHER_MODE_OFB / MBEDTLS_CIPHER_MODE_XTS | Options related to enabling symmetric encryption modes. |
MBEDTLS_ECP_DP_SECP256R1_ENABLED / MBEDTLS_ECP_DP_SECP384R1_ENABLED / MBEDTLS_ECP_DP_CURVE448_ENABLED | Options to enable ECC-related parameters. |
MBEDTLS_KEY_EXCHANGE_PSK_ENABLED / MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED / MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED / MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENAVLED / MBEDTLS_KEY_EXCHANGE_RSA_ENABLED / MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED/ MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED / MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED / MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED / MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED / MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | Option to enable various key exchange methods. |
MBEDTLS_SSL_PROTO_TLS1_2 | Option to enable secure communication using the TLS 1.2 protocol. |
Test Result
Dual MCU | Single MCU |
CoreMark scores were 170.17score higher with the Dual MCU.
The time to send data was 89.8% faster with the Dual MCU.