Battery went dead in the Envoy one day. After replacing the battery the 4 wheel drive indicator light would not change with the selector and the 4 wheel drive light came on. After researching online I found that the engineers at GM forgot to set up the transfer control module with anything to save the memory, so basicly, it didn't know what to do. It also said you could take it to a dealer and they could reflash it for $100 and hope you never have battery problems again or locate a used one (2003 or newer because GM corrected their screw up after 2002 models). Make sure you research and get one that matches your 2002. Mine came from Ebay for $35 and was from a 2003 Trailblazer and it works great and I don't have to worry about the memory being gone if the battery goes.
Battery would hold charge. When it was swapped for another battery, the 4wd light came on and the indicator lights no longer illuminated. Went to the dealership to reprogram the module. After waiting 2.5 hrs, they said my car was ready. After paying, the light came on as soon as I got into my car. Told them and they tried to flash it again, but no luck. Now, they are saying I need a new transfer case control module. ~$400+tax. IDK how difficult it is to fix, but I may have to try.