7 years ago.

How can I use mbed TLS library in my ARM project in Keil IDE?

I want to do an RSA encryption/decryption using my AT91SAM7S256(see datasheet at http://www.kynix.com/uploadfiles/pdf/AT91SAM7S256-MU.pdf) ARM MCU. After googling I found mbed TLS library. I download it on my Windows and extracted it in the directory of my project.

I was created the project using Keil IDE as below:

Project >> New mVision Project Assigning a name to the project Choosing "AT91SAM7S256" under Atmel MCUs Accepting the following suggestion: /media/uploads/jeremycool/uv5t0.jpg After that, in the following tab, I added the path of mbed TLS extracted directory to the Include Path of Keil(Path of header files, I think):

Project >> Option for Target "MyProjectName" >> C\C++

As the last step I did a right click on the project name in the right sidebar and using Add files to group AGroupName I added rsa.h and rsa.c of mbed TLS files to my project. I added a file named main.c that I myself was created it already with the simplest content:

<code>#include "rsa.h"

int main(){ return 0; }</code> Here are the pictures of above steps: /media/uploads/jeremycool/yrkqk.jpg Finally I tried to build this project from Project >> Build all target files, but I faced the following error : <code>Build target 'Target 1' assembling SAM7.s... compiling rsa.c... mbedtls-2.0.0\library\rsa.c(30): error: #5: cannot open source input file "mbedtls/config.h": No such file or directory compiling main.c... main.c(1): error: #5: cannot open source input file "rsa.h": No such file or directory Target not created <</quote>></code> Well, I added config.h to the group just like rsa.c and rsa.h and replaced "mbedtls/config.h" with "config.h" in the rsa.c file and that error removed. but another similar error appeared. Well I added about 10 files and edit the content as described but I still faced similar error.

I want to ask if is this the correct way? Am I should manually add all the files one by one? Or there is a better and efficient way? As the contents of mbed TLS library shows(make, makeinstall and so on) and as the extension of downloaded file shows(".tgz"), it is written for linux platform. Does that mean I can't use it in windows? As a starter, witch one is better for the above described project? Keil vs IAR IDE? Windows vs Linux platforms? Note that this is the first step of project, I think I must add other algorithms also.

Thanks in advance.

1 Answer

7 years ago.

I see you are using an Atmel processor. I have had good luck with Atmel Studio 7. By using ASF you can find a functioning program and modify it to your needs. You may have to modify some aspect of MBED code to get it to work, but at least you know your starting code works. By the way, the SAM E70 has crypto built in.