The resons for updating the u-boot is either if you have a new
u-boot version or have accidentally erased the current u-boot (completely or
replaced it with a non-functioning u-boot).
There are basically three ways to update the u-boot, which resides in the internal
FLASH memory of the LPC2478.
- ISP functionality in the LPC2478, i.e., downloading via UART #0.
- JTAG, i.e., let the JTAG debugger update the internal FLASH memory of the LPC2478.
- Via the u-boot itself. First download the binary file to (starting at) address 0xa1000000 and
then unlock the internal FLASH memory area, erase it and finally copy (i.e., program) the
downloaded file into the FLASH.
Let's investigate the last (and most common) option below.
The u-boot commands below accomplish an update of the u-boot itself.
tftpboot a1000000 u-boot.bin
protect off 0 2ffff
erase 0 2ffff
cp.b a1000000 0 $(filesize)
The variable filesize is automatically set after tftpboot to the length of the downloaded
program image file.
Note that it's the *.bin file that should be loaded (as opposed to the *.hex file). If the
update command fails the u-boot program image in internal FLASH may be lost. In that case,
only the two first options (JTAG or ISP) can be used to write the new u-boot program image into
internal FLASH.
It can be a good idea to first test that the download process works by only downloading the
new program image to try to run it without actually writing the new program image into
internal FLASH. The two command lines below accomplish this.
This way, you always keep a known good u-boot in internal FLASH.
After testing that the new u-boot works/is correct, the commands above can be executed to
actually write the new program image into FLASH.
tftpboot a1000000 u-boot.bin
go a1000000
The new u-boot image file can of course come from different sources. In the example above,
it is transferred over Ethernet and the TFTP protocol. If this for some reason is not suitable
a MMC/SD memory card can be used. Write the image file into the card and insert it into
the LPC2478 OEM Base Board connector. Exchange the tftpboot command line above with
the following two commands.
mmc
fatload mmc 0 a1000000 u-boot.bin
This will load the image file from the MMC/SD memory card into RAM (from where it can be copied
into the internal LPC2478 FLASH).
|