Issue using enabled cache and TLS with iMXRT1051

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue using enabled cache and TLS with iMXRT1051

1,850 Views
KarenMczm
Contributor II

Hi, 

I am working on an MQTT round-trip test and I want to improve my performance, I tried enabling the D-Cache and the times improve with TCP port but when I tried with TLS the connection is lost, I read about the coherency problem, so I moved the mbedtls library into a non-cacheable region but the problem still present.

Regards,

Tags (3)
0 Kudos
Reply
4 Replies

1,809 Views
KarenMczm
Contributor II

Thanks for the reply, I did the following changes in the code and the linker file to place mbedTLS into non-cached memory.

KarenMczm_0-1629306306622.png

KarenMczm_1-1629306317659.png

KarenMczm_2-1629306335779.png

KarenMczm_0-1629306515583.png

 

Thanks,

Karen

0 Kudos
Reply

1,784 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Karen, 

The OCRAM is handled differently than the DTCM and ITCM memories. What happens if you place the mbedTLS into either the DTCM or ITCM? 

Regards,
Victor

0 Kudos
Reply

1,776 Views
KarenMczm
Contributor II

Hi Victor,

I already solved the issue by moving the lwip library into the non-cacheable region as shown in the following image:

KarenMczm_0-1629752232577.png

 

I tested with the mbedtls library in the non-cacheable region and outside of it. In both cases, it works, but if I put mbedtls in the non-cacheable region, the round trip using TLS is a bit slower than if I just leave lwip in the non-cacheable region.

Thanks for the support,

Karen

Tags (1)
0 Kudos
Reply

1,815 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Karen, 

In which memory specifically are you placing the mbedtls library? To work with mbedTLS, you need to place the mbedTLS heap allocator in a non-cached memory that can be accessed by the DCP. 

Also, you might find useful the following application note:

Using the i.MXRT L1 Cache (nxp.com)

Regards,
Victor 

0 Kudos
Reply