I’m using mbedTLS source files included in my MPLABx project where I use a PIC32MX processor.
I have included the paths for the lib on the project properties of MPLABx.
In order to make an initial compilation, I had to do some alterations, described below.
(1) I have commented these defines on config.h:
(2) On net_sockets.c, changed this define value:
#define _POSIX_C_SOURCE 200112L
was changed to:
#define _POSIX_C_SOURCE 199506L
(3) On the MPLABx IDE, went to properties of project, then xc32-gcc compiler properties and placed an additional option for it: -D_POSIX_C_SOURCE=199506L
(4) I had to comment these 3 init functions:
After compile, the flash memory usage increased around 50KB, and I think this is ok for me.
( A ) This is what happen when I try to compile with line “1” (of the picture) uncommented:
–> undefined reference to `mbedtls_net_init’
When I click on the function “mbedtls_net_init” on main, the cursor goes to its prototype on net_sockets.h, and I can see this function is present on net_sockets.c (its a 1 line function).
( B ) when I try to compile with line “2” uncommented:
–> undefined reference to `mbedtls_entropy_init’
Same case as above. Goes to prototype when click on the function.
( C ) when I try to compile with line “3” uncommented:
–> ‘pers’ undeclared (first use in this function)
What this argument ‘pers’ mean?
I’m imagining I can pass some real random numbers to this function? and the quantity? I have always 12 bytes of random values obtained from RF noise available in a circular buffer. Am I correct? If not, what is the ‘pers’ parameter?
My config.h file was config-mini-tls1_1.h originally.
OBS: My intention is to stablish connection as a TLS/HTTPS client only, no need to act as a webserver.
I would like to receive some orientation to continue from that point.