In eclipse and CodeWarrior for MCU10 the usual thing I do is:
- I have a project in my eclipse workspace
- I compile and build it
- I download and flash it to the target for debugging
If I need to program another board with the same binary, then I download it to that board too. Fine. But what if I want to skip point 1 and 2? What if I do not have or want a project? All what I have (and need) is a binary file, and I want is to flash that file to my boar. By pressing a button.
No project, just the naked workspace
Eclipse is very project oriented. But with the release of MCU10.2 it is possible: I can program my boards without a project . All what I need is the binary file I want to flash. Really? Well, close. Some setup is still required.
In the following steps I’m using a new and blank workspace. The same thing can be used with projects in the workspace too. Then things are even easier as I can re-use settings. But here I’m going to do the heavy metal stuff naked, without a project, but with a Magic Wand. Actually, it is a Magic Blue Flash Bolt :-).
To start, I use the ‘Flash File To Target‘ menu:
This gets me the following dialog:
Oh, and here is it: it ask to create a ‘System’….. OMG!
System, Connection, Target or what the ….?
System? Yeah, that’s a very overloaded term (like many others). I would explain an MCU10 ‘System’ as a combination of ‘Connection’ and ‘Target’:
- The ‘Target‘ specifies the CPU used (e.g. MCF51JM128), with its initialization script (if any) and the memory configuration needed (if any).
- The ‘Connection‘ references a the target, plus it holds the settings how I connect to the target, with the Interface and settings for it, e.g. P&E USB Universal Multilink.
Both the Target and the Connection are listed in the Remote Systems view:
The Flash File to Target needs a Connection. So we need to create a Connection and a Target.
Creating a Connection
Pressing the ‘New…’ button in the Flash File to Target dialog gives me:
Ok this is the Connection. Here I can configure the connection settings, and create a new Target.
Creating the Target
To create the ‘Target’, I’m pressing ‘New…’ in the New Connection dialog:
This is the Target (don’t get confused by the dialog title!!!). Ok, you are confused. But this is really the Target. Here I specify the CPU (MCF51JM128 in my case). Having this defined, it allows me to change further settings:
I do not need any Initialization or Memory configuration, so I keep these with the defaults.
Back to the Connection dialog, I choose to use the P&E connection:
This expands the dialog for the run control specific settings:
Now I have my connection and target created from the ground up.
Next I’m browsing for my binary file to be programmed to the board:
Pressing the ‘Erase and Program’ button does what it says: it does a mass erase of my device and programs it with the file. If I need to erase/protect only part of my device, then Programming part of Flash provides the needed information.
Time to wave the wand (or flash bolt): Progress is reported in a dialog window, and as well in the console view.
At the end, the dialog closes automatically (why? what if I would like to flash the file again?). The completion of the operation is reported in the Console view:
Dissection of what is behind
Ok, things are working. Time to check out what is behind. As there is no project, the settings have to be *somewhere*. I notice that I have an LC for Simple Flash in the list of Launch/Debug configuration:
CodeWarrior is using a pseudo ‘Connect’ configuration to store the information.
Note: While this looks like a normal ‘CodeWarrior Connect’ launch configuration, it will not work as such (if I want to use it directly), as it has no project folder associated.
This launch configuration is stored inside the workspace as a normal file:
.metadata\.plugins\org.eclipse.debug.core\.launches\LC for Simple Flash.launch
So while this is not really a normal launch configuration, it is still useful to know about it.
Using the Flash File to Target menu and button makes it really easy to flash a file to the board without the need for a project. Still, for a naked workspace, some settings are required which take a little time to set up. With knowing the things behind, no magic wand is needed, as long as it creates systems, connections, targets or whatever their names might be 😉
Happy Button Flashing 🙂