TFTP to the mini2440

davef
Has anyone been able to TFTP from a Linux PC to the mini2440?  Thought it
would be good idea to check this out BEFORE using u-boot to upgrade the
kernel.

I can FTP files from my Linux box running Kubuntu 9.04  to the mini2440,
but only get timed out messages (on the Linux PC) using tftp.  I have been
through quite a few "how to help sheets" on setting up the TFTP server on
the Linux box, but never get a response from the mini2440.

Also, if I try to tftpd from the mini2440 all I get is <Connection
refused>.  I am more interested in being able to tftp files TO the
mini2440.

Appreciate any pointers.

Tnx

paulw
Yes, that's how I normally download applications during development.  I had
the same problem initially. The last obstacle was configuring the firewall
on the PC (Fedora 11) to allow it.

puma
Hi davef,

Linux box should be fined with TFTP. In case your host is behind the
router, you need to open the port 21 with your local ip address.

Thanks,
puma

davef
puma,

Thanks for the hint, however after another evening trying to get it to work
I realised that I can't even transfer files on the Linux PC . . . from one
directory to another!

I had to install the TFTP server following this:

http://www.davidsudjiman.info/2006/03/27/installing-and-setting-tftpd-in...

and then found this to test it:

http://book.opensourceproject.org.cn/embedded/addembed/opensource/ch04le...

I am using a ADSL router in the system and when I get things to that stage
I will check out your suggestion.

Cheers

davef
To save someone the time.

After installing the TFTP server on the Linux box as found in the 1st link
above, put the files to transfer in /tftpboot on the Linux PC
(192.168.1.3).  Test it as described in the 2nd link.

To GET a file at the FriendlyArm from the Linux PC:
   from root # tftp –l my_tmp/test.txt –r test.txt –g 192.168.1.3
(my_tmp is a directory that you put on the FriendlyArm with chmod 777)

To PUT a file from the FriendlyArm to the Linux PC:
   from root # tftp –l my_tmp/test.txt –r test.txt –p 192.168.1.3

The syntax is not that clear on tftp in the BusyBox commands docs, well it
wasn't to me.

Now I think the reason I can't tftp from the Linux box to the FriendlyArm
is because there is no TFTP (client?) running on the FriendlyArm after
boot-up.  I see a clue in the usage for tftpd if you just type in tftpd
without any options.

paulw
You won't be able to initiate a TFTP transfer from the PC side unless you
have a TFTP server (TFTPD) running on the FriendlyARM

puma
hi davef,

You don't have to install a tftp server on mini2440 since it has already an
ftp pre-installed. I recommend to use FileZilla client Linux and everything
would be fine for you. I've been using it to my Ubuntu 8.04.

thanks,
puma

davef
puma and paulw,

Thanks both of you for the hints.  I can FTP fine to the mini2440.  Being
able to TFTP was part of a self-imposed learning experience before
launching myself headlong into u-boot and kernel compiling territory.

There is a line which I believe needs to go into inetd.conf . . .

69 dgram udp nowait root tftpd tftpd files/to/serve

which I am about to try.  Then u-boot here we come.

Cheers,
davef

davef
Reading inetd(8) man pages I made a directory in root called <files>

in /etc/inetd.conf I added

tftp dgram udp nowait root /usr/bin/tftpd /usr/bin/tftpd /files

Go to the Linux PC and in my tftpboot directory, where I have a file
<test>:
tftp 192.168.1.230
tftp> put test
Error code 0: malformed packet

A search on Google shows up 4 threads for this error, none of which helped.

I tried <69> for the initial field entry as per the line you see when you
type tftpd in with no options in terminal (on the FriendlyArm).

One more hint :)

Tnx

davef
Don't bother with further suggestions.  Installed WireShark on the Linux PC
and proved that the tftp client doesn't even send out anything to the
FriendlyArm.

sab
Hi,

I cannot ftp/tftp to Mini from Ubuntu 9.04.
Please kindly share steps to do so.

thanks
-Sab.

Prasad
I cannot ftp/tftp to Mini from Ubuntu 9.04.
Please kindly share steps to do so.

