Issue using enabled cache and TLS with iMXRT1051

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Issue using enabled cache and TLS with iMXRT1051

1,851 次查看
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,

标记 (3)
0 项奖励
回复
4 回复数

1,810 次查看
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 项奖励
回复

1,785 次查看
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 项奖励
回复

1,777 次查看
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

标记 (1)
0 项奖励
回复

1,816 次查看
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 项奖励
回复