Hi All,
I cannot tell what's the root cause in a simple word. But from the symptom you mentioned, it looks like the stack is corrupted after Uboot is relocated to SP=90000a60. So although the uboot prompt is showed, when you execute any uboot console commands, it messes up.
If you have a debugger such as DS-5 debugger, it may be easier to debug further. If you do not have, it may be a bit difficult. What I can suggest is to compare the SRAM content before relocation and the DDR content after the relocation, especially for the stack part.
The adr instruction is based on the assumption that your pc contains 0x8008 at the time that you execute it. The ldr is going to pull in a link time value which is the same no matter where you are.
If for example this code is actually located at address 0x20000000 then when that first instruction (the adr is a pseudo instruction, in the disassembly it is a sub of 8), the adr, is executed now you get a 0x20000008-8 = 0x20000000 and you compare that with 0x8000 they dont match. If you are running the code at 0x8000 then 0x8008-8 = 0x8000 and the two match.
Just read the code and look up the adr instruction (or do what I did and just try it and examine the output of the compiler/tools, and/or run it on hardware if that doesnt show the answer).
PrepaidGiftBalance
firstcallonline Wrote:
Did you have a fix on this issue? Facing same issue but no response from anyone and couldn't find this topic troubleshooting in anywhere.
Hello morad596,
In our case, the issue was with the SDRAM controller implemented on the FPGA. It had been configured to allow only 32bit access resulting in 8-bit and 16-bit accesses failing. To showcase this issue I kept the stack and heap in the internal SRAM itself and restricted the static and dynamic allocations inside the code to minimal so as to fit inside the SRAM. After these tweaks, all the string prints including the prompt were proper.
The SDRAM controller was later reconfigured to allow 8,16 and 32-bit access and everything worked fine for us.
Hope you can resolve your issue ASAP. Best of luck.
Regards,
Amar