How to compile stm32 code to pixhawk

I’m trying to use pixhawk hardware but don’t want to use px4 code.

In this case, it can be possible to write stm32 code and compile with stm32cubeIDE for pixhawk hardware ? ( never use px4 code)

I know it is not an effective way to flight drone , but want to know how to do this work.