-
Notifications
You must be signed in to change notification settings - Fork 0
Eclipse IDE Support
Contents
The FXCore tooling comes with some customizations for the Notepad++ Windows editor (syntax coloring and launching the assembler). This is useful but Notepad++ is not a full software development environment. This section describes support for writing FXCore assembler code in the Eclipse IDE. There are many advantages to using a full IDE (Eclipse) over a customized editor (Notepad++). Just a few features we find particularly useful in our development of FXCore code:
- Everything is visible in one window including source code, directories and files, output from the assembler, etc.
- Eclipse is available on multiple platforms including Windows, MacOS, and Linux.
- Eclipse organizes code into projects to easily navigate and see all the related source files in one view.
- Eclipse has out-of-the-box integration with popular version control systems like Git, CVS, and others. This simplifies backup and versioning of source files.
- Running the assembler is smoother with output visible in the IDE itself. No additional window is opened.
- Eclipse has an entire ecosystem of plugins and support tools for software development tasks.
FXCoreMP contains a number of Eclipse configuration files to support FXCore programing (see the Installation page for installation and configuration instructions).
Eclipse support for FXCore development consists of the following features:
- Recognition of FXCore assembler source file types
*.fxc,*.fxc-mp,*.fxm,*.fxo, and*.toon. - Syntax coloring of FXCore assembler code including macro statements and TOON syntax.
- Start/end bracket highlighting for
{...},(...), and[...] - Quick launching of the toolchain to run the assembler (and optionally run or program a USB attached FXCore)
- Viewing of toolchain output directly in the Console window of Eclipse
- Build artifacts are created in a /bin directory of the project so the source directory does not get cluttered with intermediate files and simplifies version control with tools like GitHub.
The best way to understand how to use Eclipse for FXCore development is to walk through creating a sample Eclipse project, create a sample FXCore program, and then run the tool chain to assemble that code and produce a HEX file (or directly load into an attached FXCore device).
Note you will need to install and setup the Eclipse configuration files as detailed in the Installation page before doing the following walk-through.
Navigate to File -> New -> Project...
In the list of project types select General -> Project and click Next.

Enter a project name such as FXCTest and click Finish to create the new project. It will now appear in the Project Explorer pane of Eclipse.
Right-click on the FXCTest project and select New -> File
The File dialog will have the FXCTest project selected as the location for the new file. Enter a file name such as SamplePgm.fxc (note the filename must end in .fxc for it to be recognized by Eclipse as an FXCore assembler file).
The new file appears in the Project Explorer under the FXCTest project, and the editor window is opened on the new (empty) file. Notice that the icon for the new file looks like the one shown (a document with braces). This verifies that Eclipse has opened the file with the Generic Editor as required for FXCore syntax support.

Copy and paste the following code into the editor window: SamplePgm.fxc
Notice the syntax coloring (comments are in green, assembler directives are purple, etc.).

Before running the assembler, verify that the Console view is visible in one of the Eclipse window panes (tab groups). Depending on the arrangement of panes in the Eclipse window there may or may not be a Console tab. This is where the assembler message will be shown so you will want that tab available. If there is no Console tab visible, use the Window -> Show View -> Console option to show a console tab. You can drag/drop it between panes to place it where you want. This is our preferred view layout. Notice the Console tab in the lower right pane. The only views you need for FXCore development are Project Explorer and Console. The rest are optional and you may or may not find them useful depending on your development needs.

To run the assembler, click anywhere in the SamplePgm source code (this ensures that the source file is the currently selected resource). Then select Run -> External Tools -> FXCore – Assemble Only. You can also use the convenient External Tools pulldown menu
from the toolbar at the top.
The Console view will show the messages produced by all the tools in the chain (macro expander, TOON processor, FXCore preprocessosr, and FXCore assembler). Also notice that a /bin directory was created in the project folder. All the files created by the tool chain are placed in this directory.

A number of files files of interest are created in the /bin directory, some are useful for debugging:
-
.hex- This is the assembler output containing the basic machine code to program the FXCore. -
.lst– This file contains the assembler output listing. The FXCore assembler does not, in general, output error messages to the console. The console will just indicate “assembly failed”. Examine this listing file to locate the actual assembler error messages. -
.fxc-mp– This the source code after macro expansion and TOON translation. This can be useful to understand how macros were expanded and debug macro problems. -
.fxo– This is the source code after macro expansion, TOON translation, and FXCore preprocessor (library) expansion. This is the ultimate input source file to the assembler. Assembler errors that give line numbers are referenced to this file.
There are two additional ways to run the assembler in Eclipse. These require that an FXCore chip be connected to the computer running Eclipse via a USB connection (see the FXCore ICP (In Circuit Programmer) device for details).
Instead of (just) producing a HEX file, the assembler can load the assembled program into an attached FXCore memory and run it. This is the “FXCore – Assemble + Run in memory” option.
Make sure the source file is selected in the Eclipse window, then Run -> External Tools -> FXCore – Assemble + Run in memory.
The usual tool chain will be run, then the assembler will load the program into the attached FXCore and execute it. Note the messages in the Console window:

The assembler will keep the program running in the FXCore until a key is pressed in the Console window. To end the program, click anywhere in the Console window and press RETURN. The assembler will close the connection to the FXCore (which will then resume running the program currently selected by the hardware):

This will run the tool chain and then instruct the assembler to save the assembled program into one of 16 possible program locations in the FXCore chip.
To save a program into an FXCore program location, Run -> External Tools -> FXCore – Assemble + Program.
A dialog will be displayed to ask which of the 16 memory locations (0-15) are to be used. Enter a number between 0 and 15:

Click OK and the tool chain will be run and the selected memory location will be updated with the newly assembled program:

The assembler terminates after the programming is complete.
Copyright © Cabintech Global LLC