Conditions for Clearing the DTC
WARNING: This page is about a different car, the 2007 Hummer H2. However, it is still accessible from the selected car via links, so may be relevant.
DTC B0051 is a latched code. You cannot clear a latched code. Replace the SDM after following the instructions in the circuit/system testing.