Today I sucessfully flashed the RT5350F board. But my own openwrt build seems to be having some issue so I flashed back the prebuilt image supplied by Olimex in their Github . I am going to show you how flash the prebuilt image via TFTP.
TFTP an acronym for Trivial File Transfer protocol. It is a Server-Client based protocol which operates on top of UDP layer. It is widely used in Embedded Linux particularly U-boot for flashing firmware to the flash. For more more information refer to this wiki.
Below is the network setup I used for this purpose
I used my laptop running Lubuntu as TFTP Server and you need to install tftp server for setting up your own TFTP Server
# Install TFTP Server sudo apt-get install atftpd #Install TFTP Client for testing sudo apt-get install atftp
After installing the TFTP server you need to enable the server like this.
sudo update-rc.d atftpd enable
The TFTP Server will share its files from a directory specified in a configuration file. In case of Lubuntu the configuration file is /etc/default/atftpd.
USE_INETD=true OPTIONS="--tftpd-timeout 300 --retry-timeout 5 --mcast-port 1758 --mcast-addr 18.104.22.168-255 --mcast-ttl 1 --maxthread 100 --verbose=5 /srv/tftp"
Test your TFTP Server
You have installed the TFTP Server and Client. You also know the TFTP directory from the configuration file.
Now download the prebuilt binary file from Olimex Github and place it in the TFTP diretory.
wget https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/RT5350F/Prebuilt%20images/openwrt-ramips-rt305x-olinuxino-rt5350f-squashfs-sysupgrade.bin mv openwrt-ramips-rt305x-olinuxino-rt5350f-squashfs-sysupgrade.bin /srv/tftp/openwrt.bin
Now download the file using the TFTP Client and verify the md5sum
cd /tmp atftp tftp> connect localhost tftp> get openwrt.bin tftp> quit $md5sum /tmp/openwrt.bin ed5809f860610f3e452c27bf45fbc44f /tmp/openwrt.bin $md5sum /srv/tftp/openwrt.bin ed5809f860610f3e452c27bf45fbc44f /srv/tftp/openwrt.bin
If everything is working fine in the above steps then we are ready to flash the image to the board.
You need to get the serial terminal of the RT5350F board ready, in case if you do not know this then refer to
my getting started with rt535F post.
Open the serial console and be ready to type ’2′. Power the board and fire the number ’2′.
You should be prompted with a warning about flashing of the firmware with Y/N prompt.
Its a bit quick and tricky. You should not be too late to type ’2′ or type it too many times.
Otherwise the bootloader will not enter the flashing mode. But it will surely work if your timing is good :).
Check the IP address of your laptop and keep it ready beforehand and also get a free IP address for the board. I booted the board normally using previous firmware and router assigned an IP which I used for this purpose.
Once it enters the flashing mode, it will prompt for the device IP and then for server IP and then for the firmware file that needs to be downloaded and flashed. If everything is fine then it will flash like shown below. You may notice some errors during the download this is because of the fact that TFTP uses a unreliable UDP connection where packets can get lost. This is no worries as long as there errors are less. If there are too many error then your network is congested.
I will post about openwrt and python on my upcoming posts
The images used in the networ setup are taken from the below links