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

Anatolij Gustschin agust at denx.de
Sun Mar 31 12:38:04 CEST 2013


Hi,

On Sun, 31 Mar 2013 02:30:00 -0700 (PDT)
bhargavak <anur.bhargav at gmail.com> wrote:

> Hi
> 
> Thank you for that heads up.
> In one of posts above a reference to the following code fragment is made, it
> uses a fatload command
> 
> > For example, this is the whole "code" for a slide show demo I've been 
> > using on a number of trade shows: 
> 
> >        bootdelay=6 
> >        show_one=fatload mmc 0:2 40001000 slide-${i}.bmp;bmp d 40001000 
> >        slide_show=while mmc rescan; do for i in 1 2 3 4 5 6 7 8 ; do run
> > show_one ; sleep ${delay} ; done ; done 
> >        bootcmd=run slideshow
> 
> Can you please explain the "show_one" and the "slide_show" commands ?
> And, do I just put this into board config ?

"show_one" and "slide_show" are environment variables containing
a sequence of U-Boot commands. These can be executed by "run show_one"
or "run slide_show".

When "show_one" is executed, U-Boot runs two commands:

 fatload mmc 0:2 40001000 slide-${i}.bmp

and

 bmp display 40001000

The first command loads a file (i.e. "slide-0.bmp") into
SDRAM memory at address 0x40001000. It loads the file from
the MMC/SD-Card which is connected to the first available
SD-Card controller. The file is loaded from the second
partition on the SD-Card which is a FAT partition (therefore
fatload command). The "${i}" in the file name is used
to be able to load images with different file names when
this command is executed in a loop.

The second command reads the image at address 0x40001000
in SDRAM, decodes the image data and copies it into the
frame buffer.

"slide_show" command is a loop which test for SD-Card
presence ("mmc rescan") and executes another inner loop
in which the "show_one" command is running 8 times
with index "i" counting from 1 to 8 (so that 8 different
images are loaded into SDRAM while each loop iteration).
After each load/display operation in the loop the execution
of the next loop iteration is delayed by the amount of
seconds specified in the "delay" environment variable.

Note that these loops will only work if U-Boot was built
with enabled CONFIG_SYS_HUSH_PARSER in the board configuration.

You normally won't put these commands into board config.
You have to setup the environment variables on the U-Boot
command line using "setenv" command and save them using
"saveenv" command.

HTH,

Anatolij


More information about the U-Boot mailing list