davef
Give this a go, there could errors.



Installing TFTP on the Linux PC running Ubuntu 9.04

The tftp server starts with xinetd on the Linux PC.
The tftp client start when you do tftp

1. Install tftpd and related packages.

$ sudo apt-get install xinetd tftpd tftp

2. Create /etc/xinetd.d/tftp and put this entry:

service tftp
{
protocol   = udp
port    = 69
socket_type  = dgram
wait    = yes
user    = nobody
server    = /usr/sbin/in.tftpd
server_args  = -s /tftpboot
disable  = no
}

3. Make /tftpboot directory in root

$ sudo mkdir /tftpboot
$ sudo chmod -R 777 /tftpboot
$ sudo chown -R nobody /tftpboot

4. Re-start tftpd through xinetd

$ sudo /etc/init.d/xinetd restart

5. Testing. Transfer a file test from 192.168.1.3 (Client using tftp) to
192.168.1.3 (Server 192.168.1.3). 

$ chmod 777 /tftpboot/test

6. Create a temp directory, chmod and cd to it.

$ sudo mkdir /temp
$ sudo chmod -R 777 /temp
  cd temp

7. Get a file from /tftpboot while in /temp on 192.168.1.3

$ tftp 192.168.1.3
tftp> get test
Received 22 bytes in 0.0 seconds
tftp> quit

8. Put a file in /temp to /tftpboot on 192.168.1.3

$ tftp 192.168.1.3
tftp> put tftpboot_test
Received 34 bytes in 0.0 seconds
tftp> quit

9. Can’t put or get files at the Linux box from/to the FriendlyArm
(see comments above in this thread)

To GET a file at the FriendlyArm from the Linux PC:
from www  # tftp -l dave.txt –r hda.txt –g 192.168.1.3
from root  # tftp –l www/dave.txt –r hda.txt –g 192.168.1.3

To PUT a file from the FriendlyArm to the Linux PC:
from www  # tftp –l index.html –r index.html –p 192.168.1.3
from root  # tftp –l www/index.html –r index.html –p 192.168.1.3


In order to have a tftpd client running on boot-up in /etc/inetd.conf I
added the line:

tftp  dgram  udp  nowait  root  /usr/bin/tftpd  /usr/bin/tftpd  /files

Prasad
Hai davef

Thank you for your post.
This helped me out tranfer files to ARM.

I need to develope a Gui App using Qutopia. 
Could you please share how to setup Qutopia on my ubuntu 9.04.
Please kindly share steps to do so

davef
Haven't done that, so can not offer any advice.  I assume you have read the
other Qtopia threads on this site.

Start another thread if none of them fits your needs.

Prasad
Hai davef, 

THANK YOU for your reply.
Iam switching to Wince because iam bit familar with c#.

Piyush
Hello Davef

I am trying to communicate to my mini2440 through the FTP and for that I
installed the tftp on my Linux Ubuntu 10.04 lucid .

I have done upto the installing and creating those directories and files .

But when it comes to the testing of my FTP I am not able to that , because
I am not clear of few things actually like:

1.As you said in the testing portion "Testing. Transfer a file test from
192.168.1.3 (Client using tftp) to 192.168.1.3 (Server 192.168.1.3)." here
you have used the same IP for both the server and the client , so why is
this so.

2. the ip address of my mini is 192.168.1.230 so how should I proceed in
this direction.

Thank you

davef
Piyush,

This is almost one year ago and don't think ever used it after I got most
of it working!

Looks like it should be:

Testing. Transfer a file test from
192.168.1.230 (Client using tftp) to 192.168.1.3 (Server 192.168.1.3).

192.168.1.3 was the static address for the Linux host or server.

I did have problems, most likely due to my poor understanding of the whole
client server setup.

Good luck

Piyush
Hello Davef

Have you used the nfs service to transfer the files from your PC to the
mini2440.

Please give me some help on it that how I can transfer the files from the
Linux PC to the mini2440 through the nfs protocol.

If you have some blog or document on it ..please do share with me.

Thank you

davef
http://billforums.station51.net/viewtopic.php?f=1&t=17

