Freezer freezing up, fridge getting warm

Been having an issue with the freezer freezing foods (rock hard ice cream/meats) but the refrigerator getting warm. this happens every couple of months. I unplug it and let it defrost overnight and then it works fine for a month or so. Then I notice ice frost building up in the freezer and a week or so later cold air will stop blowing out of the refrigerator compartment. I tried entering service test mode for 4,5,6 (not sure what 1,2,3 are for). 4 and 5 show P and 6 it moves from C to O or vice versa. This seems to happen more in the winter months when there is less humidity. We generally keep the cold settings at the default, have tried decreasing the temp on fridge and freezer to no avail. Any help is greatly appreciated.