cancel
Showing results for 
Search instead for 
Did you mean: 

x-cube-cryptolib - Adding to application in Keil IDE

KauneR
Associate III

Hello,

I've to add the x-cube-cryptolib to our application.

I added to include path, the file cmox_low_level.c and the library file libSTM32Cryptographic_CM3.a.

I get these errors:

\Middlewares\ST\STM32_Cryptographic\lib\libSTM32Cryptographic_CM3.a(1): error: A1167E: Invalid line start
\Middlewares\ST\STM32_Cryptographic\lib\libSTM32Cryptographic_CM3.a(2): error: A1167E: Invalid line start
\Middlewares\ST\STM32_Cryptographic\lib\libSTM32Cryptographic_CM3.a(3): error: A1167E: Invalid line start
\Middlewares\ST\STM32_Cryptographic\lib\libSTM32Cryptographic_CM3.a(4): warning: A1313W: Missing END directive at end of file

 

What can I do to fix these errors?

Thanks in advance!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Yes. I reproduced the behavior.

You need to select "Library file" instead of "Assembly language .." in this menu:

SofLit_0-1708626273832.png

Right click on the library and select "Library file"

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

16 REPLIES 16
SofLit
ST Employee

Hello,

What if you try to build any example under Projects\NUCLEO-L152RE\ with Keil? do you have the same issue?

I pointed you to that folder because STM32L152 is a CM3 device and it is using libSTM32Cryptographic_CM3.a library.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello,

I'm not sure if the libSTM32Cryptographic_CM3.a is the correct one for me.

I have an STM32F101RD device.

I cannot build the Projects\NUCLEO-L152RE\ because I have not the required device for that project.

libSTM32Cryptographic_CM3.a is the correct one since STM32F101 is CM3 based MCU.

You can download the pack for STM32L151 from this link and have a try .. So this test can tell us if the lib is not corrupted.

PS: I build one of the projects under Projects\NUCLEO-L152RE and it compiled fine.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
KauneR
Associate III

Hello,

I 've downloaded the pack and tried one of the projects under Projects\NUCLEO-L152RE and it compiled correctly.

But my application cannot be build with the crypto lib...

Could this be a reason?

I do not have any hal header of the form

/* #include "stm32<series>xx_hal.h" */

in my project. So, I did not adapted this line in the file cmox_low_level.c.

Ok.. So no issue with the library.

I don't think the hal header is the source of the issue. 

I suggest you to see how a project from Projects\NUCLEO-L152RE is constructed to inspire from it.

You need at least to have something like this:

SofLit_0-1708624135534.png

Don't forget to define the include paths and the defines here:

SofLit_2-1708624316182.png

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
KauneR
Associate III

Hello,

Without crypto lib, my application can be build and is running.

For the adding of the crypto lib, I added the include path, the c-file cmox_low_level.c and the lib a file.

Do I have anything else to add like defines for the crypto lib or an additional entry for the linker or compiler?

Yes. I reproduced the behavior.

You need to select "Library file" instead of "Assembly language .." in this menu:

SofLit_0-1708626273832.png

Right click on the library and select "Library file"

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Yes, this helped!

For the first selection, a library .a file only could be taken as asm file. Change to library file, could build in the crypto library in my project.

But now, I get the errors:

Error: L6218E: Undefined symbol __HAL_RCC_CRC_CLK_ENABLE (referred from cmox_low_level.o).
Error: L6218E: Undefined symbol __HAL_RCC_CRC_RELEASE_RESET (referred from cmox_low_level.o).

From where can I get those defines?

Thanks in advance!

Did you include "stm32f1xx_hal.h" in cmox_low_level.c file?

Comment __HAL_RCC_CRC_RELEASE_RESET() as there is no CRC RCC reset feature on STM32F1 product.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.