Search:

Support for 68K/ColdFire C compiler toolset

Frequently Asked Questions

This page contains answers to common questions handled by our customer support staff, along with some tips and tricks that we have found useful and presented here as questions.

Please consult the generic EDE FAQ for questions related to the Embedded Development Environment.


How can I force the Compiler to put my variable at a specified address?

The C compiler supports a directive, #pragma separate, as part of the C language extensions. This directive allows the user complete control over the segmentation of global data. Next step is to use the locator command LOCATE to specify the segment placement.


How do I set up an Interrupt Service Routine to handle interrupts?

To set up a Interrupt Service Routine for a specific interrupt we recommend you to follow this approach:

  1. Define a function that will be used as the Interrupt Service Routine (ISR5 in the example) with the keyword _IH.
  2. Make sure that this function cannot receive any parameters and that its return type is void.
  3. Create a function (set_handler in the example) that will place the address of the Interrupt Service Routine at the correct vector in the vector table.
  4. Call this function from your main (or initialization) function with the address of the Interrupt Service Routine and the vector.

Example:


How do I set up Simulated I/O for my application?

To use Simulated I/O, you should have an <tool_path>\itools\simio directory (created during installation of CrossView Pro). This directory should contain at least three files simio.c, simio.h and stdsimio.c. When you intend to use Simulated Input, please download the Simulated I/O update from the 68K support page. This update will fix some small bugs. Please follow the next steps to add Simulated I/O to your project:

1. Add the three files to your project file list. 2. Add an additional include path (<tool_path>\itools\simio) to the EDE > Directories > Include Files Path. This additional path should be placed in front of the default include path.

Please follow the next steps to set up Simulated I/O in CrossView Pro:

1. Load your application into CrossView Pro. 2. Enable the use of Simulated I/O streams: Open the Debug > Simulated I/O Setup... dialog. Select stream #0 for Input and press the Activate button. Select stream #1 for Output and press the Activate button. By default, stream #0 will be used for stdin, stream #1 for stdout and stream #2 for stderr.


How do I extend the available memory space for the simulator?

By default (when CrossView is started) there is only 128 kB of memory available. This memory is available in slot 0 (CrossView supports up to 16 slots of 128 kB). It starts at 0x00000000 and ends at 0x0001ffff. In case your program won't fit in the default memory space or if you want to locate parts of your code in different memory areas, the available memory space can be extended. The following commands are available in the Emulator Command Window:


s_abl <slot>

CrossView will list all the available memory space, when no slot number is provided or only the available memory space for the specified slot.

Examples:


s_aba <slot> <RAM/ROM> <start-address> <end-address>

A memory slot will be created that starts at <start-address> and ends at <end-address>. When no <end-address> is specified, the memory space will end at 0x0001ffff from <start-address>. With <RAM/ROM> you can specify what type of memory will be used for the memory slot.

Examples:


s_abd <slot>

The specified memory slot will be deleted.

Example:

You can execute these commands in the Emulator Command Window (View > Command > Emulator) or in the CrossView Command Window (View > Command > CrossView) by prefixing the command with an 'o' (lowercase letter 'o') like in: 'o s_abl'.


Using the 68k CrossView Pro debugger, I cannot debug code compiled for the 68030; it crashes. When the code is compiled for the 68000, the simulator works properly.

This problem is caused because the simulator shipped with the compiler, is designed for the 68332 (CPU32). Although this is adequate for compiler-generated code, it's possible that some of the assembly code within the library for the 68030 won't work. To be specific, the PMAIN.68K (for the 68030) contains some instructions that won't run on a 68332 and will cause an exception in the 68332 simulator because the instructions aren't CPU32-specific. To work around this problem, all you need to do is to place the PMAIN.68K from the library directory path C:\ITOOLS\RTLIBS\LIB020\SRC\PMN332.68K, into your project directory, and build it into your project.