Running applications on Digi Connect ME

Hi,

I am currently developing some software to run in the Digi Connect ME.

It’s purpose is to communicate with a Microchip PIC device via a serial port, and serve dynamic web pages via http to a user’s web browser, based on the information from the PIC.

I am using a Digi Connect ME Integration (Development?) kit with a Raven debugger, and Net+Works 6.0 GNU Software dev kit.

My problems / questions are as follows :

1/. I am generally finding the documentation very sparse. Although there seems to be a huge amount of documentation for API calls etc., I cannot find much on basically getting applications up and running in the Digi Connect ME.

2/. I can MAKE an example piece of code (e.g. NAFTPAPP) and debug it in the module but once it’s been debugged, how do I get it to run without the debugger ?

3/. There are examples of e.g. nahttp_pd (PBuilder code, manual says nahttp_pb !) but, if I use PBuilder or the HTML to C compiler to build a web page into an executable, what address does it have…
e.g.
192.168.0.5 is the module’s IP address, but when I copy html files across, test.htm is accessed via http://192.168.0.5/FS/WEB/test.htm
How do I know what ‘folder’ the executable goes into (e.g. /FS/WEB),
How do I put it there (the web interface mentions nothing about folders),
How do I run the executable (what is it’s URL, since the filename seems to be “image.bin”).

Thank you in advance for any help anyone may be able to give me on this.

Nigel Stevens

Mr. Stevens,

I will address each of your three points in the order which you have presented them.

1.) The “Building and Debugging a Sample Application” section of the Programmers Guide is meant to provide you an example of how to build and load an application. What sorts of additional information are you looking?

2.) The “Building and Debugging a Sample Application” section of the Programmers Guide is missing one critical sub-section. In between the steps in which you have successfully gotten the naftpapp example up and running via GDBTK and rebooting of the Connect ME, you want to ftp into the ME and ‘put’ the image.bin file, of whatever NET+OS application you wish to have running after a device reboot, (don’t forget to go into binary mode before performing the put) onto the server.

The FTP server code included with the naftpapp example (which you are free to utilize with your own applications) examines the inomcing file and once it is found to be a valid NET+OS image it is written into the flash of the Connect ME.

3.) The nahttp_pd example utilizes PBuilder to convert the HTML pages to C source, in order to build them into the application image itself. If you take a look at the makefile for this example you shall see, within the list of APP_C_FILES netarm1.c and netarm1_v.c. These two files are the C source created by pbuilder.exe from netarm1.htm, formreply.htm, netarm2.htm and netsilicon.gif files. Once Pbuilder converts all of your web files into C source you add them to the list of APP_C_FILES, to be compiled directly into the image.elf and image.bin files. The Advanced Web Server manual contains additional information on this matter.

The /FS/WEB volume name that is utilized on the ME, by our default firmware is specific to that firmware. When you elect to create a Flash or RAM-based file system you determine the volume name(s). None of the provided examples utilize /FS/WEB as a volume name.

I would recommend that you not use the HTML-To-C convertor, as this is meant for use with the simple HTTP server. Instead you should look into AWS (the Advanced Web Server), with which PBuilder.exe is associated.

The image.bin file is the compressed binary image that is used to program into the Connect ME’s flash. The provided method for getting this image into the ME’s flash is via FTP, using the naftpapp example application. If you so desire you could implement alternative methods, i.e. tftp, http, etc.

I trust that I have helped clear up most, if not all, of your questions. If not please contact Digi support directly via support e-mail support.wizards@digi.com.

Regards,
Cameron

Cameron,

Should it be possible to ftp a new application into a “factory fresh” ME without JTAG?
I’ve tried the most likely combinations of user names and passwords, but it won’t accept a connection.

Also, is the expected header the “standard” Net/OS 6.0 cross-platform one, or are there some “Digi special” bits?

TIA
Steve

When I try to put the image.bin file as per the directions given above. It gets rejected. Here is my ftp session log.

ftp> open 10.0.2.85
Connected to ut85.eng.adeptsystemsinc.com.
220 NET+ARM FTP Server 1.0 ready.
Name (10.0.2.85:smithsm): (none)
230 User (none) logged in.
Remote system type is NET+ARM.
ftp> binary
200 Type set to I.
ftp> hash
Hash mark printing on (1024 bytes/hash mark).
ftp> put image.bin
local: image.bin remote: image.bin
502 Command not implemented.
227 PORT 10,0,2,85,16,2

421 Service not available, remote server timed out. Connection closed
ftp> open 10.0.2.85
Connected to ut85.eng.adeptsystemsinc.com.
220 NET+ARM FTP Server 1.0 ready.
Name (10.0.2.85:smithsm): (none)
230 User (none) logged in.
Remote system type is NET+ARM.
ftp> put
(local-file) image.bin
(remote-file) image.bin
local: image.bin remote: image.bin
502 Command not implemented.
227 PORT 10,0,2,85,18,3

