2016-03-02 12:19 AM
Hi,
I know there's not such easy think than helping someone describing its issue with prose, but here I try.In a current STM32F091RC building, linking and running project (gcc makefile), I wish I could basically cut-and-paste the SHA256 example provided in the STM32 Cryptographic library. I found compelling sample code in /Project/STM32_Cryptographic_Examples/HASH/SHA256/main.c.In my makefile, I added the usual -I to the cryptographic library, and added the linker directive so that it links M0_CryptoFW_2_0_6.a.The build is successfull, but at link time, the following is output :..//crypto/lib/M0_CryptoFW_2_0_6.a(crypto.o): In function `Crypto_DeInit':C:\SVN\MCD_STM32_Cryptographic_V2_0_6\LibraryCreation\Cortex_M0\Crypto_Sources_Files\crypto.c:(.text+0xfc90): undefined reference to `RCC_AHBPeriphClockCmd'collect2: error: ld returned 1 exit statusI ''grep''ed for RCC_AHBPeriphClockCmd in all the include files of my project (so that I could find the missing library), but the grep didn't yield anything.I wish someone could shed some light on this. From my Google research, I found people managing to use the crypto lib with STM32F4, but couldn't find relevant information for STM32F0 (although understant this low end MCU is not ideal).Thank you !2016-03-02 06:19 AM
Are you using the SPL or HAL ?
The code is attempting to turn on the CRC peripheral. You could create your own version of the routine. STM32F0308-Discovery_FW_V1.0.1\Libraries\STM32F0xx_StdPeriph_Driver\src\stm32f0xx_rcc.c/**
* @brief Enables or disables the AHB peripheral clock.
* @note After reset, the peripheral clock (used for registers read/write access)
* is disabled and the application software has to enable this clock before
* using it.
* @param RCC_AHBPeriph: specifies the AHB peripheral to gates its clock.
* This parameter can be any combination of the following values:
* @arg RCC_AHBPeriph_GPIOA: GPIOA clock
* @arg RCC_AHBPeriph_GPIOB: GPIOB clock
* @arg RCC_AHBPeriph_GPIOC: GPIOC clock
* @arg RCC_AHBPeriph_GPIOD: GPIOD clock
* @arg RCC_AHBPeriph_GPIOF: GPIOF clock
* @arg RCC_AHBPeriph_TS: TS clock
* @arg RCC_AHBPeriph_CRC: CRC clock
* @arg RCC_AHBPeriph_FLITF: (has effect only when the Flash memory is in power down mode)
* @arg RCC_AHBPeriph_SRAM: SRAM clock
* @arg RCC_AHBPeriph_DMA1: DMA1 clock
* @param NewState: new state of the specified peripheral clock.
* This parameter can be: ENABLE or DISABLE.
* @retval None
*/
void RCC_AHBPeriphClockCmd(uint32_t RCC_AHBPeriph, FunctionalState NewState)
{
/* Check the parameters */
assert_param(IS_RCC_AHB_PERIPH(RCC_AHBPeriph));
assert_param(IS_FUNCTIONAL_STATE(NewState));
if (NewState != DISABLE)
{
RCC->AHBENR |= RCC_AHBPeriph;
}
else
{
RCC->AHBENR &= ~RCC_AHBPeriph;
}
}
2016-03-14 09:53 AM
Hi Clive1,
Thank you for this snippet. It made the trick through building. I'm using HAL.KH