pulkin / micropython

MicroPython implementation on Ai-Thinker GPRS module A9 (RDA8955)
https://micropython.org
MIT License
103 stars 30 forks source link

Add mbedtls support #93

Open arlucio opened 3 years ago

arlucio commented 3 years ago

I tested connection using axTLS and with this update using mbedtls, and I can say after that using mbedtls it is working much better, more stable, not giving errors which I was having a lot using axTLS.

For this to work it was necessary to update to the last version of Micropython and to revert commit c846c69 that produced performance drop and was generating bugs on make with mbedtls. I added mbedtls related files based on stm32 port.

The C SDK originally already has mbedtls files so on build it generates lots of errors of "multiple definitions" and other errors, but in the end it builds ok and generates the hex working properly. If anyone knows if there is a way to exclude the mbedtls files of C SDK in the Makefile, would be great.

I'm using it this way and it is working well, but would be great if anyone that understands better Makefiles, to help with the errors produced on build.

pulkin commented 3 years ago

I think you should be more specific about what kinds of errors you experienced in the past. Besides, I cannot add code that has problems at linking stage. You may look into strip in the Makefile to specifically cut off CSDK functions.

Otherwise I would at least try to use the built-in mbedtls to conserve a portion flash memory. There is a fair chance that the built-in library works even better.