Anyone got Mediatek Linkit Smart 7688 TFTP Boot working?


Has anyone ever succeeded using tftp boot on the Mediatek Linkit Smart 7688, and if so, how?

This would help a great deal with development.

The u-boot for this device offers an option (1) to use TFTP to load an image directly into DRAM and run it, and a second one from the u-boot command line with tftpboot and bootm. Both seem to be broken. I can successfully load an image and start it, but it crashes during boot on a paging error. This happens with both the original vendor image as well a with a newly built image. Both images run fine when flashing through LuCI.

I searched the forum and Googled but I cannot find anything on this. Any help (even a conformation that this is indeed broken) would be be very much appreciated!

Cheers, Bart van Hofwegen

Is your board same as mine ?
MT7688AN with module HLK-7688A
In that case may be my post can help you

It is not the same but hat should not matter. You use bootloader option 2 to load and flash. What I want to do is use option (1) to load an image through TFTP and run it in DRAM without flashing, for faster debug and testing purposes. That just does not seem to work. Thanks for your response!

But did you take in account the fact that addresses of ram and flash are different? So the code must be compiled according to the address at wich it will be executed.
Am I wrong?

Hi JM, thanks for your reply, but that is not entirely true. When the image is loaded from flash in the "normal" boot procedure, it is also loaded into RAM and then executed by the boot loader. The difference with the TFTP method is that the boot loader does not get the image from flash but from a TFTP server, in this case my development machine. This speeds up development and testing because it excludes the need to flash the image. I have used this u-boot feature some time in the past with a different distribution for a TQ module, but that used a somewhat different u-boot fork.

I did however notice that when the image is loaded from flash in the "normal" boot, it is loaded and started at 0x80000000, but the tftpboot method tries to use 0x80a00000 for some reason. I tried to use 0x80000000 in stead, but to no avail.

Solved. Another cup of coffee and digging up memories from my earlier project helped.

To use u-boot's TFTPboot, you need to build a ramdisk image, not the standard squashfs one.

Run make menuconfig and select Target images -> ramdisk. Build the image, now you have a file called openwrt-ramips-mt76x8-LinkIt7688-initramfs-kernel.bin in the bin/targets/ramips/mt76x8 directory. Use that file for loading through TFTP and all is well.

The process can be sped up by setting the filename in the u-boot environment, as well as the server IP to load from. Open the u-boot terminal with option 4 from the boot menu and type:

setenv bootfile openwrt-ramips-mt76x8-LinkIt7688-initramfs-kernel.bin
setenv serverip

Also, give the board itself an IP address that can be reached on your network in environment var ipaddr

Now, you can use option (1) with the correct defaults set:

1: System Load Linux to SDRAM via TFTP. 
 Please Input new ones /or Ctrl-C to discard
        Input device IP ( ==:
        Input server IP ( ==:
        Input Linux Kernel filename (openwrt-ramips-mt76x8-LinkIt7688-initramfs-kernel.bin) ==:openwrt-ramips-mt76x8-LinkIt7688-initramfs-kernel.bin

Thank you Bart for these valuable explanations.
I was confusing the 'microprocessor code style' (executed from flash) with the 'OS code style', like OpenWrt where flash is used like an hard disk and code executed from ram. But if I understood well, there are some differences in memory allocation which require changing some settings.
I am waiting for my second MT7688 kit and when I receive it I will try your method.

JM, let me know the results please. And you might have thought of this yourself of course, but: do not use the initramfs image to flash the device, only to run it from ram. Thanks again for thinking along with me!

Hi Bart
I receive my second MT7688 kit and, following your instructions, compile a ramdisk image and upload it through option 1 of uboot
I confirm the bin image is loaded at 0x80a00000 and then openwrt execute with no problem.

:+1: Thanks for the update!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.