All Forums
 Microsoft Windows CE
 CE Sample Applications and Utilities
 eVC - ADSImageUpdate (Run-Time Image Update)
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 04 Dec 2002 :  17:23:42  Show Profile  Email Poster
ADSImageUpdate.exe
Run-Time Image Update via FTP


ADSImageUpdate is a sample application that allows a Graphics Master development system to download new configuration files from a remote server.


IMPORTANT

This code has been deprecated and is not recommended for production use. Some of us believe that the potential for failure of this code to turn your system into a brick outweighs the benefit of hands-free updates.

We have developed a number of solutions for our volume production customers. If you need this functionality for your application, feel free to contact us with your product requirements.

-ak 20-Apr-2007



The application works as follows:
  1. The device reads app information from the registry.

  2. The app connects to the server via FTP

  3. The app searches for the following files: ADSLOAD.REG, ADSLOAD.HWT, ADSLOAD.EXE, ADSLOAD.BMP, NKLOAD.BIN

  4. These files are downloaded to the local file store (Storage Card) and then optionally burned into flash.


Key APIs Used

RegOpenKeyEx
RegQueryValueEx
KernelIoControl
VirtualCopy
VirtualAlloc
CreateFileForMapping
CreateFileMapping
MapViewOfFile
InternetConnect
FtpOpenFile
InternetReadFile
InternetCloseHandle

Lines of Code: 650


Registry keys used
HKEY_LOCAL_MACHINEImageUpdateServer
This string value is the IP/hostname of the FTP server to contact
This key is required.

HKEY_LOCAL_MACHINEImageUpdatePort
This dword value is the FTP port to use
This key is optional. If missing, Port defaults to 21.

HKEY_LOCAL_MACHINEImageUpdateUser
This string value is the username for the FTP site to use
This key is optional. If missing, username defaults to "anonymous"

HKEY_LOCAL_MACHINEImageUpdatePassword
This string value is the password for the FTP site to use
This key is optional. If missing, password defaults to "device@applieddata.net"

HKEY_LOCAL_MACHINEImageUpdatePath
This string value is the device path where downloaded files are stored
This key is optional. If missing, path defaults to "Storage Card"

HKEY_LOCAL_MACHINEImageUpdateAutoRestart
This dword value is currently unused
This key is optional. If missing, AutoRestart defaults to 1

HKEY_LOCAL_MACHINEImageUpdateBurnToFlash
This dword value determines whether or not ADSImageUpdate will burn files to flash after downloading them. zero = false, non-zero = true
This key is optional. If missing, AutoRestart defaults to 1


*** WARNING ***
*** READ THIS SECTION ***

ADSImageUpdate is designed as a baseline for ideas and code, but is *not* recommended for direct field use as there is a statistically significant chance that field units could end up "dead" and unbootable without physical attention.

Any power interruption during flash programming will cause the device to no longer boot!

Since this code directly writes to flash, if this code is modified for systems with the boot ROM stored in flash, the system may become completely unusable and require a return to ADS for bootrom programming!

Download

contact us



modified March 31, 03 (ctacke) - added key APIs and LOC
modified April 8, 03 (ctacke) - updated to rev 2
Edited by akidder 23-Aug-2006: Add link to rev 6; update title from "Remote" to "Run-Time" image update.
Edited by akidder 20-Apr-2007: Add warning, deprecation of code and contact us link. Unlink sample code.

Susan

123 Posts

Posted - 19 Mar 2003 :  10:59:46  Show Profile  Email Poster
In an attempt to provide more information to our users when our product is booting, we are developing an upgraded ADSLOAD.EXE program which would reflash NKLOAD.BIN, ADSLOAD.REG, ADSLOAD.HWT, and ADSLOAD.EXE. As these files are being loaded, we would generate progress messages to the screen.

ADSLOAD.REG and ASDLOAD.HWT are being reflash programmatically by us, with apparently no ill effects. (This update was patterned after your RWADSLoadReg program.)

ADSLOAD.EXE's upgrade to reflash NKLOAD.BIN was patterned after the ADSImageUpdate program retrieved from your website in on 13Mar2003. This install is having problems.

