For a perfect op-amp the output of U1 would be at the same voltage as C3, and therefore the two inputs of U2 would both be at the same level, so it is random whether the output of U2 would be low or high.
However, a LM324 has a bias current of typically 10nA (maximum 60nA). That current establishes a voltage of 1mV across R3. The output of U1 (and the non-inverting input of U2) will therefore be 1mV higher than the inverting input of U2, so the output of U2 will go high.
To make things slightly more complicated, the LM324 has an offset voltage of ±600uV (maximum ±3mV). That adds a random element to the inputs of U2, so the output could be either high or low at rest, with a preference for high.
If the impedances are equal, it would be truly random if it settled high or low in the absence an input. It is also likely to amplify random noise and interference and give an output signal when there is no input.Would there be a chance of it working if the impedances were equal then? Of course, not counting with the offset voltage, because it could still go wrong because of it. But if the output was low at rest by chance, with equal impedances could it work?
Also, I didn't use that driver circuit, but thank you for the warning
It would be better to bias the U2 input a little above 2.5V so that the output is definitely low for no input signal.
Also, with a 0.4V/us slew rate, an LM324 is not going to give anything that resembles a squarewave at 40kHz. It takes the whole half-cycle to slew from 0V to 5V, so the best you can hope for is a triangle.





