2

I have enabled CONFIG_CMD_TFTPPUT in U-Boot, but I am not able to use it.

I have set the serverip and ipaddr environment variables. When I use it as follows, it times out:

u-boot# tftpput            
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP to server 192.168.1.3; our IP address is 192.168.1.106
Filename 'uImage'.
Save address: 0x0
Save size:    0x0
Saving: ##T ###T ####  

If I set the bootfile name to temp, it gives the following error:

u-boot# tftpput          
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP to server 192.168.1.3; our IP address is 192.168.1.106
Filename 'temp'.
Save address: 0x0
Save size:    0x0
Saving: *
TFTP error: 'Access violation' (2)
Not retrying...

Wireshark capture:

Wireshark log

Any help/pointers/suggestion?

3 Answers 3

2

Edit: I just noticed that your save address and size are 0.

I have not tried tftpput on u-boot. From the command help it appears address and size must be supplied by the command line. I would try that. I don't know where RAM is on your platform so I can't give a valid example command line but it should look something like:

tftpput 80000000 10

---- Old answer, may still be useful if the above does not help

If it were me I would run wireshark on the tftp server to see what is happening.

If you can't do that you can use a hub (not a switch) on the device and plug a pc into the same hub to run wireshark. (hubs are hard to find these days. If you don't have one from "the old days" this probably won't work for you.)

You don't mention what tftp server you are running. Is it Linux based? The often used ones are dnsmasq and tftpd-hpa. I have used both with u-boot.

One possibility is something is going wrong with option negotiation.

It may also be possible that your devices Ethernet driver is OK for small packets but not working for bigger packets. (However, I think most tftp transfers end up negotiation 512 byte payloads so the packets are not really that big.)

5
  • Thank you very much for reply, i have tried tftpput 0x80200000 0x20000 192.168.1.3:uImage command but result is same :( # tftpput 0x80200000 0x20000 192.168.1.3:uImage link up on port 0, speed 100, full duplex Using cpsw device TFTP to server 192.168.1.3; our IP address is 192.168.1.106 Filename 'uImage'. Save address: 0x80200000 Save size: 0x20000 Saving: * TFTP error: 'Access violation' (2) Not retrying... wireshark shows the same(Access violation) error code.
    – ART
    Jul 2, 2014 at 12:08
  • i am using tftpd(i think its tftpd-hpa) on ubuntu installed in virtualbox. i feel this may be because there is no permission to write to tftpboot folder. I might have to set sticky bit in tftpboot folder's permission to make it work.
    – ART
    Jul 2, 2014 at 12:13
  • I have added wireshark screenshot in post. And setting sticky bit didn't help either :(
    – ART
    Jul 2, 2014 at 12:35
  • My tftp server configuration in Linux was not proper, when i used "tftpd32" utitlity and use command tftpput 0x80200000 0x500000 192.168.1.3:uImage I am able to transfer file to host pc. :) i will have to debug tftpd configuration on the virtualbox installed ubuntu.
    – ART
    Jul 2, 2014 at 14:14
  • 1
    Most tftp servers will only write to a file that already exists. I thought you already had this covered because of the way the command worked differently based on file name. So make sure the file exists and is writeable by whatever user the tftp daemon run as. Also get is easier, I am assuming you have verfied that get works first.
    – wmills
    Jul 2, 2014 at 22:17
1

As "wmill' rightly commented in his answer that most tftp servers will write to file only if it exists. In my case also it was the same problem. tftpput from u-boot works fine. I installed tftpd-hpa and configured it as follows to create a file. edit /etc/default/tftpd-hpa as follows,

# /etc/default/tftpd-hpa

TFTP_USERNAME="root"
TFTP_DIRECTORY="/home/ankur/tftpboot"
TFTP_ADDRESS="0.0.0.0:69"
TFTP_OPTIONS="-c --secure"

And then tftp configuration in /etc/xinet.d/tftp should be as follows,

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

Withe above configuration when i ran command
tftpput 0x80200000 0x500000 192.168.1.3:uImage
I am able to send file to host PC.

0

Short answer: Add read access rights to the file in tftpboot folder

Detailed answer:

I had the same problem.

Some of the files were being accessed so the tftp was definitely working.

I had to add read access to the files which were causing the problem and it was fixed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.