I've never written a bootloader so I have no experience in this, but just as an idea, it is possible that an exception occurs while you are writing the data in the SDRam. If you have written the exception instruction at the exception address but not the actual exception code yet, if an exception occurs it can hang the CPU. It could be a good idea to write the text data first, without the exceptions and finish by writing the exceptions themselves and the reset code. Or be sure the exceptions are entirely disabled before you start writing. I don't know what the default bootloader does, but here are my ideas...