When you file Chapter 7 bankruptcy, you need to declare your intentions on your secured debt, which is essentially that you are going to give it back, or keep it. If you are going to keep it, most people just continue making the payments, referred to as the retain pay option, or some people will reaffirm the debt 

If creditors choose to report information to credit bureaus, they are obligated to report accurate information. However, they are not required to report any information to the credit bureaus. Because some debtors have sued mortgage companies for reporting delinquent payments after a bankruptcy, (which can be a violation of the bankruptcy discharge if the person intended to surrender), most mortgage companies cease all credit reporting after a bankruptcy. It is possible, although not guaranteed, that reaffirming on the mortgage will cause them to resume reporting to the credit bureaus.  

So following a bankruptcy, one of the best ways to improve your credit score is to make payments a new debts following the bankruptcy. Even though the bankruptcy itself should not affect your ability to qualify for a mortgage or refinancing after 2-3 years, the lack of payment reporting on the credit bureau will keep youscore from improving as fast as it might have otherwise. With a good mortgage broker, this can often be overcome by manually showing proof of the payments, which should satisfy an underwriter. Some mortgage brokers will suggest that you can or should file a reaffirmation agreement, but that actually cannot be done after the bankruptcy has been discharged and closed. And even if it is done, it’s still not going to guarantee that the payments will be reported to the credit bureau, because there’s nothing you can do to compel the mortgage company to do that – their only obligation, should they choose to report to the credit bureau, is to make sure it is accurate.