
Dear Wolfgang, Heiko,
On Monday 13 June 2011 07:29 PM, Aneesh V wrote:
Dear Wolfgang,
[snip ...]
But this didn't work. It crashes at the first printf(). The reason is init_baudrate() needs global data and global data is initialized in board_init_f(). Further, we can not move global data initialization earlier because for global data we reuse low level stack used by lowlevel_init().
gd = (gd_t *) ((CONFIG_SYS_INIT_SP_ADDR) & ~0x07);
On second thoughts I realize that the stack in internal RAM is still in use in board_init_f(). So, how does this work at all? The global data and the stack seems to be overlapping!
Please note the register dump after the above instruction. Note that R8(gd) and R13(sp) are very close.
N _ R0 0 R8 4030DF80 SP> 12345678 Z Z R1 0A R9 12345678 -04 80E80078 C C R2 4030DED4 R10 40304350 FP> D78772CA V _ R3 5555 R11 0002FE40 +04 4049A39E I I R4 0 R12 80E80068 +08 F5A73CF4 F F R5 10 R13 4030DF78 +0C 7B317D39 T _ R6 12345678 R14 80E80078 +10 ED3CFCF0 J _ R7 12345678 PC 80E80880 +14 FEECEC6A svc SPSR 0 CPSR 600001D3 +18 6DB22EB2
Am I missing something?
best regards, Aneesh