Solved
on the STM32CubeIDE, once I initailize the necessary devices on .ioc, does it required to generatate the code automatically. once I enable a device, it always generate the code. I have to restart the whole code again from scratch.
Once I generate it. It deletes all the code work I have done.How can I disable that happening.