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!

 

16 REPLIES 16
KauneR
Associate III

Where can I find this 

"stm32f1xx_hal.h"c file?

In my application, there is no *_hal.h file included. And within the drivers folder of the crypto lib, there is no "stm32f1xx_hal.h" file, only files for other STM32 products.

SofLit
ST Employee

Hello,

Normally you can inspire from STM32CubeF1 examples from here  to understand the folder/files structures. All files you need are there.

Meanwhile I've tried to port a project on F103 platform. You need to add the folder STM32_Cryptographic under the path Middlewares\ST. It builds without any issue but I didn't test it. It's for a project build reference.

So you need to do it on your own. 

Hope it helps.

 

 

 

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,

You suggested to 

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

Can I additionally comment __HAL_RCC_CRC_CLK_ENABLE?

Is there a negative side effect for this? Will the crypto lib still work correctly?

Our application uses self written code, there is no *hal.h header file.

And in the STM32Cube_FW_F1_v1.8.0.7 you gave me, the only line for __HAL_RCC_CRC_CLK_ENABLE is in the file 

stm32_hal_legacy.h

#define __CRC_RELEASE_RESET __HAL_RCC_CRC_RELEASE_RESET

 

So, there seems not to be a usage of this define.


Can I additionally comment __HAL_RCC_CRC_CLK_ENABLE?

Is there a negative side effect for this? Will the crypto lib still work correctly?

Our application uses self written code, there is no *hal.h header file.


You should not comment CRC clock enable as CRC is used by the cryptolib library. 


Our application uses self written code, there is no *hal.h header file.

And in the STM32Cube_FW_F1_v1.8.0.7 you gave me, the only line for __HAL_RCC_CRC_CLK_ENABLE is in the file 

stm32_hal_legacy.h

#define __CRC_RELEASE_RESET __HAL_RCC_CRC_RELEASE_RESET


I said previously and unfortunately, there is no CRC RCC reset feature in STM32F103. I don't know what is the impact on the project. So you need to do some tests to be sure.

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,

Thank you for your answer.

Sorry that I mixed the two defines.

I did find in the STM32F103 project 

#define __HAL_RCC_CRC_CLK_ENABLE() do { \...

in the file stm32f1xx_hal_rcc.h

Now, after inclusion of the header files, my application compiles correctly with the crypto lib. But this is not the proof, that the crypto lib will correctly work...

Is it additionally necessary to include c files for the hal of the STM32F103 project to ensure correct working of the crypto lib? Or is the inclusion of the header files sufficient?

Thanks in advance!

 

I've already attached a project for you reference. You can follow the project structure and you can play with includes or c files to determine which file is used or not.

I just wanted to help you to successfully compile an example which was the case (the object of the thread). Now it's up to you to run the example and determine if it's working well or not. If not you can open a new thread for this new question so other members here can help you..

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

Okay, thank you for the help.

I'll open a new thread for a new question, if necessary:-)