[Cryptech Tech] STM32 FMC problem
Peter Stuge
peter at stuge.se
Wed Aug 12 21:11:13 UTC 2015
Pavel Shatov wrote:
> First part of the problem with STM32 is that, if it tries to read or write
> from an unprogrammed FPGA, it hangs.
Why would it do this? Doesn't the STM32 know when the FPGA has been
programmed?
> I don't see any configurable FMC timeout in STM32.
A timeout would be a nice safeguard, but what about just making sure
that the FMC is never activated unless the FPGA *is supposed to* be
ready? (Note that a misbehaving/buggy bitstream will still cause
problems, at least it is not part of the common case.)
> Another strange issue is that STM32 still occasionally hangs while
> reading from programmed FPGA.
Fun!
> If I comment out the readback part, the program runs for as long as
> I want (hours), if I enable readback, the programs locks up within
> a minute. I don't understand, how come read and write are different?
Can you put a scope on NWAIT and verify that it is actually being
asserted at the correct time on both writes and reads?
> If I configure FMC to have fixed latency and ignore NWAIT, reading
> doesn't hang the processor anymore, but returns garbage, because
> STM32 samples the data bus at wrong time.
A workaround would be to make the FPGA reply with "I am busy" quickly
enough for fixed-latency transfer, and loop in software.
> The only possible explanation for this behaviuor I found, is item 2.9.4 in
> STM32F429 errata
Maybe it's an undocumented errata. How old is the STM32 product?
//Peter
More information about the Tech
mailing list