[U-Boot] Why is there no MEMORY { } part in u-boot.lds?
Henry Choi
henry.omd at gmail.com
Fri Jan 1 02:06:20 CET 2016
Dear U-Booters,
First of all, I did not search the U-Boot mailing list archive with my
question, because I did not see a way to do this on the U-Boot mailing list
page <http://lists.denx.de/mailman/listinfo/u-boot>. I did search Google
for "MEMORY u-boot.lds memcpy" but nothing obvious turned up. So please
pardon me if this was explained before. Hopefully, you can just give me a
link that explains everything.
I have been compiling and running u-boot on the Emcraft stm32f7-som board
(MCU is ARM Cortex M7). Their U-boot forked off the mainline 6+ years ago,
so I tried to port the latest mainline, to teach myself u-boot. The most
obvious difference I can see is the relocation code, but I do not think
that explains my current problem, which is that my global variable(s) were
placed in on-chip flash (where text is). In the working code (again,
forked off 6+ years ago), _start() explicitly copies the .data and .bss
section from the flash to SRAM, and zeroes out .bss in RAM. But I have not
run into such code while single-stepping through in the debugger. The
readelf -S shows that the .bss in the flash, whereas it was in the RAM.
Even when I looked at the stm32f429-discovery port in the mainline, I could
NOT understand why the "MEMORY" part is no longer in
arch/arm/cpu/u-boot.lds. In u-boot.lds, there is a suggestion to read
arch/arm/lib/bss.c--which seems to be missing in the mainline. I don't
know what the OVERLAY keyword is doing for the .bss, and hope that I just
need to read 1 key document to understand how this is supposed to work.
Thank you very much for reading, and your understanding.
w/ regards,
Henry
More information about the U-Boot
mailing list