Fix for DES mutex return code. Fix TLS bench thread shutdown. README.md updates.

This commit is contained in:
David Garske 2019-11-18 06:03:26 -08:00
parent 7819fedca7
commit b676c69561
3 changed files with 29 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# wolfSSL STM32 Example for Open STM32 Tools System Workbench
# wolfSSL STM32 Example for System Workbench for STM32 (Open STM32 Tools)
This example includes:
@ -23,7 +23,9 @@ These examples use the CubeMX Hal for STM32. If you'd like to use the older Stan
6. Adjust the micro-controller define in `Project Settings -> C/C++ General -> Paths and Symbols -> Symbols -> GNU C`. Example uses `STM32F437xx`, but should be changed to reflect your micro-controller type.
7. Build and Run
Note: You may need to manually copy over the CubeMX HAL files for `stm32f4xx_hal_cryp.c`, `stm32f4xx_hal_cryp_ex.c`, `stm32f4xx_hal_cryp.h`, `stm32f4xx_hal_cryp_ex.h`. Also uncomment the `#define HAL_CRYP_MODULE_ENABLED` line in `stm32f4xx_hal_conf.h`.
If you hardware support crypto acceleration then:
1. Manually copy over the CubeMX HAL files for `stm32f4xx_hal_cryp.c`, `stm32f4xx_hal_cryp_ex.c`, `stm32f4xx_hal_cryp.h`, `stm32f4xx_hal_cryp_ex.h`.
2. Uncomment the `#define HAL_CRYP_MODULE_ENABLED` line in `stm32f4xx_hal_conf.h`.
## Configuration
@ -34,7 +36,22 @@ The settings for the wolfSTM32 project are located in `<wolfssl-root>/IDE/OPENST
* To enable STM32F7 support define `WOLFSSL_STM32F7`.
* To enable STM32L4 support define `WOLFSSL_STM32L4`.
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.
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

View File

@ -872,8 +872,10 @@ static void client_thread(const void* args)
osSignalSet(info->server.threadId, 1);
info->client.ret = ret;
info->client.done = 1;
osThreadSuspend(NULL);
if (info->doShutdown)
info->client.done = 1;
} while (!info->doShutdown);
osThreadTerminate(info->client.threadId);
@ -1104,8 +1106,10 @@ static void server_thread(const void* args)
osSignalSet(info->client.threadId, 1);
info->server.ret = ret;
info->server.done = 1;
osThreadSuspend(NULL);
if (info->doShutdown)
info->server.done = 1;
} while (!info->doShutdown);
osThreadTerminate(info->server.threadId);
@ -1308,6 +1312,7 @@ void wolfCryptDemo(const void* argument)
case 't':
printf("Running wolfCrypt Tests...\n");
#ifndef NO_CRYPT_TEST
args.return_code = 0;
wolfcrypt_test(&args);
#endif
printf("Crypt Test: Return code %d\n", args.return_code);
@ -1316,6 +1321,7 @@ void wolfCryptDemo(const void* argument)
case 'b':
printf("Running wolfCrypt Benchmarks...\n");
#ifndef NO_CRYPT_BENCHMARK
args.return_code = 0;
benchmark_test(&args);
#endif
printf("Benchmark Test: Return code %d\n", args.return_code);

View File

@ -204,7 +204,7 @@
ret = wolfSSL_CryptHwMutexLock();
if (ret != 0) {
return ret;
return;
}
#ifdef WOLFSSL_STM32_CUBEMX