So I pinched PA6 and PA7 from the CT input scan on the emonTxShield demo (they weren’t being driven anyway) and used them for OPAMP2 in follower mode. So my pinout now looks like:
Then I hooked up the signal generator to PA7 with a rail-to-rail triangle signal (Yellow trace) and also probed the output PA6 (Green trace). The datasheet says the opamps are good for 0.5 mA so I loaded up PA6 with a 6k R to GND. The Pink trace is Green minus Yellow (i…e. output - input).
The results are pretty good. Green is so identical to Yellow you can’t really see it. Pink shows about a 20mV offset between the two. I tried with the factory trimming and the user trimming but I couldn’t notice any difference to the ~20mV offset. BTW, if you do want to do a user trimming and self calibration, you can do all of that from the GUI under Configuration->OPAMP2. It’ll then generate the call to HAL_OPAMP_SelfCalibrate() for you, from within MX_OPAMP2_Init(), after it’s called HAL_OPAMP_Init().
[EDIT] - actually I see the exact same 20mV even when I connect both probes to PA6 so I think it’s just a scope measuring limitation rather than an indication of an offset out of the opamp.