Maybe?

naveen
Hi all, i have successfully port u-boot, and its working fine with the jffs
filesystem, but i unable to transfer a file using ftp, tftp, and i even i
followed the above procedure to transfer file, one more thing my SDCARD is
not getting detecting, otherwise i would have copy from it to the fs. can
any body give me the solutions for the above two problem,

i have created a file called /etc/inetd.conf, and the contents are

tftp dgram udp nowait root /usr/bin/tftpd /usr/bin/tftpd /files

if i transfer a file from linux pc to friendly arm i got this error
/tftpboot# tftp 192.168.1.230
tftp> put file.txt
Transfer timed out.


if i try to get file from linux pc to friendly arm, i got this error
[root@(none) /files]# tftp -l file.txt -r file.txt -g 192.168.1.3
tftp: server error: (0) Undefined error code             

can any one help me please, 

waiting for your reply

Juergen Beisert
Did you run a TFTP server on your Mini2440 when you tried to transfer a
file from your host (Linux PC) to the Mini2440? (the "put file.txt" case)

Is your network up and running and configured correctly at both sides (host
and Mini2440)? Did you see the accesses from the Mini2440 in the logfiles
at your host (Linux PC)?

amol
MINI2440# tftp 0×31000000 uImage
dm9000 i/o: 0×20000300, id: 0x90000a46
DM9000 : running in 16 bit mode
MAC:08:08:11:18:12:27
TFTP from server 10.0.0.1; our IP address is 10.0.0.2
Filename ‘uImage’.
> > Load address: 0×31000000
> > Loading: T T T T T T T T T T
> > Retry count exceeded; starting again
thanks for your reply

luc
Hi,

Same problem here...
As I run ubuntu in a virtual machine, I used tftp32 on my windows machine.
Now it works.
I have to say i am complete newbie in linux ...

Luc

ashen
amol: there's bug in ubuntu's 'tftpd', use atftpd instead.

amol
ashen:how to use atftpd, means the command to transfer the kernel image is
same or different. If you know any document or website then please inform
me.

sudhakar_G
Hi,
I am working on mini2440 board.I have successfully ported 3.16 kernel on
the board.How do you transfer files to FriendlyARM board?I have installed
tftp server on my HOST(ubuntu) machine.tftp client need to run on the
board? When i typed tftp in my board ,its says command not found.
Pls help me.




Regards,
Sudhakar.G

davef
Assume you are using Busybox.  On the command line, on the target, type:

   busybox

Copy and paste the result in your reply.

sudhakar_G
Hi davef,


root@mini2440:/ busybox 
BusyBox v1.22.1 (2015-02-13 14:38:59 IST) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2012.
Licensed under GPLv2. See source distribution for detailed
copyright notices.

