This program is an example of how you can use the FTP server to allow application firmware updates via FTP. To run the example:
- Compile this example program ()
- Download the image file to the NetBurner board
- Run a FTP client program from a host computer on the network. In this example, we use the Windows FTP program called "ftp.exe" which is run from a dos box on the command line:
Open a DOS box
- Type "ftp <ip address>, where <ip address> = the IP address of the NetBurner board.
For example, "ftp 10.1.1.21"
- You will be prompted for a user name and password. You can enter anything here.
- In the FTP client program, type "ls" and hit the return key to see a list of files. Below is an example of a FTP session showing commands and responses so far:
>ftp 10.1.1.21 Connected to 10.1.1.21. 220 Welcome to the NetBurner FTP server. User (10.1.1.21:(none)): asdf 331 User name okay, need password. Password: 230 User logged in, proceed. ftp> ls 200 Port Command okay. 125 Data connection already open; transfer starting. UserFlash.s19 UserFlash.bin Application_APP.s19 226 Closing data connection. Listing complete. ftp: 51 bytes received in 0.00Seconds 51000.00Kbytes/sec.
- The file name we are interested in is "Application_APP.s19". Uploading an image file with this file name will program that application into flash memory.
- Choose any valid image file to upload. In this example we will use tictactoe_APP.s19. It is located in .When built with NBEclipse, the full path of the image file should be .s19. If built from the command line, the image will be in the same directory as the example code.Copy tictactoe_APP.s19 to the directory where you started ftp.exe, and change the name to Application_APP.s19. For example, if I am in a directory called , I could use the command "copy \nburn\tictactoe_APP.s19 Application_APP.s19".
- Now that you have the file Application_APP.s19 in the same directory you are running ftp.exe from, at the ftp> prompt type "put Application_APP.s19". After this command executes, the tic-tac-toe application will be programmed in flash. However, the board is still running the ftp application in SDRAM, so you won't see a change until the board reboots.
- All that's left is to reboot the board so the tic-tac-toe application starts up. The example is written so that closing the Windows client ftp session will reboot the board. At the Windows ftp> prompt, type "quit" and press the enter key. An example session is shown below:
ftp> put Application_APP.s19 200 Port Command okay. 125 Data connection already open; transfer starting. 226 Closing data connection. File transfer complete. ftp: 184620 bytes sent in 1.16Seconds 159.16Kbytes/sec. ftp> quit 221 Service closing control connection.
- Use a web browser and go to the board's IP address. You should see the tic-tac-toe application running.