DTC P0504 - brake switch a/b correlation
Checking output signals from both brake switch. when all of them are On or OFF simultaneously, if abnormal signal is detected for more than 0.5 sec., an error is recognized. And if this condition lasts for certain period. PCM sets P0504. MIL(Malfunction Indication Lamp) turns on when the malfunction lasts till cosecutive 2 driving cycle.
DTC P0571 - brake switch A circuit
Checking input signals from brake lamp switch. under detecting condition, if the operation state of brake lamp switch does not change for more than 3 sec., PCM sets P0571. MIL(Malfunction Indication Lamp) turns on when the malfunction lasts till cosecutive 2 driving cycle.
The majority of the time it is a faulty brake switch that sets both codes, but I included testing procedures so that you can verify a faulty switch and not a wiring issue
There are 2 locknuts to remove to remove the brake switch, and disconnect the connector. Install new one in reverse. No special programming or anything: