Author Topic: Code warrior debug & Web Page  (Read 13202 times)

Offline johnr

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Code warrior debug & Web Page
« on: September 04, 2007, 09:34:33 PM »
 Hi,
 I just installed the CodeWarrior 6.3 IDE and opened up the uTaskerV1.3.mcp
and set the target to M52235EVB_ROM. It compiles OK. I noticed that in order to
flash it into the M52233DEMO I had to use the FreeScale flash utilty. If I run this first
I am able to then use the CW debugger on the code. If I make a code change and try
to run it from CW, it displays the status like it's down loading 78K bytes etc, but when
it runs, it's running the previous code that was flashed in with the FreeScale utilty.
Is this a feature of the free 128K limit version of CW ?

 When I try to access a web page on the pcb I get a uTasker 404 error, page not found.
I access it with my IP address, ie 10.1.2.48. I tried accessing astats.htm, index.htm etc  with the same result. HTTP is set in config.h. Is there something else that must be set ?

Thanks,
 John


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: Code warrior debug & Web Page
« Reply #1 on: September 04, 2007, 10:53:31 PM »
Hi John

If you make a change and recompile you must always reflash it into the chip.
If you press the CW6.3 debug button, the debugger is simply loading the debugging information and connecting to the target - it is not flashing anything itself. Therefore, as you have already notcied, it is always necessary to FLASH manually before debugging the freshly compiled code.

You can either FLASH using CF FLASHER (outside the IDE) or with the CW FLASH Tool (inside the IDE). The FLASH tool is usually the most practical method. If you check out the uTasker tutorial for the M5223X -
http://www.utasker.com/docs/M5223X/uTaskerV1.3-Tutorial-M5223X_003.PDF
you will find a step-by-step of using this tool on page 12/34.

Once you get more comfortable with the project, you will be able to install the "Bare-Minimum" boot loader - see the following documents for an introduction and details of programming it to the M5223X:
http://www.utasker.com/docs/uTasker/uTaskerBoot_003.PDF
http://www.utasker.com/docs/uTasker/BM-Booloader_for_M5223X.PDF

The boot loader allows you to load to FLASH via a web browser which is very much more effecient during development (it takes about 10s and afterwards just reconnect the debugger from CW6.3 and continue). Later it allows secure SW updates via the Internet, which is also great for remote corrections or improvements. The latest version of the boot loader (in SP5) supports encrypted SW distribution and also uploads up to 252k programs using a simple and cheap external SPI FLASH chip as support.


When you load the program to your board it has no web pages installed. The ~78k you see is application code and not files - the files have to be loaded into the file system. Again, check the uTasker tutorial since it explains the steps involved. If you haven't used the simulator it may also be a good idea to repeat the tutoral since the simulator is what will cut development times by the greatest amount.
Whenever files are not found in the file system, you will receive the 404 page (as is the case for any web server).

Load the supplied files (in the folder \Applications\uTaskerV1.3\WebPages\WebPagesM5223X) using FTP and afterwards refresh the web browser to see the pages and control some things on the board.

Note that there are a number of advantages in not compiling the web pages into the code (which is a typical method used by small TCP/IP stack solutions). These are:

1. The files don't get counted as code (practical with limited compiler versions...).

2. Any user can change the web pages without having access to the source and the capabilities to be able to compile it again (the FTP server can of course be protected to stop this is required). This allows end users or distributors to customise web pages or translate them into other languages.

3. Web pages can be swapped out for development reasons. For example a developer could load a web page which allowed monitoring and other special configurations. When finished, the developer can reload the original web page again. Since the development page temporarily replaces a working web page, it shares the file system space and so requires no extra FLASH space. This optimises FLASH space in small footprint systems.

4. The comfort of developing is simply much greater... once you work like this you will never want to use the simpler methods again. On the other hand the uFileSystem allows this comfort while using only a small amount of program space to do it - so it will not cause other compromises to have to be made.

A final note: When developing web pages, and espacially dynamic ones which interract with the application code, this should be performed using the uTasker simulator where ever possible (usually it is 100% possible). The simulator also allows web pages to be loaded and stored in its virtual FLASH file system and much simpler and efficienter development that on a HW target. Once the project is working as required in the uTasker simulator simply cross compile for the target, load and check that it behaves the same; it will do so in almost 100% of the cases.

Good luck!

Regards

Mark

Offline johnr

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Re: Code warrior debug & Web Page
« Reply #2 on: September 06, 2007, 02:53:52 PM »
 Mark, thanks for the reply. I just got the simulator compiled and running under
windows and will start working on the project.
 BTW I download the free VS 8.0 express software from MS then had to copy
the Windows SDK inc and lib dirs that a co worker had installed on his machine in
my VS tree. I also had to add various libs to the linker command line in VS ie
user23.LIB etc.

 John
 

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: Code warrior debug & Web Page
« Reply #3 on: September 06, 2007, 04:30:53 PM »
Hi John

This is indeed a known difficulty with the Express editions - they miss the SDK and need some paths to be set by hand.
There is a FAQ available to help: http://www.utasker.com/docs/faqs.html but you seem to have worked it out OK.
I haven't tested the 8.0 express edition so hope that it works as well as the previous one.

Good luck

Regards

Mark