I am working on a custom board based on SAM4SD16C. I have written my own clock initialization code as per steps given in SAM4S datasheet. The initialization is working properly on SAM4SD32C and SAM4S16C but when I try to initialize the SAM4SD16C clock using the same code the system stops working and an error pops up "Failed to read SFR base address". I have double checked it on the other SAM4S and they are working without any problem. If i remove my clock initialization routine the system starts working fine but with 4MHz clock frequency as the default clock. If someone has any clue as to what is causing this behavior. Please let me know.
Thanks in advance.