Home/Support/Support Forum/Upload firmware via TCP/IP
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Upload firmware via TCP/IP

0 votes
I'm trying to figure out how to upload my image.bin file through a TCP/IP connection. I'm far enough along I can receive files & save them in the file system. I just don't know where to save the firmware file to make my board boot from it. Can anyone point me in the right direction?

Digi ESP for NET+OS
Version: 1.3.0
Build id: 10192007 NET+OS 7.3
ConnectCore 9P 9215
asked Feb 2, 2010 in NET+OS by burl New to the Community (17 points)
recategorized Nov 26, 2013 by tuxembb

Please log in or register to answer this question.

7 Answers

0 votes
Have a look round the src/bsp/fsintf directory, especially fwdl.c.

That file handles FTP uploads, including image updates, so should give you a convenient entry point. (Think it was there in 7.3)
answered Feb 3, 2010 by steved2 Seasoned Professional (183 points)
0 votes
Thanks, but I can't find that directory or that file. I'm looking in c:\netos73 and in my project directory. Is there somewhere else I should try?
answered Feb 4, 2010 by burl New to the Community (17 points)
0 votes
The directory src\bsp\fsintf was not introduced until NET+OS V7.4, so you are unlikely to find it in V7.3.

More important question, are you developing through Digi ESP (the IDE) or through the GNU command line interface. The answer to this will help me tell you where you should be looking.
answered Feb 4, 2010 by dakotas_dad Veteran of the Digi Community (694 points)
0 votes
I'm using Digi ESP.
answered Feb 5, 2010 by burl New to the Community (17 points)
0 votes
Look in the following directory in your installation tree:

look for file ftpsvrfs.c

Within ftpsvrfs.c look for function FSStoreImageToFlash(). This the code that the ftp server uses to store images to FLASH. Hopefully what is done therein will help you.
answered Feb 5, 2010 by dakotas_dad Veteran of the Digi Community (694 points)
0 votes
When I call FSStoreImageToFlash (pData, lLen, "image.bin", 0) it returns NAFTPS_SUCCESS.

Is there anything special I have to do after that? I was under the impression the next time I powered up the board, it would load the firmware I just saved automatically. It isn't. What am I missing?
answered Feb 18, 2010 by burl New to the Community (17 points)
0 votes

With NetOS 7.4 and digi ESP I have found the simplest method to use is to base your project on the standard Digi code.

If you simply do File/New/NetOS Project, and follow the Wizard ensuring that you include the Web server and the FTP server, you will get an outline project that supports Firmware upload of both image.bin (for the main application), and rom.bin (for the bootloader). This upload works on bot FTP or you can use a web browser to do it via HTTP.

Once you have got this working correctly you can then pull your existing code into the project. This is the simplest way to do it and all the had work is done for you unless you want to do anything really special.

Alternatively you could just build a project in this manner and then review exactly how it works to get some ideas of where you have problems with the code you are currently using.

There is also a little application the allows you to merge the rom.bin and image.bin into a sigle upload that will update both the bootloader and the application at the same time. This is very usefull if you want to load the application at a non standard address.
answered Feb 19, 2010 by rdeabill Community Contributor (142 points)