Hi,
Can anyone tell me what is the purpose of fly back diode use in l298 and motor circuit?
To stop the fly back voltage of course
Motors are inductive. When you remove power from an inductor, it gives an inductive kick that can easily amount to hundreds of volts for very short periods and which is of the opposite polarity of what it was fed.
Relays and solenoids are other examples where inductive kick back occurs.
Diodes are often the next best way to handle this. It's easy, but a snubber circuit can be tailored for fastest switching, most power transferred switching etc. In some circuits, zener diodes are used for faster switching.
However, it's a bit pessimistic saying that it should always be high speed diodes and I think that statement reveals a person that has never made any actual measurements and spec'd up what's needed - a bit like those saying that any circuit using a 555 needs a 100nF cap on pin 5 (of which more than half probably don't even know or care what its purpose is).