HOW TO: production firmware update on NET+OS based modules


First some general info from NET+OS API reference guide: C:\netos75\Documentation\ApiReference.chm
 
NET+OS has two standalone executable firmware images, the rom.bin and image.bin. The rom.bin is the system bootloader and the image.bin is your application. As you customize a BSP specific to your application needs, the same customizations are applied, automatically, to your platform's rom.bin bootloader. Often, you can deploy your applications without ever looking at the rom.bin--it's there, it just works! But sometimes applications require specific I/O needs or early intervention. In this case, careful tweaking of the rom.bin will be a part of the developers debug cycle.
The rom.bin bootloader is responsible for setting up chip selects, initializing hardware and software, copying the application image.bin into RAM and then jumping across the rom.bin space and into the application image.bin space.
In all NOR Flash platforms, NET+OS by default will produce a rom.bin smaller than 64k. It's crucial to retain this boundary, since production factory modules will come with a rom.bin bootloader that assumes a 64k size. One exception to this rule is when the first flash sector is greater than 64k.
The rom.bin does not and should never share a sector with image.bin. For more information on the bootloader process, see Bootloader
 
 
Now actually you have two ways to upgrade the firmware in production:

1) Using ADDP protocol and Netosprog command line tool that can be found here: C:\netos75\bin\netosprog.exe And documented here: C:\netos75\bin\NetosProg_ReadMe.html
This is a preferred method.
 
Please read the documentation mentioned above on the details but bottom line comes to this:
NET+OS Programmer is a tool to allow you to load your custom application onto a NET+OS device for the first time.
A NET+OS device, as shipped in the development kit, has an EOS that supports only NAFTP and ADDP. This document assumes that no changes have been made to the default EOS image that was on the device when shipped.
This program allows you to:
  • Discover the device on a network.
  • Configure an IP address.
  • Upload your firmware image to the device.
NOTE: NET+OS Programmer is intended for the FIRST load of your application. Once your image has been written into flash and the unit has been rebooted, NET+OS Programmer will no longer be able to discover your device. In order to be able to perform field updates, you will need to either include the RAM-Based FTP Server code (naftpapp_connect.c) or implement your own web-based solution.
To include an FTP server in your main or backup image, see the naftpapp sample application, which uses a single NET+OS call to naFtpFSInit().
 
  1. Discover your device on a network, typing the command 
C:\netos75\bin\netosprog /discover
 
Note the MAC address of the device you discovered. Or just use the MAC address from the label/bar code on the module
Let’s say it’s 00:40:9D:25:40:74, if you have a DHCP server, please also note the IP address of the module matching the MAC on the label. Let’s say it’s 192.168.1.2

2. If you have a DHCP server and you got an IP address of your module you can skip this step. Otherwise assign a static IP address to the device with 00:40:9D:25:40:74 MAC address.  
C:\netos75\bin\netosprog /set /mac=00409d254074 /ip=192.168.1.10 /subnet=255.255.255.0 /gateway=192.168.1.1


3. Upload the image.bin file to the device with IP address 192.168.1.10.  
C:\netos75\bin\netosprog /upload /ip=192.168.1.10 /firmware=c:\image.bin

or alternatively if you are doing it on a private network with only one device at a time present you can do this, skipping the first 2 steps:
Upload the firmware to the first device found.
C:\netos75\bin\netosprog /upload /mac=auto /firmware=c:\myfirmware.bin
 


2) The second method is using FTP protocol as I mentioned before. Some useful info can be found in the NET+OS API reference guide: C:\netos75\Documentation\ApiReference.chm To include an FTP server in your main or backup image, see the naftpapp sample application, which uses a single NET+OS call to naFtpFSInit().
               The method is described in DigiESP online help topic 2.6. Deploying a NET+OS Application to a Device à 2.6.4. Manually FTP the boot loader image to the device  and 2.6.5. Manually FTP the application image to the device
The topics in this section describe how to deploy your tested application into a device so that it can operate without the aid of a debugger.
This process assumes that the application presently on your device includes the FTP service. All development boards are shipped with this type of application pre-loaded on the device so this warning pertains only if you have previously deployed an application onto your device that does not include this service.
2.6.4. Manually FTP the boot loader image to the device
Your project contains two files of interest: the boot loader image (rom.bin or u-boot.bin) and the application image (image.bin). You must upload both of these files to flash on your device. The files are located in the Release directory of your FTP server project. The project's full path can be found in the Location value of the project properties Resource page.
Open a Windows command prompt:
  1. Click the Windows Start button, and select Programs > Accessories > Command Prompt.
  2. Type cd <project path>\Release and press Enter.
  3. Type dir and press Enter. You can see the rom.bin or u-boot.bin and image.bin files in the list.
Upload the files using FTP:
  1. Type ftp <device ip address>, and press Enter.
  2. When you see the prompt for user and password enter root and password.
  3. Type binary and press Enter.
  4. Type put rom.bin or put u-boot.bin and press Enter.
  5. Type quit and press Enter.
2.6.5. Manually FTP the application image to the device
Your project contains an image.bin file, which you will upload to flash on your device. The image.bin file is located in the Release directory of your project. The project's full path can be found in the Location value of the project properties Resource page.
Open a Windows command prompt:
  1. Click the Windows Start button, and select Programs > Accessories > Command Prompt.
  2. Type cd <project path>\Release and press Enter.
  3. Type dir and press Enter. You can see the image.bin file in the list.
Upload the image.bin file using FTP:
  1. Type ftp <device ip address>, and press Enter.
  2. When you see the prompt for user and password enter root and password.
  3. Type binary and press Enter.
  4. Type put image.bin and press Enter.
  5. Type quit and press Enter.
The device will reboot itself after approximately 10 seconds. When it boots up it will run the application you uploaded. You can see its output in the Terminal view.
 
Last updated: Aug 08, 2017

Recently Viewed Articles

No recently viewed articles
Contact a Digi expert and get started today! Contact Us