Tweak FSMC initialisation. Without these tweaks, it works just after flashing, but then fails after subsequent resets.