So i did more research and discovered stm32cubemx whicch has nice gui clock settings, i set sources for external crystals, but there is one problem i don't know how to add this code to my code that i'm making in platformio, first of all stm32cubemx has multiple choices for toolchain/ide ewarm, stm32cubeide, mdk-arm, sw4stm32, truestudio, makefile and other toolchains (gpdsc) and i tried ewarm and it generates multiple files which most important is main.c that has clock settings, would really appreciate if someone pointed me in the right direction. Also it says on the datasheet that most of the pins are 5v tolerant, but then i noticed that that is true only in open drain configuration and not for push/pull, is that true?, also the uc went short circuit and i have no idea what caused it, except for this because i have a 5v chip communicating directly to the uc.