If I execute a programmatic restart after programmatically reflashing this file, everything still appears uncorrupted. But, when I hit the reset switch or cycle power, the device hangs after the message 'CE starts from DRAM (0xC1600000)" (alternatively it repeatedly resets itself once this message is output). My only recourse to recovery is to have the standard boot procedure load NKLOAD.BIN.

Since I patterned my upgrade after ADSImageUpdate, I suspect I may have some of my base constants poorly defined (especially since a comment in ADSImageUpdate.CPP refers to the Graphics Master). I did use 0x140000 as the offset for the binary file, since I am programming the Bitsy, but I have not changed any other constants.

What other changes need to be made to the constants in order to use this on the Bitsy?
Go to Top of Page

ctacke

877 Posts

Posted - 20 Mar 2003 :  18:17:31  Show Profile  Email Poster
Bitsy/BitsyPlus Configuration File Locations

The Bitsy is a bit different that the GMaster/GCPlus code in the sample. Not only does the addition of ADSLOAD.ROM shift the files "right" by 0x40000 bytes, the order of the remaining files is different. For the Bitsy and BitsyPlus, use the following definition for addressmatrix in ADSImageUpdate.h:


FILE_ADDRESS addressmatrix[] =
{
    {(_T("ADSLOAD.ROM")), 0x40000, 0},
    {(_T("ADSLOAD.HWT")), 0x40000, 0x40000},
    {(_T("ADSLOAD.REG")), 0x40000, 0x80000},
    {(_T("ADSLOAD.EXE")), 0x40000, 0xC0000},
    {(_T("ADSLOAD.BMP")), 0x40000, 0x100000},
    {(_T("NKLOAD.BIN")), 0x1000000, 0x140000} // max image size = 16MB
};



******************************************************************
************************** WARNING!!!!! ****************************
******************************************************************
If you incorrectly or write to or erase data in the boot rom area of flash, your device will have to be sent back to ADS for reprogramming, which typically will also incur a fee. Be very careful before attempting to write directly to the flash with any system that does not have a separate physical boot ROM.
******************************************************************
************************** WARNING!!!!! ****************************
******************************************************************
Go to Top of Page

Susan

123 Posts

Posted - 21 Mar 2003 :  11:17:52  Show Profile  Email Poster
Hi Chris,

Thank you. But those were not the problem. I had already determined those values by placing the EXE, REG, BMP, BIN, HWT, and ROM on a flash card, rebooting the device, then analyzing the serial port output.

The code within ADSReg has been ported successfully to reflash the non-binary files.

The code within ADSImageUpdate is being ported to reflash NKLOAD.BIN only. As I stated in my original post, the only change I was comfortable making myself was to change the address offset of NKLOAD.BIN to 0x140000.

The constants to which I was referring are constants such as FLASH_BASE, MEMORY_SIZE.

Thank you.
Go to Top of Page

ctacke

877 Posts

Posted - 08 Apr 2003 :  12:44:18  Show Profile  Email Poster
Rev 2 Application Update

We've made the following modifications to ADSImageUpdate:
  • Added Bitsy/Bitsy Plus file location info
  • Added a progress dialog that displays on the device
  • Fixed nkload.bin flash area erase. It no longer looks at the size in the addressmatrix for nkload.bin, but uses the nkload.bin file size. This prevents ADSImageUpdate from destroying the FlashFX Disk when updating the image.
Go to Top of Page

akidder

1519 Posts

Posted - 23 Aug 2006 :  12:01:18  Show Profile  Email Poster
#rev6

Rev 6 Update: Config Files, USB Storage

We have made a number of changes to this application. Here are some of the highlights:
  • Reads system files from USB storage card instead of via ftp

  • Uses .cfg file to specify memory configuration of the target product

  • Supports P30 flash (used in newest products)

  • Disables the flash disk driver during programming to prevent contention (and flash corruption)
Note that this version of the application must be compiled with a different .lib library file for each product it is used on. This library file provides an API to disable the flash disk driver, which ensures reliable operation of the reprogramming operation. Disabling the flash disk driver is especially important for systems that use Reliance, as it may perform garbage collection in the background if not disabled.

See the readme.txt file included in the distribution for usage details.

Source download

See deprecation note and contact links in first post.


Edited by akidder 20-Apr-2007: Remove link to code.
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.05 seconds. Snitz Forums 2000