Re:Debugging bare-metal STM32 from the seventh level of hell
by jpieper on Monday August 08, 2022 @06:41AM
(#32384040)
That is possible, although here the consecutive writes were to different ADC peripherals. The ADC peripherals do share some common configuration and triggering, but I believe are otherwise largely independent.
Re:Debugging bare-metal STM32 from the seventh level of hell
by Taniwha on Monday August 08, 2022 @10:30AM
(#32385826)
but they're going over the same peripheral bus (from the CPU, and being synchronised to a subsystem with likely the same ADC clock domain - I'd design that hardware once (metastability stuff is notorious for being hard to get right, especially when you are trying to transfer multiple related bits across clock boundaries at the same time, and you want them all to arrive together)
Re:Debugging bare-metal STM32 from the seventh level of hell
by jpieper on Monday August 08, 2022 @10:41AM
(#32385963)
Yep, there is probably one clock domain for all the ADCs, although there are two different prescalers (one for ADC1/2 and another for 3/4/5).
I could see one of the writes getting lost. In this case though, the ADC enable is what seems to be timing sensitive, however the ADCs always end up enabled properly. It is just that a write that was significantly earlier (the one that sets the prescaler) seems to be lost, despite the register reading back that it was read correctly.
I would expect that if the synchronization failed, reads back would read the wrong value?
My guess is that the circuit they're using gets confused if you start a second write when the first is not yet done