This is definitely not a noob question, but a real problem.
If you have already switched the STM32G030 to open drain and switched off pulls as proposed by @Community member , obviously a current flows from DIM into the GPIO, which raises the voltage at the GPIO. Actually, this shouldn't be the case since DIM is connected to 5V via a 200kOhm (typ).
However, it is often misunderstood that the 5V tolerance is only given when VDD is active, i.e. between 2.0-3.6V for the STM32G030 (see also AN4899, section 5.2.2). At powering up of the system, it can happen that VDD is applied later than the voltage of PT4115, which violates this condition and possibly brings the STM32 into a latch-up.
Section 5.3.3 of AN4899 suggests a zener for this case, which is of course an additional device.
What also works: replacing the direct connection to the PT4115 using an additional transistor, e.g. a small npn with base series resistor or a logic level n-channel FET for clean open-collector or open-drain controlling.
Good luck!
Regards
/Peter
In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.