I recently discovered that Luther wrote his hymn “A Mighty Fortress is Our God” in the midst of the black plague on Psalm 46, not at the start of the reformation. Steven Lawson records:

“By 1527, Luther showed signs of becoming weary in the battle for truth. He was stricken by tightness in his chest, dizziness, and fainting spells. He experienced weakness so severe that he feared he was about to die. Luther lamented: “I spent more than a week in death and in hell. My entire body was in pain, and I still tremble. Completely abandoned by Christ, I labored under the vacillations and storms of desperation.”41 Compounding his weakness, the Black Plague swept through Germany. Many fled, but Luther chose to remain in Wittenberg and opened his home as a hospital. Amid the crisis, he almost lost his young son to death. At this soul-crushing time, he wrote his most famous hymn, “A Mighty Fortress Is Our God,” based on Psalm 46. God is “a bulwark never failing,” he wrote, whose “kingdom is forever.” Without doubt, God was the inexhaustible source of Luther’s strength.”

(from the Heroic Boldness of Martin Luther)

“To the choirmaster. Of the Sons of Korah. According to Alamoth. A Song. God is our refuge and strength, a very present help in trouble. Therefore we will not fear though the earth gives way, though the mountains be moved into the heart of the sea, though its waters roar and foam, though the mountains tremble at its swelling. Selah There is a river whose streams make glad the city of God, the holy habitation of the Most High. God is in the midst of her; she shall not be moved; God will help her when morning dawns. The nations rage, the kingdoms totter; he utters his voice, the earth melts. The Lord of hosts is with us; the God of Jacob is our fortress. Selah Come, behold the works of the Lord, how he has brought desolations on the earth. He makes wars cease to the end of the earth; he breaks the bow and shatters the spear; he burns the chariots with fire. “Be still, and know that I am God. I will be exalted among the nations, I will be exalted in the earth!” The Lord of hosts is with us; the God of Jacob is our fortress. Selah”

(Psalm 46:1–11 ESV)