most newer trucks look for the resistance of the magnets connector the truck, If it doesn't see the magnets resistance or the resitance becomes shorted to ground it gives you a error message and in the case with GM trucks the controller will not put out power to the brakes in the trailer. If your connector is clean and every spot you feel has good connections like the back of the trailer wire plug in the truck (very rare a factory connector has problems ) if its a plug a RV dealer installed start looking there for poor connections. the next area to look at is many manufactures put the brake power wires threw the axle tube from left to right side wheels. This is a VERY BAD IDEA , the wire get chafed inside the tube because its not supported. I had a trailer this happened to ,cut the wires pulled them out the far side and found very little insulated wire useable! I tie rap an new cable on the top side of the axle and pulled it for the next 3 years with out a problem. look at those two areas first , also check the 4" sq box right behind your pin box , maybe you have a bad spice . rough roads and many miles and the wires in the axel don't last .
Mark & Melissa
2015 Redwood RL38 , Kodiak disk brakes , 17.5" tires , 8K Morryde IS