STM32 Output current capabilities
Your current source is going to source 9 mA. The microcontroller is going to sink it.
The maximum current for any one pin is 25 mA sink or source so your maximum of 9 mA is very safe. Watch out for the chip total current if you have multiple current sources that can be on simultaneously.