cancel
Showing results for 
Search instead for 
Did you mean: 

STM32_CrypLib help needed

cwalker
Associate
Posted on January 26, 2016 at 22:56

Hello,

First of all, I am very new to ARM development. I have a project that uses the an STM32F4XX.. and I have the STM32_CrypLib V2.0.6 library and example code. However, the example code uses the driver sin STM32F4xx_StdPeriph_Driver, where as the project I want to use it in uses a more recent set of HAL drivers. I thought it should be easy to change all the include paths, and point the library to my newer HAL, however I am still getting these linking errors:

.\STM324x7I_EVAL\STM324x7I_EVAL.axf: Error: L6218E: Undefined symbol RCC_AHB1PeriphClockCmd (referred from crypto.o).

.\STM324x7I_EVAL\STM324x7I_EVAL.axf: Error: L6218E: Undefined symbol RCC_AHB2PeriphClockCmd (referred from crypto.o).

.\STM324x7I_EVAL\STM324x7I_EVAL.axf: Error: L6218E: Undefined symbol RNG_Cmd (referred from crypto.o).

.\STM324x7I_EVAL\STM324x7I_EVAL.axf: Error: L6218E: Undefined symbol RNG_DeInit (referred from crypto.o).

I seems that crypto.c is part of the library I am using (M4_CryptoFW_RngHW_2_0_6.lib) and it seems to have been build against the StdPeriph drivers. I can make this build by adding these drivers from the StdPeriph set:

stm32f4xx_rng.c

stm32f4xx_rcc.c

but I feel this is hackish and might not work as expected. To build I also had to make changes to stm32f4xx.h. Am I making this overly complicated? Can anyone point me in the right direction?

Thanks!

Chris

2 REPLIES 2
Posted on January 27, 2016 at 00:41

The hackish part is using a mismatched library, once you've decided to do that the most effective way to do it is just create the shim/wrapper functions you need to do that. I'd just create the four functions to enable the linkage without dragging in a whole lot of other extraneous things that would clash or contaminate the name space.

The functions here have minimal complexity, and could be emulated with no changes to include files, etc.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Nesrine M_O
Lead II
Posted on January 27, 2016 at 09:28

Hi chrisw,

Yes these function are used internally by the library. So you should use the StdPeriph_Driver. 

If you want to use the HAL driver you have to use the new library version STM32 crypto library v.3.1.0 

for the SW algorithms which doesn’t use the hardware acceleration and for the RNG hardware peripheral you can use directly the HAL driver.

-Syrine-