Compiling and Running an Application

Table of Contents

WARNING: I believe library needs to be loaded into the flash, as globally initialized variables do not get reinitialized upon startup if executing from RAM. This information starts to make sense as people informed me I could get persistent memory by simply not reinitializing them in the program which never worked for me, but, of course, I always use ROM. Unfortunately, it turns out correct. This to me seems a major bug in the RAM loading process rather than a "feature".

Compiling the Test Program

After installation, the included test program should compile sucessfully. For either 68332 or simulator, the first application to try is the traffic program included under the test directory. This is a simple traffic light controller project I did for an RTOS class. In the test directory, there should be the files for both the 68332 and DOS makefiles.

NOTE: Change the E/F port declarations in traffic.cpp so that nothing but perhaps LEDs are attached to the output pins.

Possible Errors

  1. makefile:nn: makedepend: No such file or directory -- you simply need to create a file makedepend; it doesn't matter what's in it.
  2. make not found -- Did you install make?
  3. make[1]: m68-elf-gcc: Command not found -- Did you install Motorobots library and put into path?
  4. ar -r ... failed -- Did you install binutils?
  5. ...M68K-ELF-G++.EXE: *** you have multiple copies of cygwin1.dll on your system -- for some reason Motorobots /gcc-m68k/bin has a copy for some reason. Just rename to cygwin1.dll.org or something.
  6. The procedure enry point __getreent could not be located in the dynamic link library cygwin1.dll -- Same as above. Rename the extra copy of /gcc-m68k/bin/cygwin1.dll installed.

Host Execution

After installing and compiling both the OOMRM library and the traffic.cpp program, you should now have two programs:

The two programs only way of communicating is through the shared memory. Thus the importance of the memory module (WSIM). Now you are ready to press either the play button or the Step button for micro-stepping mode.

NOTE: if you start the rtos before the simulator, it simply exits.

NOTE: if you put a "print" statement in the user (rtos) portion of the program, it will abend! Thus, the importance of communication between the two programs.

M3

There is another program main.cpp that controls a mobile robot that works in either simulator or embedded mode. The shell script to compile the host version is 'doit' (this will compile all the programs need). and the 68332 makefile is just "makefile". This is my robot that is currently under development for the RSSC hall contest--M3. after compiling and executing (again, start sim first, then rtos.exe), start the simulator by pressing F5. The clock should start (there is a bug and sometimes I have to exit and start again). After setting the robot platform specifications on the platform tab, robot position on the map, and enteringn waypoints, you should be ready to press F3 to bring up the keypad and enter '3' followed by a 'D'. This is the built-in function to start the Local Waypoint Driver (see main.cpp TaskDiaglogue for details).

Starting a New Project

If only using the hardware API portion, then little setup needs to be done. Just be sure to follow each individual classes requirements. On the other hand, using the mobile robot model can be more complicated. The best way is to copy the test program traffic.cpp.

NOTE: If only using the hardware 68332 components and not the RTOS, then change the oomrm/makeinclude.68332 and remove the define of "-DRTOS".