How to control direction of brushed dc motor using pixhawk 4?

I want to control the direction of a brushed dc motor using a motor driver and Pixhawk 4. I have connected the direction pins of the motor driver to AUX1 and AUX2 of pixhawk. The left motor is connected to main output 1 and the right motor to main output 3. I have changed the parameters servo_output1 = 73, servo_output_3 = 74, PWM_MOT_TYPE = 3, Relay1 = 50 and Relay2 = 51. The motors are running successfully in one direction but are not able to change the direction. Can someone please help me with this issue? It will be a great help. Thank you