Forum Discussion
Altera_Forum
Honored Contributor
21 years agoHi tns1,
Glad to hear you have u-boot running on your custom board. When you say you have only 2 MB ram, and that the size of your u-boot image is about 384k, I'm guessing you're using your elf file on a ROM-less target with the epcs bootloader ... correct? Or do you have some (parallel) flash? Other than relocating itself to TEXT_BASE, the only other code that is copied when u-boot starts up is the exception trampoline, which is copied to CFG_EXCEPTION_ADDR. This is a very small piece of code (3 instructions) that simply jumps to the exception handler (see cpu/nios2/start.S -- "_except_start"). This allows you to set TEXT_BASE anywhere in RAM (not just at exception address - 0x20). The u-boot "global data" struct, the heap, and the stack are placed immediately below TEXT_BASE (see include/configs/PK1C20.h -- CFG_MALLOC_BASE, CFG_SP_INIT, etc). All of which is configured to be about 128k for the PK1C20. Other than the above, the only thing that extends below the heap is the stack. So you shouldn't be seeing any memory use at the base of your ram. If TEXT_BASE is set to 0x009c_0000, for example, you shouldn't see anything (other than the stack) below say, 0x009a_0000. What address are you using for TEXT_BASE, and exception/reset? --Scott