Upgrade LininoIO from U-boot for Windows users

If you need upgrade the Linino IO from u-boot and you are a Windows user then follow this guide:

- First be sure that: 
1) the board is plugged to PC via USB cable; 
2) the board is connected via Ethernet; 
Arduino Yun 
3) the YunSerialTerminal sketch is been uploaded into the board from File>Examples>Bridge menu, use the Arduino IDE 1.7.8 or later, you can download it here
YunSerialTerminal sketch

 - Second download the kernel and rootfs files, you can use these links: 
1) if you have an Arduino Yun, download the kernel file and the rootfs file;

2) if you have an Arduino Yun Mini, download the kernel file and the rootfs file.

All the new images are present on Linino.org 
Here you can find the latest image here


- Third install a TFTP server: 
1) you can use Windows TFTP Utility, download it here
2) Install the tool as administrator. 
TFTPUtil GUI: License 
TFTPUtil GUI Setup: Installation Options 
TFTPUtil GUI Setup: Installation Folder 
TFTPUtil GUI Setup: Completed 
3) Open Windows TFTP Utility and set it: 
TFTPUtil GUI application 
TFTPUtil GUI  
Select the path of your files. 
TFTPUtil GUI root folder 
TFTPUtil GUI: Options 
Set the ip address. 
TFTPUtil GUI Option setup 
Click OK when you finish the setting; 
TFTPUtil GUI activated 
4)Check that the Server is working.

 - Enter in u-boot console: 
1) open a Serial monitor, for example putty; 
2) push the Yun RST and insert the command lin, when it is requested; and click on Send button; 
3) set the server ip address and the board ip address:

 
 
setenv serverip ‹tftp-server-ip›;
setenv ipaddr ‹linino-board-ip›;
 
 

In this example the setting is:

 
 
linino>setenv serverip 192.168.60.124;
linino> setenv ipaddr 192.168.60.182;
 
 

Image 
4)Test the TFTP server doing a ping, in this example:

 
 
linino> ping 192.168.60.124
 
u-boot console  

If the ping is successful, then you continue the guide, else check the network and the tftp server or click here to follow this other guide to realize a connection point to point.  

Kernel

Download the kernel file, if you haven't done already : 
- If you have an Arduino Yun click here 
- If you have an Arduino Yun Mini click here.

- Transfer the kernel file: 
- For  Arduino Yun:

 
 
tftp 0x80060000 lininoIO-generic-linino-yun-kernel.bin;
 
 

- For  Arduino Yun Mini:

 
 
tftp 0x80060000 lininoIO-generic-linino-yun-mini-kernel.bin;
 
 


In this example it is used an Arduino Yun: 
Only if the transfer is successful then continue the procedure, else check the network and the TFTP server and try again the transfer 
Kernel transfer

- Delete the old file, pay attention that the command and the address are correct:

 
 
erase 0x9fEa0000 +0x140000;
 
 

Delete old kernel

- Copy the new file, pay attention that the command and the address are correct

 
 
cp.b $fileaddr 0x9fea0000 $filesize;
 
 

Copy new kernel

Rootfs

Download the Rootfs file, if you haven't done already: 
- If you have an Arduino Yun click here
- If you have an Arduino Yun Mini click here.

- Transfer the Rootfs file using the below command: 
- For Arduino Yun:

 
 
tftp 0x80060000 lininoIO-generic-linino-yun-rootfs-squashfs.bin;
 
 


- For Arduino Yun Mini:

 
 
tftp 0x80060000 lininoIO-generic-linino-yun-mini-rootfs-squashfs.bin;
 
 


In this example it is used an Arduino YUN. 
Only if the transfer is successful then continue the procedure, else check the network and the TFTP server and try again the transfer 
Rootfs transfer

- Delete the old file, pay attention that the command and the address are correct:

 
 
erase 0x9f050000 +0xE50000;
 
 

Delete old Rootfs

- Copy the new file, pay attention that the command and the address are correct

 
 
cp.b $fileaddr 0x9f050000 $filesize;
 
 

Copy new Rootfs

- Now type Reset:

 
 
linino> reset
 
 

Optional steps

If you want erased the UBoot environment partition, in order to apply the new default environment, it is possible to delete it with the command:

 
 
linino> erase 0x9f040000 +0x10000;
Erase Flash from 0x9f040000 to 0x9f04ffff in Bank # 1
First 0x4 last 0x4 sector size 0x10000
  4
Erased 1 sectors
linino>reset;
 
 

After the board reboot a message like *** Warning - bad CRC, using default environment will appear on the console.

 
 
U-Boot 1.1.5-linino-g17593166-dirty (Oct  4 2015 - 02:12:32)
Linino Board (ar9331) U-boot
DRAM: 64 MB
Top of RAM usable for U-Boot at: 84000000
Reserving 218k for U-Boot at: 83fc8000
Reserving 192k for malloc() at: 83f98000
Reserving 44 Bytes for Board Info at: 83f97fd4
Reserving 36 Bytes for Global Data at: 83f97fb0
Reserving 128k for boot params() at: 83f77fb0
Stack Pointer at: 83f77f98
Now running in RAM - U-Boot at: 83fc8000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x18
flash size 16777216, sector count = 256
Flash: 16 MB
*** Warning - bad CRC, using default environment
In:   serial
Out:   serial
Err:   serial
Net:   eth0: b4:21:8a:00:00:00
eth1: b4:21:8a:00:00:01
eth0, eth1
autoboot in 4 seconds (stop with 'lin')...
linino>
 
 

To avoid the warning message give the following command on the UBoot console

 
 
linino> saveenv
Saving Environment to Flash...
Protect off 9F040000 ... 9F04FFFF
Un-Protecting sectors 4..4 in bank 1
Un-Protected 1 sectors
Erasing Flash...Erase Flash from 0x9f040000 to 0x9f04ffff in Bank # 1
First 0x4 last 0x4 sector size 0x10000
  4
Erased 1 sectors
Writing to Flash... write addr: 9f040000
done
Protecting sectors 4..4 in bank 1
Protected 1 sectors
linino>
 
 

Set properly the booargs changing the console to ttyATH0:

 
 
linino> setenv console ttyATH0,250000
linino> saveenv
Saving Environment to Flash...
Protect off 9F040000 ... 9F04FFFF
Un-Protecting sectors 4..4 in bank 1
Un-Protected 1 sectors
Erasing Flash...Erase Flash from 0x9f040000 to 0x9f04ffff in Bank # 1
First 0x4 last 0x4 sector size 0x10000                                                                                                                                 4
Erased 1 sectors
Writing to Flash... write addr: 9f040000
done
Protecting sectors 4..4 in bank 1
Protected 1 sectors
linino> reset