>the stm32 firmware hello world from cubeide caused temperature spikes due to spinning
That should never happen unless you are using a high end 1GHz+ MPUs.Check your GPIOs to make sure there are no shorts.