2014-03-25 10:00 AM
Dear All,
I run into troubles when I try to start up the crypto processor of my STM32F215. After the line 1, the cryptoprocessor peripheral does not start up: line 1: RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_CRYP, ENABLE); line 2: CRYP_AES_ECB(MODE_ENCRYPT, (uint8_t*)AESKey, 128, CryptBufferIn, CRYPTBLOCKSIZE, CryptBufferOut); It is worth mentioning that I use our own hardware (STM32F215) that has an external 10MHz quartz. AHB2, APB1 and APB2 are all driven by the same frequency : 10MHz. We normally do not use the PLL. I even tried with a AHB2 much higher than 10MHz, it still does not start either. Now, if I use the same 2 lines code on the Eval Board STM3221G-EVAL (STM32F217), it works well. After investigation, the only difference I have seen between both hardware is the external quartz that is not 10MHz but 25MHz and the AHB2=120MHz Please, I would like to know if there is any minimum frequency from the external quartz to make the crypto processor work? I went through the STM32F2xx reference manual and datasheet but both do not mention anything regarding this issue. Any help would be welcome. Best regards, Thierry2014-03-25 10:15 AM
If it's anything like the SDIO peripheral, you NEED the PLL running to get ~48 MHz clock off the Q Tap of the PLL. This goes also to the RNG / HASH also.
2014-03-26 12:06 AM
Thanks Clive for your answer.
Before posting my question, I already made this try. It works well for the RNG (that we punctually use in our application) but it does not work for the crypto processor. No way to start it. This morning by doubt I made another try: - On our own hardware I changed the external quartz from 10MHz to 25Mhz - I re-used the system_stm32f2xx.c I use in the Example of the STM3221G-EVAL where the crypto processor normally starts - I double-checked the clocks invoking RCC_GetClocksFreq(&RCC_ClocksStatus); before running RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_CRYP, ENABLE); all them seems ok Unfortunatelly, the crypto processor still does not start. Any help would be appreciated, Best regards, Thierry2014-03-27 01:48 PM
Dear Thierry,
Please be in touch with your Local ST representative or distributor linked to your Company account to get the full answer for your case. you need to send us back that device STM32F215 not containing the HW crypto engine and our sales will replace it for you for free. I know that you already contacted us via our web tool, you will be served. Cheers, {STOne-32}2014-03-27 07:36 PM
RCC->AHB2ENR |= RCC_AHB2ENR_CRYPEN;
if (RCC->AHB2ENR & RCC_AHB2ENR_CRYPEN)
puts(''CRYP Unit PRESENT'');
else
puts(''CRYP Unit ABSENT'');
2014-03-28 05:10 AM
2014-03-28 10:28 AM
My boards typically use a 205 running off at 120 MHz off a 16 MHz HSE crystal. I have built a number using the STM32F215ZGT6 parts we sampled from ST. I did a quick test this morning running directly from the 16 MHz, with the AHB/APB1/APB2 running at 16 MHz also, and no PLL running.
I used the some standard library code to do an AES-128 encrypt and decrypt test and got back my original data. It was not particularly thorough, but probably sufficient to exercise the engine. If you'd like to discuss privately, off forum, my email is sourcer32@gmail.com2014-03-28 11:21 AM
Dear Thierry,
As I said, Please proceed by returning back that device to your distributor our STMicro nearest sales office, they will change it for free. we have shipped some early devices without HW crypto engine despite the fact they are either STM32F217 or STM32F215 from our factories and are proceeding by an RMA. Cheers, {STOne-32}2014-03-30 11:50 PM
Dear STOne-32,
From our point of view, we are not talking here about one single micro to be replaced but many of them that are all already solded on board meanwhile the project is getting late. Best regards, Thierry