[U-Boot] Handling images(.jpg, .bmp etc) in u-boot

Anatolij Gustschin agust at denx.de
Sun Mar 31 15:21:04 CEST 2013


On Sun, 31 Mar 2013 04:54:35 -0700 (PDT)
bhargavak <anur.bhargav at gmail.com> wrote:

> That's a very nice explanation..
> Here's what I will do, please tell me if the whole procedure is right.
> 
> I have a SD-card partitioned as follows:
> boot: FAT32, holds a MLO and u-boot.bin through which I boot my device (runs
> on OMAP4470)
> rootfs: mostly empty always (ext4 currently), I will format it as FAT32
> 
> I copy "slide-0.bmp" into the rootfs partition and define
> "CONFIG_SYS_HUSH_PARSER".

Note that CONFIG_SYS_HUSH_PARSER is not necessary if you do not
use 'for' or 'while' loops (but it won't hurt, an maybe it is
already defined in your config file).

> Then I stop the bootloader before the kernel starts, do "setenv" as follows,
> and "saveenv"
> > show_one=fatload mmc 0:2 40001000 slide-${i}.bmp;bmp d 40001000

Note that when Wolfgang showed you this example, it was only
for reference how it could be done. You shouldn't blindly input
commands without understanding what these commands are supposed
to do. You also should read the command documentation in the
U-Boot manual and apply common sense. For example the load address
40001000 in the above example is valid only for a particular
architecture, starting offset of the DRAM memory and available
memory size. Using 40001000 address in your case might be wrong.

In your case only 512 MiB DRAM is available, you need to figure
out where the DRAM starts. Use "bdinfo" command and look at
the  DRAM bank start value, i.e.:

U-Boot > bdinfo
...
DRAM bank   = 0x00000000
-> start    = 0x10000000
-> size     = 0x40000000
...

In this example the memory starts at address 0x10000000, so a
reasonable load address could be 10001000 (since the area
starting from 10000000 might contain interrupt/exception vectors,
we skip 0x1000 sized block at start of DRAM).

for setting the environment variable use

 setenv show_one 'fatload mmc 0:2 40001000 slide-0.bmp;bmp d 40001000'

but replace 40001000 address with a valid address for your board.
On my board from the above example I could use address 10001000.


> Then do the following:
> > run show_one
> 
> I should be able to see the image on the screen ?

Provided you used a valid load address and enabled support
for "bmp" command and splash screen, yes.

> Is there any other configuration options that I should enable ?

I do not know your board and do not have your U-Boot source, so
cannot tell for sure. But you need at least

CONFIG_CMD_BMP
CONFIG_SPLASH_SCREEN
CONFIG_VIDEO
CONFIG_CFB_CONSOLE
CONFIG_VGA_AS_SINGLE_DEVICE
CONFIG_SYS_CONSOLE_IS_IN_ENV

and the config option to enable your video driver.


> For some reason "saveenv" was not working for me yesterday, when I tried to
> experiment with the "splashimage" environment variable.
> I do not remember the exact error it threw, I could post the error first
> thing tomorrow from my workplace.
> As a workaround can I set above variables in my "OMAP" config header ?

Look at the CONFIG_EXTRA_ENV_SETTINGS definition in your config
header. It includes additional definitions for embedded environment.
You could add your variables in this list, but it is only used
if the default environment is used. Your board is not in mainline,
so I cannot tell exactly what else might be needed.

> My u-boot version is "U-Boot 1.1.4-geb3fa991".

This version is _very_ old, we do not support it.

Thanks,

Anatolij


More information about the U-Boot mailing list