421 Service not available, remote server timed out. Connection closed
ftp>

It doesn’t look like the naftpapp sample application supports putting anything.?

Am I doing something wrong?

Try the user “(none)” - parentheses and all.
Leave the password blank.

-Erik

Steve,

The default Digi firmware for the Connect ME does not provide FTP services.

In order to replace our firmware image with your own, you have two methods, generally available to you.

  1. With an IP address assigned to the ME, access the admin/administration.htm page of the device. Then using the File Management link locate, select and upload your applications image.bin file.

  2. Optionally, build and load the naftpapp example using GDB. Then utilizing an FTP client connect to the ME and ‘put’ your image.bin into the server. The FTP server will handle programming the uploaded image into the ME’s flash.

Cameron

Cameron,

Tried your first suggestion, but the file format was rejected. Are there any specific file names/parameters/headers etc I need?
(I’m generating the app using Greenhills rather than GNU, and have had fun because there seems to be virtually no documentation on link maps, load addresses etc. I have however got an app which will run on an ME with JTAG).
Is the admin page always available, or would it be up to my downloaded app to provide a means of updating the image thereafter?

TIA
Steve

Steve,

At this point in time Digi does not support the Connect ME in the GreenHills (GHS) build environment.

I can tell you, however, that the Connect ME RAM image is set up differently than the image you would build for a NetSilicon development board. We insert a Digi-specific header onto the front of the compressed image.

If you were to build one of the examples using the GNU build environment you will see that the last thing performed in the process is to execute a utility entitled fillhdr taking in two parameters, the original image and the output image filename. Assuming that your GNU=>GHS port of the BSP was performed correctly you could possible be able to execute fillhdr to create the expected image.

Cameron

Cameron,

Pity about lack of GHS support - I really don’t want to learn yet another a new environment! I can’t be too far from a proper port on the actual app, though, since it runs fine on an ME with JTAG. Just got to get it into the flash…

I have understood that the app should be linked to run at 0x808000 up in RAM - is this right? Any other specifics (other than using the ME-specific BSP)?

I’ll follow up your suggestion on the header and hopefully be able to download the image.

One further question, however - once I’ve overwritten the Digi standard application, what support is there in the bootloader for updating the app in the future? Superficially it appears that if the image of the app in flash checks out OK it always gets run.
I don’t need to support ftp in my app (although I could if I have to) - but what if my flash update code doesn’t work? How do I recover from that?

TIA
Steve

Cameron,

Further to my previous post, I’ve had a look and found some conflicting information in various files.

  1. Firstly, am I right in treating the file “image.ld” which is in the “connect” series of directories as the reference for load addresses etc?

  2. This link file appears to create two headers:
    a) A “vpd” header which is generated from a text file, and attached (prepended?) to the binary image. Is the presence of this header essential, and is its content important?
    b) The boot header, which does whatever the fillhdr program does.

TIA
Steve

It is hard to say what precisely could be wrong here.

I presume that you are using the GNU development kit and you have a Connect ME or EM, correct?

I make extensive use of the naftpapp example and have never experience a problem as you describe.

I suggest we discuss this matter in more detail over the phone. Please call our support line at (952)912-3456, or send an e-mail to support.wizards@digi.com and provide us with you phone number, I will call you back.

Cameron

I finally got my ftp application to work. It looks like the naftpapp does not support passive mode ftp transfers.

The following sequence worked. The ftp application is the command line BSD one in Mac OS X 10.3.2

In system preferences, passive mode ftp is enabled. For some reason it did not work if the system preferences passive mode is disabled.

ut223dhcp:~/data/adept/products/code smithsm$ ftp 10.0.2.85
Connected to ut85.eng.adeptsystemsinc.com.
220 NET+ARM FTP Server 1.0 ready.
Name (10.0.2.85:smithsm): (none)
230 User (none) logged in.
Remote system type is NET+ARM.
ftp> bin
200 Type set to I.
ftp> hash
Hash mark printing on (1024 bytes/hash mark).
ftp> debug
Debugging on (debug=1).
ftp> passive
Passive mode: off; fallback to active mode: off.
ftp> put image.bin
local: image.bin remote: image.bin
—> EPRT |1|10.0.2.223|49309|
502 Command not implemented.
disabling epsv4 for this connection
—> PORT 10,0,2,223,192,157
200 PORT command Ok.
—> STOR image.bin
150 About to open data connection.
#######################################################################################################################################################################################################################################
226 Transfer complete
236808 bytes sent in 00:37 (6.10 KB/s)
ftp> bye
—> QUIT
221 Goodbye.
ut223dhcp:~/data/adept/products/code smithsm$

I tried this 3 times successfully