[Cryptech Tech] STM32 FMC problem

Joachim Strömbergson joachim at secworks.se
Tue Aug 18 13:51:04 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Aloha!

Pavel Shatov wrote:
> Well, the problem as I see it, is that STM32 doesn't handle 
> variable-latency transfers over FMC very well. This variable latency 
> arises, because data transfer over FMC runs at its own frequency,
> while cores in FPGA can work at some another frequency. One possible
> solution is to clock cores in FPGA using FMC_CLK. This will make
> whole system synchronous. This was actually not possible with iMX6Q,
> because it could only generate EIM_BCLK during read/write
> transactions. STM32 on the other hand can generate FMC_CLK
> continuously.

(The FMC_CLK can be set to only run during accesses too! ;-)

Running the FPGA and CPU synchronous would make life much easier. The
question is what useful values one can get FMC_CLK to. The STM32 we want
to use is driven by a 25 MHz clock source which is then used to generate
the 180 MHz core clock.

180/4 = 45 MHz would be possible to use in the FPGA, but then the cores
would be running fairly slow. Esp the RSA and (and possibly EC)
performance will be affected. But timing margin in the FPGA will be
awesome. ;-) In the Alpha board drawing we have stated that the FPGA
should be fed with a 50 MHz clock (same as the FPGA on the Novena). So
the difference in performance would be 10% lower.

180/2 = 90 MHz _could_ work for all cores (based on my test
implementations). But the timing margin for several of the cores will be
low and getting timing closure will become harder. The performance of
the cores will be good though.

Looking at chapter 37.5.5, the FMC_CLK will be either /4 or /2 of HCLK
depending on the width of the bus. In the Alpha drawing we have stated
that the width is 32 bits so FMC_CLK should be 45 MHz, correct?

I would suggest trying to run some simple design with a single core
block (for example SHA256) in synchronous mode and see if you can get it
to work without errors over the FMC interface.

BTW: Do you have a serial port or similar connected to the STM32 on the
bridge board for debugging? What does you setup look like?

- -- 
Med vänlig hälsning, Yours

Joachim Strömbergson - Alltid i harmonisk svängning.
========================================================================
 Joachim Strömbergson          Secworks AB          joachim at secworks.se
========================================================================
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJV0zhIAAoJEF3cfFQkIuyNamgQAIvhGVkYH/o9nnRFHj3N8Vm6
SWMCZfs7fTFdDAg+yCTKIpqlTCCgsss0/ZOCn8Ph4Oe+xISHG6oHa55DhjcODQJW
Yyu99QURR+jkdu15NSPZmjig4er9u9QE5RL1Z0Mnt4szGVHpcRxopvzQRBn7BFbB
YenIbGcOQidLHWn19xFREkj+biWF8Lgcq6us2vSoHDymRQQZQ1WL15/RQWigjuSP
pf2mP9NksT8ovDudDlrr6bvfpKNCxaJ+u16tGPzfbaN0Q/++Y/I0gxNkqYRTg7s+
9sHLUpFILhspeY2Qts8c8KpK1LsHPxEC84Ntjug2FRjq/37+TkqWjnP5+qY9nD7X
EKE/zeNt4m943SzyF0uD4TmK2ZwP5z27ZWcEEHFl1rDtmsmkMmi/lY0Et/5V6qCL
ZAuKRLIyEMAfoLNz8RwQG0VzqoF6ee2LgAIFmtkPOhXU8yjHXYXDymxBYz1GZcmf
1Gf4KfbCwffQyMgDZJST167UuzFExvW4GQK8m/bLVOIMyMnSIay/yDoq3GxtivdY
y74WwR2QgDfWJSOeSEx11jtdD2KlXCSIUx8MUhWRhAIBtpvmW7+6VDzjae4v3PfH
EGw9UnArrBD05M4IOOjtiQbiS17VfDpXC1x8zDdLBNpwJ0lEoesrzT21Xy29E1R3
rUuTc4AByqx0lBY/XnEy
=dlQT
-----END PGP SIGNATURE-----


More information about the Tech mailing list