[Cryptech Tech] STM32 FMC problem
Pavel Shatov
meisterpaul1 at yandex.ru
Thu Aug 13 12:24:34 UTC 2015
On 13.08.2015 0:11, Peter Stuge wrote:
> 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?
Xilinx FPGAs have dedicated CONFIG_DONE output, that get asserted only
after successful configuration. In Novena bunnie used this output to
implement "apoptosis" function, that I don't completely understand.
>
>
>> 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.)
>
Yes, but faulty bitstream should not kill the processor.
>
>> 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?
>
Yep, has already been done. I copied NWAIT logic from EIM arbiter. Since
it works fine for iMX6Q, the problem should be on the STM32's side, I
presume.
>
>> 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.
>
I don't completely understand this. For fixed-latency transfers NWAIT
signal is ignored.
>
>> 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
> _______________________________________________
> Tech mailing list
> Tech at cryptech.is
> https://lists.cryptech.is/listinfo/tech
>
--
With best regards,
Pavel Shatov
More information about the Tech
mailing list