Pixhawk 4 only getting power through USB

I have built a drone with raspberry pi + pixhawk 4 connected to the power management unit (I/O-PWM port and power 1 port) which is connected to the battery. The raspberry pi and the gps and the pixhawk 4 seem to get power and work fine only when it is connected to the computer via USB.
When I plug the battery into the PMU, I hear two beeps but no power seems to go to pixhawk.
I first thought was the safety switch but no power is going to GPS as well.
Is anyone having a similar issue or know a potential solution?