Hello @Sud_09 and welcome to the Community,
Using OPAMPs of the STM32G4 series can indeed be used as differential amplifiers and supporting both inverting and non-inverting inputs. When using the OPAMPs as differential amplifiers, consider the following: gain settings, performance parameters, and environmental factors to ensure reliable operation.
I recommend you the Application note AN5306, which provides practical examples, including examples of OPAMP configuration (inverting and Non-inverting amplifier configurations).
In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks