How to boot u-boot from embedded ELF file in Microblaze core
Álvaro G. M.
alvaro at linenoise.info
Fri Nov 28 07:42:27 CET 2025
Hi all,
I've been working a bit on this and now I have more doubts than before...
On Fri, 2025-11-14 at 11:30 +0100, Álvaro G. M. wrote:
>
> [...]
> I can load this via xsdb and u-boot works and is capable of booting Linux
> kernel. However, there are a couple of things I don't understand.
>
> First off, if I set CONFIG_TEXT_BASE=0x80000000 (the exact beginning of RAM), it
> won't boot, not even early debug message will appear. Why is that?
>
I still haven't been able to solve this. Why is this value invalid? And which
value should I put there to embed u-boot.elf into the microblaze boot memory?
> And the second thing, my endgame is to embed u-boot.elf into Microblaze itself,
> so it acts as FSBL. I reduced the size to the maximum and I got a quite small
> binary, even smaller than my current bootloader (the one from Xilinx that loads
> an SREC image from flash), so there shouldn't be any issue from that part. To do
> this, I set CONFIG_TEXT_BASE=0x0, but again, no early boot debug message
> appears.
>
> I've tried different values for CONFIG_TEXT_BASE in this case, but none of them
> will work. Also, in either case, I'm not sure why, but I can't debug step by
> step via xsdb, I won't see what ASM or C code matches with current PC address.
> However, SPL will let me run it step by step via xsdb.
>
I've discovered that I can launch u-boot file with xsdb and debug step by step
via xsdb. But this file won't boot up properly, because somehow it seems to be
missing the DT? But the file is bigger than u-boot.elf. If I load u-boot.elf, I
get uboot console and am able to use sf probe and sf read to launch the kernel.
But this file is smaller and I can't debug it step by step. So I don't really
understand anything.
$ ls -al u-boot{,.elf}
-rwxr-xr-x 1 sslayer sslayer 1882032 Nov 27 10:06 u-boot
-rwxr-xr-x 1 sslayer sslayer 215224 Nov 27 10:06 u-boot.elf
$ file u-boot{,.elf}
u-boot: ELF 32-bit LSB executable, Xilinx MicroBlaze 32-bit RISC, version 1
(SYSV), static-pie linked, with debug_info, not stripped
u-boot.elf: ELF 32-bit LSB executable, Xilinx MicroBlaze 32-bit RISC, version 1
(SYSV), statically linked, not stripped
So, loading u-boot
xsdb% rst; dow u-boot ; con
Downloading Program -- uboot-2025.10/u-boot
section, .text: 0x80100000 - 0x80122e7f
section, .plt: 0x80122e80 - 0x80122e7f
section, .rodata: 0x80122e80 - 0x801286c7
section, .dynstr: 0x801286c8 - 0x8012891a
section, .hash: 0x8012891c - 0x80128aaf
section, .gnu.hash: 0x80128ab0 - 0x80128c6f
section, .dtb.init.rodata: 0x80128c70 - 0x8012c9ef
section, .data: 0x8012c9f0 - 0x8012e5bb
section, .dynamic: 0x8012e5bc - 0x8012e653
section, .got: 0x8012e654 - 0x8012f04f
section, __u_boot_list: 0x8012f050 - 0x8012f737
section, .dynsym: 0x80133344 - 0x80133723
section, .bss: 0x80133724 - 0x8013675f
section, .dynbss: 0x80136760 - 0x8013675f
section, .rela.dyn: 0x8012f738 - 0x80133343
100% 0MB 0.2MB/s 00:01
Setting PC to Program Start Address 0x80100000
Gets me this on the console:
<debug_uart>
No valid device tree binary found at 00000000
initcall_run_f(): initcall fdtdec_setup() failed
### ERROR ### Please RESET the board ###
But loading u-boot.elf; con
Downloading Program -- uboot-2025.10/u-boot.elf
section, .data: 0x80100000 - 0x80133723
100% 0MB 0.2MB/s 00:01
Setting PC to Program Start Address 0x80100000
Successfully downloaded /home/sslayer/Proyectos/ART/ESA/build/DRVM-software-
upgrade-buildroot/DRVM/output/build/uboot-2025.10/u-boot.elf
Info: MicroBlaze #0 (target 3) Stopped at 0x80100004 (Step)
Gets me this:
<debug_uart>
U-Boot 2025.10 (Nov 27 2025 - 10:06:43 +0100)
Model: Xilinx MicroBlaze
DRAM: 248 MiB
Core: 7 devices, 6 uclasses, devicetree: embed
Flash: ## Unknown flash on Bank 1 - Size = 0x00000000 = 0 MB
0 Bytes
Loading Environment from <NULL>... OK
In: serial
Out: serial
Err: serial
Model: Xilinx MicroBlaze
Unknown command 'echo' - try 'help'
Unknown command 'echo' - try 'help'
U-Boot-mONStR>
Any pointers I could get on these would be greatly appreciated
Thanks,
More information about the U-Boot
mailing list