Usage: busybox [function [arguments]...]
   or: busybox --list
   or: function [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  Most people will create a
        link to busybox for each function they wish to use and BusyBox
        will act like whatever it was invoked as.

Currently defined functions:
        [, [[, addgroup, adduser, ar, ash, awk, basename, bunzip2, bzcat,
cal, cat, chgrp, chmod, chown,
        chroot, clear, cmp, cp, cpio, cttyhack, cut, date, delgroup,
deluser, df, dirname, dmesg,
        dnsdomainname, du, dumpkmap, echo, egrep, env, expr, false, fdisk,
fgrep, find, free, fsck,
        fsck.minix, ftpget, ftpput, getty, grep, gunzip, gzip, halt,
hexdump, hostname, hwclock,
        ifconfig, ifdown, ifup, init, insmod, kill, killall, klogd, less,
ln, loadfont, loadkmap, logger,
        login, ls, lsmod, md5sum, mesg, mkdir, mkfifo, mknod, mktemp,
modprobe, mv, netstat, nice, nohup,
        nslookup, od, passwd, pidof, ping, poweroff, printenv, printf, pwd,
readahead, readlink,
        realpath, reboot, renice, reset, resize, rm, rmdir, rmmod, route,
run-parts, sed, seq,
        setconsole, setkeycodes, sh, sleep, sort, start-stop-daemon, stat,
stty, su, sulogin, sum, sync,
        tail, tar, tee, telnet, telnetd, test, touch, traceroute, true,
tty, uname, uncompress, uniq,
        unxz, unzip, uptime, usleep, uudecode, uuencode, vi, watch,
watchdog, wc, which, who, whoami,
        xargs, xz, xzcat, yes, zcat

root@mini2440:/ 

Regards,
Sudhakar.G

davef
You could enable tftp in Busybox and re-compile.  

Just want to check that you are NOT using the Pengutronix BSP and have
ported your kernel and root filesystem from scratch.

sudhakar_G
Hi davef,
        I have used Pengutronix BSP to port my kernel & root filesystem in
mini2440.

Regards,
Sudhakar.G

davef
I was confused by: I have successfully ported 3.16 kernel on
the board.

Do you mean you enabled Pengutronix to use the 3.16 kernel etc.

To get tftp in ptxdist menuconfig search for tftp and navigate your way to
the appropriate page in menuconfig and enable it.

sudhakar_G
Hi davef,
       Yes i have enabled  Pengutronix to use the 3.16 kernel.
Thank you for your help .I will do that.
Regards,
Sudhakar.G

sudhakar_G
Hi davef,

      By using Pengutronix BSP for mini2440 ,i was able to build 3.16
kernel image,root filesytem ,barebox-image and i have used Nand flash
memory i.e 6.2 in user manual  to tranfer the files to Friendlyarm board.

Here i am facing 2 problems.

1--> LCD is not working ..AM using W35 panel.If i want to make LCD to work
what changes / files i need to edit.

2-->How should i transfer the files from HOST to Friendly arm board.
I tried with tftp command in the Target ,it says command not found.
As you said i went to the ptxdist menuconfig .. i have enabled tftp .
But no result .

Regards,
sudhakar.G

davef
The w35i LCD is supported by the Pengutronix BSP. So, if yours is really
not a w35i then you need to search this forum and
http://blog.gmane.org/gmane.comp.embedded.ptxdist.oselas.community

to see if someone else has had this problem

If yours is really a w35i then 

Section 4.2.3

These features can be enabled/disabled or configured at run-time with the
kernel parameter mini2440=. The content of this parameter is also
configured in the config files mentioned above.

I use the N35, which must be the default LCD because I never had to change
anything. It appears that a previous config file needs changing to:
mini2440=w35i

I guess it refers to:
configs/platform-friendlyarm-mini2440/barebox-64m-env/config

or  128m depending on the flash size.

tftp

Have you verified that your tftp client is now working on the target?  You
did re-compile the root filesystem after enabling it?

davef
Or you can edit this file at runtime.

On page 27 you will see a command:

mini2440:/ edit /env/config (after you  Hit any key to stop autoboot)

then at;
  
   bootargs="........ mini2440=[the number of your display]tbc

This only applies after you sort out your w35 or w35i uncertainty.

sudhakar_G
Hi davef,
            I am using LCD W35 panel .I did the same thing ..as you said .I
edit the file /env/config and i have given

bootargs=".......mini2440=[6tbc] becoz 6 is the no.for w35i panel as
mention in the manual ..

But the LCD is not working ..After booting the target board ..I was able to
see white screen.

Is w35 & W35i lcds are differnt?


Regards,
Sudhakar.G

davef
http://search.gmane.org/?query=w35i&group=gmane.comp.embedded.ptxdis...

as per my link above.  And have you searched this forum for w35i, there are
2 pages of hits.

sudhakar_G
Hi davef,

I am using w35i , now i have checked back of LCD display it is written as 
 w35i : 3.5” TFT + touchscreen (LQ035Q1DG06)

I have edited the same file 

mini2440:/ edit /env/config

bootargs="............mini2440=6bt"; [6 is the number i need to pass i am
selecting w35i ] as mentioned in manual.

But still i didn't get the LCD display. 

Regards,
Sudhakar.G

davef
To check you will need to get minicom running on your host and connect the
RS232 cable up so that you can look at the boot messages.

Firstly, you want to confirm that you see a line:

MINI2440: LCD 0:240x320 1:800x480 2:1024x768 3:240x320 4:640x480 5:240x320
[6:320x240] 7:480x272

Note the square brackets around your LCD selection.

Secondly, can I assume you have read through the info at the link I
included and you search for clues on this forum.

davef
No, try this for secondly.

Have you enabled virtual terminal in the kernel?

$ ptxdist kernelconfig
 
   Device Drivers  --->
  Character devices  --->
    [*] Virtual terminal
    [*]   Enable character translations in console
    [*]   Support for console on virtual terminal
 
  Graphics support  --->
[*] Support for frame buffer devices  --->
<*> S3C2410 LCD framebuffer support       

    Console display driver support  ---> 
      <*> Framebuffer Console support
      [*] Map the console to the primary display device
      [*] Select compiled-in fonts 
      [*] VGA 8x8 font

Things might be slightly different as this was for kernel 3.7

Re-compile kernel and tell us what you see.

sudhakar_G
Hi davef,

THis is the output i got from the boot messages ...

MINI2440: Option string mini2440=6tb
MINI2440: LCD
 0:240x320 1:800x480
 2:1024x768 3:240x320
 4:640x480 5:240x320
 [6:320x240] 7:480x272

second thing ---> I have re-compiled the kernel by enabling all the options
what you have mentioned .After booting my board ..on the LCD at one of the
corner cursor is blinking ...

on the Target Board , i have given these commands 
root@mini2440:~ ts_calibrate
xres = 320, yres = 240
Took 3 samples...
Top left : X =  777 Y =  319
Took 1 samples...
Top right : X =   48 Y =  543
Took 1 samples...
Bot right : X =   18 Y =  548
Took 7 samples...
Bot left : X =  745 Y =  648
Took 2 samples...
Center : X =  455 Y =  624
282.489258 -0.300107 0.000250
-82.975342 0.022592 0.361192
Calibration constants: 18513216 -19667 16 -5437872 1480 23671 65536
root@mini2440:~ts_test
root@mini2440:~ fbtest
Using drawops cfb16 (16 bpp packed pixels)
Available visuals:
  Monochrome
  Grayscale 32
  Truecolor 5:6:5:0
Using visops truecolor
Running all tests
test001: PASSED
test002: PASSED
test004: PASSED
test006: PASSED
test008: PASSED
test009: PASSED
oot@mini2440:~ cat /proc/cmdline 
console=ttySAC0,115200 mini2440=6tb
ip=192.168.0.230:192.168.0.147:192.168.0.2:255.255.255.0::: root=/dev
But LCD display is not working .

Regards,
Sudhakar.G

davef
Looks like good progress.

For the third time ... the link and a search on the forum did not help with
your issue?

You need to answer my questions, and then I will stop asking them.

I will be back in about 2-3 hours for your reply.

sudhakar_G
Hi davef,
        Hi sir , can u pls give me the reply for the above problem.
Regards,
Sudhakar.G

davef
Can you please answer my question?

You need to learn how to search for answers.  You can be quite sure someone
has possibly had this problem before and "told the world about it" on some
forum, somewhere.

I haven't got the answer for you I am only trying to help.

Juergen
There are two LCD units out there: "w35" and "w35i". "w35 with analogue
touchscreen and GPIO controlled backlight and "w35i" with onewire
touchscreen and onewire backlight control.

sudhakar_G
Hi davef,
I will search other forums.Thank you for your reply.

Gonyappa kurubar
dear all 
         help me how to install images to mini2440(W35) from ubuntu host 
   i followed the manual am getting this error 


Enter your selection: q                                                    
    
Supervivi> load ram 0x31000000 154048 u                                    
    
USB host is connected. Waiting a download.                                 
    
                                                                           
    
Now, Downloading [ADDRESS:31000000h,TOTAL:154058]                          
    
RECEIVED FILE SIZE:  154058 (150KB/S, 1S)                                  
    
Downloaded file at 0x31000000, size = 154048 bytes                         
    
Supervivi> go 0x31000000                                                   
    
go to 0x31000000                                                           
    
  argument 0 = 0x00000000                                                  
    
  argument 1 = 0x00000000                                                  
    
  argument 2 = 0x00000000                                                  
    
  argument 3 = 0x00000000                                                  
    
                                                                           
    
                                                                           
    
barebox 2011.05.0-ptx-2014.11.0 (Feb 13 2015 - 14:44:10)                   
    
                                                                           
    
Board: Mini 2440                                                           
    
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd3 (Samsung NAND 1GiB 3,3V
8-bit)
Bad block table not found for chip 0                                       
    
Bad block table not found for chip 0                                       
    
Scanning device for bad blocks                                             
    
Bad block table written to 0x3ffe0000, version 0x01                        
    
Bad block table written to 0x3ffc0000, version 0x01                        
    
dm9000 i/o: 0x20000300, id: 0x90000a46                                     
    
eth@eth0: got MAC address from EEPROM: 00:00:00:00:00:00                   
    
cfi_probe: cfi_flash base: 0x00000000 size: 0x00200000                     
    
refclk:    12000 kHz                                                       
    
mpll:     405000 kHz                                                       
    
upll:      48000 kHz                                                       
    
fclk:     405000 kHz                                                       
    
hclk:     101250 kHz                                                       
    
pclk:      50625 kHz                                                       
    
SDRAM1:   CL4@101MHz                                                       
    
SDRAM2:   CL4@101MHz                                                       
    
Malloc space: 0x33a00000 -> 0x33e00000 (size  4 MB)                        
    
Stack space : 0x339f8000 -> 0x33a00000 (size 32 kB)                        
    
envfs: wrong magic on /dev/env0                                            
    
no valid environment found on /dev/env0. Using default environment         
    
running /env/bin/init...                                                   
    
mini2440:/ devinfo eth0                                                    
    
base  : 0x00000000                                                         
    
size  : 0x00000000                                                         
    
driver: none                                                               
    
                                                                           
    
Parameters:                                                                
    
          ipaddr = 192.168.0.230                                           
    
         ethaddr = 00:1c:c0:0f:cd:aa                                       
    
         gateway = 192.168.0.2                                             
    
         netmask = 255.255.255.0                                           
    
        serverip = 192.168.0.147                                           
    
mini2440:/ dhcp                                                            
    
phy0: Link is up - 100/Full                                                
    
T DHCP client bound to address 192.168.0.37                                
    
mini2440:/ saveenv                                                         
    
saving environment                                                         
    
mini2440:/ ./env/config                                                    
    
mini2440:/ ping 192.168.0.7                                                
    
T host 192.168.0.7 is alive                                                
    
mini2440:/ update -t barebox -d nand                                       
    
T host 192.168.0.147 is alive                                              
    
                                                                           
    
erasing partition /dev/nand0.barebox.bb                                    
    
                                                                           
    
                                                                           
    
flashing barebox-mini2440 to /dev/nand0.barebox.bb                         
    
                                                                           
    
TFTP from server 192.168.0.147 ('barebox-mini2440' ->
'/dev/nand0.barebox.bb')  
      



thanks in advance
  -

davef
Specifically which error?  You mean nothing happens after:

TFTP from server 192.168.0.147 ('barebox-mini2440' ->
'/dev/nand0.barebox.bb')

davef
Did you enable tftp in PTXdist menuconfig and then compile?

Meher
While connecting to the mini2440 with ftp, I am getting as follows. 

Connected to 172.16.4.122.
220 FriendlyARM FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready.
Name (172.16.4.122:mou): plg
331 Password required for plg.
Password:
230 User plg logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bin
200 Type set to I.
ftp> put hello
local: hello remote: hello
200 PORT command successful.
553 hello: Permission denied.

Can anyone suggest what may be the reason??
 Thanks in advance.

Soma
I have Same Error

Connected to 192.168.1.230
220 FriendlyARM FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready.
Name (192.168.1.230:Soma): plg
331 Password required for plg.
Password:
230 User plg logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> bin
200 Type set to I.
ftp> put hello
local: hello remote: hello
200 PORT command successful.
553 hello: Permission denied.
Pls Help Me...