I changed to RTOS configFRTOS_MEMORY_SCHEME 3 and changed the linker script to allocate more heap memory and I do not get the out of memory error but generating keys takes 25s!
I only have a couple of tasks and even increased the task's priority.
I tried playing around with the mbedtls defines but nothing seems to help.
GenKeys 206685321 cycles 25005ms
#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0 // ?!? 0 /* To reduce peak memory usage */
#define MBEDTLS_ECP_WINDOW_SIZE 4 // ?!? was 2
#define MBEDTLS_ECP_MAX_BITS 256 // ?!? 384 /* Maximum bit size of groups */
#define MBEDTLS_AES_ALT 1
#define MBEDTLS_AES_ROM_TABLES 1
#define MBEDTLS_SSL_MAX_CONTENT_LEN 1024 // ?!? was (1024 * 10) /* Reduce SSL frame buffer. */
#define MBEDTLS_MPI_WINDOW_SIZE 4 // ?!? was 1
#define MBEDTLS_MPI_MAX_SIZE 32 // ?!? was 512 /* Maximum number of bytes for usable MPIs. */
Where is my problem now?
Thanks