Thanks for your reply.
The only reason is, that I know the Arduino IDE already and some of the Arduino library functions like millis(), micros(), analogRead(), digitalWrite(), Serial.print(). I guess that I need to learn other similar functions in a new environment, and a new IDE.
I have seen more references on how to get started with STM32CubelIDE and STM32CubeProgrammer. I did however also see an initiative to use Arduino IDE called SM32duino. But the forum about that seems not active anymore. So part of my question about this is also to find out, if using the Arduino IDE in this context is worth the effort. It seems that you recommend not to use Arduino IDE for this purpose.