cancel
Showing results for 
Search instead for 
Did you mean: 

Slow TLS communication with NetXDuo STM32MP13

Clement7
Associate II

Hello,
I'm starting to port functional code from stm32f7 to stm32mp13. On the F7, I was using FreeRTOS+Lwip+mbedTLS. On stm32mp13, I switched to ThreadX+NetXDuo as it's the only supported stack. For my tests, I used the examples provided by the STM32CubeMP13 and pimped them up on the STM32MP13-DK board.

I ran a few tests on both architectures. The TLS connection is established much more quickly with the stm32mp13 than with the stm32f7, which is reassuring :

  • RSA certificate (2048 bits) : 52ms on mp1 VS 1400ms on F7.
  • ECC certificate (secp384) : 700ms on mp13 VS 4000ms on F7.

However, when it comes to data transfer after the handshake, I have a ratio of 10. For example, to transfer 340Kb, the mp1 takes 10 sec, while the f7 takes 1.4 sec. For the record, I've done data transfer tests without TLS, and in this case I'm faster with the mp1 than with the f7. So I deduce that the problem comes with the TLS. I don't know whether it's the stack itself or whether I'm misconfiguring NetXDuo.

What are the ideal settings with netxduo at TLS level for this kind of data transfer? 

Is anyone experiencing this kind of problem?

Thank you

Best regards.

1 REPLY 1
Clement7
Associate II

Hi again,

I solved my problem by disabling NX_SECURE_ENABLE_AEAD_CIPHER. The STM32MP13 is much faster without this option. 340Kb data transfer takes 500ms versus 10 seconds before removing this option.

 

So I can't use TLS1.3 with optimal performances since it uses AEAD ciphers.

And I can't contact TLS web server since most of them only accept AEAD ciphers.


My question now is : why this option is adding a x20 ratio to my TLS communication ? I suppose it comes from AES-GCM processing but I wouldn't have expected such slowness. I saw on this post : https://community.st.com/t5/stm32-mcus-security/x-cube-azure-h7-hw-cryptographic-acceleration/td-p/626407/page/2 that you will not provide hardware acceleration. Is there any solution to improve performance ?

 

Thanks for your reply.

Best regards