"High-Z" doesn't mean "at a high voltage". It means "high impedance" or "high resistance". It means "floating in the breeze like a party balloon".
"High-Z" isn't a state like "0" or "1" that can be propagated through a logic gate. It isn't a third level. "High-Z" on the input of a gate does not mean the output will be "High-Z".
> You are talking about signal being coupled across from the received data trace but if it was the case, wouldn't I see it even when reset goes well?
Once the Software has programmed the PA7 pin and is actively driving it, the capacitance of the other track will have no effect.
Whether this problem happens or not depends on how long the RESET is asserted, and then how long the software takes after RESET to program the pin and get it under control. Given that, it then depends on the exact current leakage conditions (and temperature and humidity) of a particular board that controls what the "floating pin" is doing during that time when the pin is uncontrolled. Residual contamination on the board (or within the board) and minute leakages in all chips on the track may result in it floating "Up", "Down", to some intermediate level and that superimposed with a fraction of any nearby AC signals.
In your testing you are making this worse by holding RESET down for a long time. This shouldn't happen during normal operation. So are you creating a problem that doesn't happen (or doesn't happen often) during normal operation?
> Sorry I did a mistake, what is called "TX at PA7" on the previous picture is TX at the output of a 74HCT125
> (with a pull-up to +Vcc) which is connected to a RS485 transceiver.
Each gate on a 74HCT125 has three pins. It has Input, Output and Output Enable. Does PA7 connect to the Input or the Output Enable? Since you say there's a resistor on the output, the circuit would make no sense unless PA7 connects to the Output Enable pin, the Input is grounded and the 74HCT125 is being used in the circuit as an inverter.
> So when RESET goes well, TX observed at the output of 74HCT125 shall be high because of the pull-up.
No, that doesn't follow at all. The output will only be pulled up by the resistor when the Output is disabled, and that only happens when the Output Enable pin is driven high. Or is "floating high". "Tri-state" isn't a property of a track or a pin that is propagated through the 74HCT125 from an input to an output. The gates only respond to the voltage on their inputs.
> But when the RESET goes wrong, output is low for some hundred ms meaning that PA7 is not high-Z and that leads to the problem.
PA7 is high-Z. "high-Z" means high RESISTANCE and not high VOLTAGE.
I'll prove it to you. Add a 100k pull-up resistor to PA7. Does that fix the problem?
Then, instead of the pullup, add a 100pF capacitor to PA7. That should hold the floating pin at its previous state for a few seconds or more. It should also swamp the capacitively-coupled receive signal and prevent the echo.
The original design is bad as it should have always had a pullup on PA7.
> So having a low level at the output of a 74HCT125 (with a pull-up on the output) doesn't necessary mean the input is forced to low?
That is correct. It doesn't necessarily mean the input is FORCED to low. It may also mean the input is FLOATING low due to the 10pF or so of trace, pin and silicon capacitance, and the lack of any current flowing into the trace to make it go high. From the maths, a picoamp per picofarad gives you one volt per second.
If you reset a board when it is driving the pin high it may stay "floating high" for the duration of the reset and you won't see a problem. Or it may "drift down" and echo.
If you reset a board when it is driving the pin *LOW* it may stay "floating low" for the duration, and that time you'll see a problem. Or it may "drift up" and echo.
So it may depend on the microsecond-level timing of when the Reset is generated on a working board. That may explain why sometimes it gives a problem and sometimes it doesn't.
For a newly-powered on board, the "floating voltage" could end up as anything.
Tom