====== Upgrading Carambola 2 bootloader ======
ATTENTION! Bootloader upgrade is a risky operation and should not be performed unless absolutely necessary! If anything goes wrong
during this process (power shortage, mistype, etc.) the board will be BRICKED (broken). Keep in mind that warranty does not cover
Carambola 2 module if it is damaged due to user's fault.
* Install and launch TFTP server on your PC. Linux users can install 'tftpd-hpa' package and Windows [[http://tftpd32.jounin.net/|TFTPD32]].
* Copy bootloader image to your TFTP folder. In this example bootloader is stored in 'carambola2_u-boot.bin' file.
* Connect serial console to Carambola2 and reboot it.
* Once the device starts booting, press to enter U-Boot console.
''
U-Boot 1.1.4-g393bc3d1-dirty (Nov 13 2014 - 10:49:20)\\
\\
=====================================\\
Caraboot v2.2-dev (AR9331) U-boot\\
http://www.8devices.com/\\
-------------------------------------\\
DRAM: 64 MB\\
Flash: 16 MB\\
Net: eth0, eth1\\
=====================================\\
\\
Hit '' key(s) to stop autoboot: 0\\
ar7240>\\
''
* Set IP adresses of Carambola2 board (e.g. 192.168.1.1) and TFTP server (e.g. 192.168.1.20)
''ar7240> setenv ipaddr 192.168.1.1; setenv serverip 192.168.1.20''
* Download firmware from TFTP server (file name can be changed if you need)
''
ar7240> tftpboot 0x80060000 carambola2_u-boot.bin\\
Using eth1 device\\
TFTP from server 192.168.1.20; our IP address is 192.168.1.1\\
Filename 'carambola2_u-boot.bin'.\\
Load address: 0x80060000\\
Loading: ##############################################\\
done\\
Bytes transferred = 232348 (38b9c hex)\\
ar7240> \\
''
* Check that the 'bytes transferred' is the same as the actual file size. If not, repeat again.
* Erase old bootloader and write the new one (this is the step that can brick your device).
''
ar7240> erase 0x9f000000 +${filesize}; cp.b 0x80060000 0x9f000000 ${filesize}\\
....\\
Copy to Flash... ...done\\
ar7240>\\
''
* Flashing is done, you can now reset your board.