2024-02-22 07:32 AM - last edited on 2024-02-23 12:06 AM by Peter BENSCH
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!
Solved! Go to Solution.
2024-02-22 10:25 AM
Yes. I reproduced the behavior.
You need to select "Library file" instead of "Assembly language .." in this menu:
Right click on the library and select "Library file"
2024-02-22 08:45 AM - edited 2024-02-22 08:47 AM
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.
2024-02-22 09:14 AM
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.
2024-02-22 09:20 AM
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.
2024-02-22 09:35 AM
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.
2024-02-22 09:50 AM - edited 2024-02-22 09:52 AM
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:
Don't forget to define the include paths and the defines here:
2024-02-22 09:57 AM
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?
2024-02-22 10:25 AM
Yes. I reproduced the behavior.
You need to select "Library file" instead of "Assembly language .." in this menu:
Right click on the library and select "Library file"
2024-02-23 02:47 AM
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!
2024-02-23 08:14 AM
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.