Post navigation

Tutorial: FreeMASTER Visualization and Run-Time Debugging

I don’t know the source of that quote, but for sure it is true for every developer and engineer too. Engineers need to work a lot with numbers. But numbers can be transformed into pictures and graphs which can make complex things and relationships easier to understand. Verifying proper functionality of a PID closed loop controller or watching sensor values with a nice plot is definitely something very useful. Would it not be great to watch sensor data changing over time in a chart like the one below?

Accelerometer Graph

One way is to export data and then show it e.g. in Excel (which has been great chart functions). But even better, if this could be done directly with data provided from the target board? If you think this is hard to do, then I can show you how this can be done in a few steps with the help of a very nice tool: FreeMASTER 🙂

FreeMASTER

FreeMASTER is a graphical tool to read or write memory on the target, either using a COM (serial) port on the host PC or using a dedicated communication protocol (BDM, JTAG, or CAN). FreeMASTER is provided for free-of-charge on the Freescale web site (requires registration). There seems no uniform spelling of FreeMASTER. Even Freescale uses different spelling (FreeMaster, FreeMASTER, PCMaster, so do I in this post too 😉

FreeMASTER is using the application binary file and debug information for the location of the global variables in the target memory, and is able to display them in ‘real time’ on the host. ‘Real time’ means that it does not impact the target code execution ‘much’. This makes it a great tool to visualize or change variables ‘on the fly’. Additionally it allows to send ‘callbacks’ to the target for advanced control. More about this at the end of this article.

The downside is: it is not very easy to use. Jim Trudeau wrote a great article about the capabilities of FreeMASTER which is a starting point. Similar to the comments on his blog, I have not found I have not found good documentation or tutorials how to use it. This is very I hope I can close a gap.

I want to pass a big ‘Thank you!” to Yayra Kwaku for reminding me that I had the ‘FreeMASTER’ topic in my bucket list for a long time. As a reader of my blog and as intern at Freescale, he explored FreeMASTER and he provided me important tips and ways how to use FreeMASTER. Without this, I would not have been able to use FreeMASTER or to explore the features easily. THANK YOU!

So with this, I hope you find this tutorial helpful and that it gives an easier way to learn this tool. I promise: it is indeed a great tool, it just needs some learning. And a tutorial 🙂

❗ FreeMASTER is only available for Windows. So if you are using Linux, you are (yet again) not covered 😦

Tutorial Outline

In this tutorial I’ll show how to use FreeMASTER to visualize the accelerometer values on the FRDM-KL25Z board and to change the LEDs on the board.

Installation

FreeMASTER Application: this is the visualization tool itself, running on the host. It comes with built-in drivers to communicate with the target through debugging/JTAG/BDM devices like P&E Multilink.

FreeMASTER Communication Drivers: this includes serial communication software drivers to communicate with the target, and source code for other connections like BDM (Background Debug Mode) or CAN and USB. So if you are not going to use the Processor Expert component (I’m going to use below), then you can use the files in this package to be incorporated into your application.

Instructions to download and install are very simple:

Go here and download FreeMASTER from the ‘Downloads’ tab. You need both the ‘FreeMASTER Application Installation’ and ‘FreeMASTER Communication Driver’.

Run both setups (order does not matter) to install the application and the communication drivers.

Project Setup

In the next steps I will add a FreeMaster Processor Expert component to my project which will communicate with the FreeMaster application on the host machine.

💡 I’m using Processor Expert as it comes with a FreeMaster component, and only requires to add two function calls. The limitation is that the Processor Expert component only works with RS-232/SCI, and not with other communication ways like CAN or USB CDC.

I need to insert two calls to FreeMaster library functions in my code. In order to view my variables, they need to be global variables.

💡 Global variables can be ‘static global’ or ‘external global’. They just need to be present in the Dwarf (Debug Information) of the application binary file.

The next steps outline what needs to be done to transform a Processor Expert project into a ‘FreeMASTER ready’ one.

Adding FreeMaster Processor Expert Component

From the Components view, add the FreeMaster component to the project. It can be found in the Components Library view in Processor Expert:

FreeMaster in Components Library View

To add it to the project, either double-click on it, use the ‘+’ icon or drag&drop the component to the project.

In the Component Inspector, enable Oscilloscope, Recorder and Application command:

Configuring FreeMaster Component

💡 ‘Recorder’ is a feature I’m now not covering in this tutorial, but I’ll have it enabled.

UART Configuration

Next step is to configure the UART: I select the device (e.g. UART0) and enable the Clock gate in the Init_UART sub-component. Then I configure a suitable baud (9600 baud in this example) with divisor and oversampling ratio values as below:

Init_UART Configuration for 9600 baud

❓ It is too bad that the FreeMaster component is using the Init_UART component (why?). It is very complicated in and not intuitive to set up the Baud rate with Init_UART. Why is it not possible to set up the desired baud as in the AsynchroSerial component? And with this way of component, it is not possible to say use USB or CAN?

Next to configure the UART RX and TX pins:

UART Pin Settings

Finally, I enable the error interrupts (so the Init_UART component is happy about the settings):

Error Interrupt Enabled

Generating Code

With this, there should be no errors, so time to generate code, either with the context menu on the ProcessorExpert.pe file or with the button below:

Generate Code

There are the following three warnings in the Problems view:

FreeMaster Warnings

They remind me that I need to call the FMSTR1_Poll() function to keep the communication alive with FreeMaster, and that I need to use the FMSTR1_Recorder() function to sample variables in the recorder.

❓ I have the requirement to have my projects error and warning free. Unfortunately I have not found a way to get rid of these warnings? Even if I’m using the functions, the warnings do not go away?

The FMSTR1_RegisterAppCmdCall() function can register added callbacks and is not used in this tutorial (I will use a direct way. More about this later).

Poll() and Recorder()

I add both FMSTR1_Poll() and FMSTR1_Recorder() calls to my application main loop. For this I can use drag&drop to place the function calls into my source file:

Added Poll and Recorder Calls

If needed, add the proper include to my source file:

#include "FMSTR1.h"

Global Variables

FreeMASTER is accessing the target memory. For this, a variable needs to be at a fixed address. Accessing local variables on the stack does not make sense, as the memory address will change all the time. Therefore, any variable I want to watch, needs to be a global one.

💡 FreeMASTER can use as well directly the address of a memory location. But it is more user friendly to find the address of the memory location, based on the variable name.

So if I want to see my x, y and z accelerometer values (which are local variables in my example), I need to copy them into global variables. For this I add extra code to make accelerometer values global:

Global Variables for FreeMaster Access

❗ Of course if the variables to watch are already global, no copy is needed. But if you want to monitor local ones, then you need to make them global. Please refer to the project sources on GitHub.

With this, my application is complete, and I can build and download it to the board as usually.

FreeMASTER Application

Run FreeMASTER from the shortcut installed:

Running FreeMASTER from Shortcut

The application probably will complain about a communication port error:

FreeMaster Error (Could not open the communication port)

Click OK to get rid of it.

💡 Consider changing the FreeMASTER shortcut to add the project *.pmp file (more about this later), so it loads automatically your project at startup.

Select the menu Project > Options:

Project Options

Here we need to setup the communication and which binary file (map file) to use.

COM Port

Select the COM port where you connect to the board and the Baud (see above) you have configured on your board:

COM Port and Baud Settings

💡 If you are unsure which COM port is used, check the communication ports in the Windows Device Manager:

COM Ports Used in Windows Device Manager

Map (or ELF) File

FreeMASTER is using the information inside the debug information of the ELF/Dwarf file. Under the ‘MAP Files’ tab, browse to the .elf application file and specify the File format:

Selected ELF File

❗ FreeMASTER is using old/outdated Windows libraries for the browse dialogs. As a result browsing Libraries in Windows 7 or 8 will not work, so you need browse to the absolute drive path.

This completes the communication setup. Press OK.

Creating Variables

With the .elf file specified, we can add variables to watch in FreeMASTER. Use the menu Project > Variables:

Project Variables

Initially, the list of variables is empty, so we are going to create new ones with ‘Generate’:

Generating Variable List

💡 I could use ‘New’ as well, and then setup things from scratch. Generate is a better way in my view as it automatically populates the settings with the settings from the debug information.

Then I select the variable and use ‘Generate single variables‘:

Generate Variable

I do this for all my variables:

Variables created

Then use ‘Close’ button. And I have my variables listed in the variables list:

Accelerometer Variables Created

Using the ‘Edit…’ button on a variable shows the details about it. For example the sampling period can be changed:

Changed Sampling Period

💡 FreeMASTER is using the data types for the variables as defined in the .elf file. In the above case, AccelX is defined as uint8_t in the sources. It can be changed in this dialog to a signed fixed point type (or any other type) as needed.

Then close the dialogs with OK.

Saving Project Settings

Now it would be a good time to save the project settings so it can be loaded later again:

Saving Project Settings

Otherwise if you close FreeMASTER, you will lose all your settings. So do not forget to save your settings on a regular base.

💡 I recommend to save the project file inside the CodeWarrior project folder. That way the path to the .elf file will be relative to the project root, and allows easier sharing of the file e.g. in a version control system. Additionally if you specify that project file as argument to the PCMaster.exe (that’s the name for FreeMASTER executable), then it will load that project file at startup.

Creating Subblock

To show the variables, we need to create a ‘Subblock’. To do this, right-click on the project icon and use ‘Create Subblock…’:

Creating Subblock

Provide a (hopefully 🙂 ) meaningful name:

Naming Subblock

In the ‘Watch’ tab move the variables you want to watch to the right side using the ‘Add ->’ button:

Watch Tab with Watched Variables

Then close the dialog with OK.

Watching Variables Values

How to see the variable value? Select the subblock and I can watch the variable in the lower part of the window:

Watching Variables in Graphical View

Having the variable value updated periodically is one thing. But I want to see the values plotted over time. To view the variables in graphical mode, right-click on the subblock and then create a scope:

💡 ‘Scope’ is meant here like a oszillo’scope’, and not in the sense of ‘scope’ in the sense of programming languages. So not like the ‘scope’ of a variable 😉

Creating Scope for Graphical View

Then use the Setup tab to assign variables to colors, using the drop down to select variables:

Assigning variables to colors

Close the dialog and we are ready to show the graph.

Showing the Variable Plot

To show the plotted graph, select the scope created and enjoy the graph in the ‘oscilloscope’ tab:

💡 There is a ‘algorithm block description’ tab which I do not cover here. See the documentation about how to use it. You can hide this tab too if needed.

That way I can now control and change my application from FreeMASTER by changing this application variable:

Changing Variable

App Commands: Passing Information to the Application

With FreeMASTER it is possible to send commands to the application. That way commands with parameters can be passed to the application without using additional global variables. It is like if I would call the application on the board from the PC host. I can have multiple of such commands (each with a unique ID) on the host to control my embedded application. This can be used for testing purposes or for demonstrating functionality or to stimulate the system.

To show this, I’m going to send a custom command to the application to toggle the RGB LED on the board. I want to implement the following interface:

/*!
* \brief Toggles a LED on the board.
* \param[in] ledNO Which LED to toggle, 0 for red, 1 for green and 2 for blue LED.
* \return Error code, 0 for OK and 1 for failure.
*/
uint8_t toggleLED_cmd(uint8_t ledNo);

FreeMASTER Application Command Definition

First, I define the command in FreeMASTER. Right click on the subblock and select Properties:

Subblock Properties

Then create a new Application command with ‘New..’:

New Application Command

In the ‘Definition’ tab I give the command a name and a code number:

Application Command Definition

💡 The ‘Code’ is a numerical value I can use later in my application to differentiate between commands. It is more like a ‘command ID’.

In the ‘Arguments’ tab I specify the argument(s) to be used:

Application Command Argument

I can have multiple arguments. In this example I just need one: the ledNo as a one byte of integral type.

Similar to this, I define the return codes:

Application Command Return Codes

With specifying a message icon, I the given return code text will be shown in a dialog box (more about this later).

Handling FreeMASTER Application Commands in Application

I define three variables in my application (they can be local variables too):

Sending Application Commands

To send the application commands, make sure that the ‘Fast Access Pane’ is enabled:

Show Fast Access Pane

With ‘Send’ a command is sent:

Sending Application Command

Double clicking in the command or using the ‘Send Dialog…’ opens a dialog:

Send Command Dialog

Make sure to check the ‘Wait for result’ box if you are interested in the return value. The argument values can be changed too:

Selecting different parameter value

With ‘Send’ the command gets sent to the application. Based on the return value and the return value settings, a dialog box is shown (only if ‘wait for result’ is checked):

FreeMASTER return value box

Stimulating Variables

Similar to changing variables, it is possible to stimulate variables. Stimulation means that FreeMASTER will change the variable over time. For this I have added a variable ‘stimulatedVar’ to my application.

To create a stimulator, I use ‘New…’ in the ‘stimulators’ tab:

new stimulator

Then I select the variable to stimulate, plus the time-table with the values:

Stimulation Time Table

There are a few important details which might not be clear from this dialog (and I might be wrong as I have found no documentation about this feature in the delivered documentation, but I will prove my points below 🙂 ):

The Time in the table are absolute time points, relative from the start of the stimulation.

Between two time points the value between it gets *interpolated*, with the frequency given the ‘approximate time step‘ setting. So if this is 100 ms, then a new value will be written every 100 ms. So every 100 ms a new value gets written.

The stimulation either runs once, or in a loop if the ‘Run in the loop‘ is enabled.

As visible with the graph, the stimulation is ‘approximate’. It seems not be at the very millisecond. Still, this is a very useful feature for changing variables on the target over time.

To run the stimulation, either double-click on it or use the context menu:

Running Stimulation

The running script is showing with a ‘green walking person’ 😉 :

Stimulation Running

To show what happens with the time-table I have set up, I show the plot of the changing value:

Stimulated Variable Graph

In summary, I can now watch variables, change them, display them in graphs, send my custom commands to the application, and I can send stimulation values :-).

Creation of Advanced Control Pages

There is more in FreeMASTER, and one big thing I have not touched is using advanced visualization pages in FreeMASTER. I have not found much information about this, except an application note AN2263 from 2004. It explains how FreeMASTER can be extended with HTML pages and to use ActiveX.

❓ The dependency on ActiveX might be the reason FreeMASTER is not available on Linux?

Using Debug Connection

Another part which I have not touched yet is using a Debug Connection to the target, instead of using the serial communication protocol. This requires a JTAG/BDM run control unit like a P&E Multilink. The advantage is that this does not need changes in the application running on the target and does not need a serial port. The downside is that at least with the P&E Multilink debugging while running FreeMASTER is not possible, at least not for ARM/Kinetis.

Troubleshooting Tips

As with any software and tools, FreeMASTER is not perfect. Below are some tips & tricks in case of problems. Be free to post a comment if you have more hints and tips!

No Updates

One problem is that the variables in FreeMASTER do not get updated any more: they are frozen. I saw the application on the board running properly, and the serial connection was transmitting data. But FreeMASTER somehow was stuck. Closing FreeMASTER did not help. Logging out the user was not enough, it required a full machine reboot :-(. I had that case several times, and it seems to be related to the fact if switching back and forward between FreeMASTER and normal serial connection (having a terminal program open and connected to the board if not using FreeMASTER ). It seems that FreeMASTER then blocks the serial port, and only a reboot of the machine helps. So be careful with using terminal programs (especially on the same COM port) in parallel with FreeMASTER.

Host Suspend/Resume

The other thing I noticed: Suspend/resume on a notebook while FreeMASTER is running can be problematic. I need to exit FreeMASTER first, then suspend the notebook, and start FreeMASTER again after resume. Otherwise a ‘Can not detect board information’ error can show up:

Can not detect the board information

Sometimes it helps to unplug/re-plug the USB cable of the connected board (using USB CDC). In some cases I had to reboot the machine.

💡 The above issues might not be directly related to FreeMASTER itself, but to the USB CDC drivers (I used the FRDM boards with OpenSDA USB CDC drivers). It could be that using a ‘real’ COM port would work fine, but I have not tried this yet. But avoiding the notebook to enter suspend definitely helped in combination with FreeMASTER. Suspending the notebook with other application (terminal programs) seems not to be a problem.

Return Code Number in Message

A ‘#’ in the return code dialog box is supposed th show the return code number in the message:

Return Code Symbol

However, this did not work for me:

Wrong Return Code Value

I do not have a workaround for this (yet).

Return Code Dialog Box

The return code dialog box did not work initially (not really sure why?), as it should (it did not show up at all).

return code dialog box

Sending commands worked, but not the dialog box. It worked after closing FreeMASTER and loading the project again.

The other catch is: the dialog box shows up if the command is executed only if you do it with the ‘Send’ context menu. But it does *not* show up if using the ‘Send dialog’ way with the ‘wait for result’ unchecked. To show the return dialog box using the ‘Send dialog’ way, the ‘Wait for result’ needs to be checked.

💡 It would be more intuitive if each command would have a check box ‘show return code dialog box’.

Debugging

Debugging the application while connected to FreeMASTER is possible. But it is not possible to debug the board if FreeMASTER is using the debug port (instead of serial port). I was able to use FreeMASTER on the same USB connection to the FRDM-KL25Z board, both having the debugger and FreeMASTER running the same time. The CodeWarrior debugger is using the USB cable to debug, while the same the USB cable is used with USB CDC. But the target should not be halted during FreeMASTER application command processing, otherwise a timeout will occur:

Summary

FreeMASTER is a free-of-charge tool to monitor, visualize and change variables or memory on my embedded system. It is suitable for a ‘few’ variables, as ultimately it will not allow to transfer a lot of data in a very fast way. But it works very well for a few bytes every few 100 ms. An ideal tool to inspect a system to see what is going on, either with a serial connectivity or using a debug port. Although FreeMASTER is intrusive to some extend, it adds a lot of value during the development of a system, as it allows to monitor and change the system in nearly real time.

For using serial connectivity, It requires that the target system adds a FreeMASTER library/source support. It offers using a debug port too, but then you cannot debug and visualize the same time (at least with ARM targets). It is using a viewer on the host PC (Windows only) which communicates to the target. Altough the FreeMASTER user interface and runtine library is not very easy to use, it is very easy to use with the help of Processor Expert. But it would be great if Processor Expert could support other protocols beyond Serial. For example the FreeMASTER communication drivers have the FSL USB Stack CDC sources added, but there is no way use it with Processor Expert. Unless Freescale would release a better component which would allow more flexible connections, I probaly need to implement my version if it to use something like my USB CDC component.

Unfortunately FreeMASTER is only available for Windows and no other host operating system. It seems that the FreeMASTER architecture and libraries used (e.g. ActiveX) does not make it easily portable to other systems. It is understood that such a tool is useful as a standalone version, but I wish it would exist as plugin in Eclipse. That would make it even more useful, and would certainly solve the cross-platform issue.

Neverless, FreeMASTER is a very useful tool. And I hope that tutorial is useful if you were searching for a tutorial about FreeMASTER as I did ;-).

Happy FreeMASTERing 🙂

PS: The accelerometer project used in this post is published on GitHub.

About Erich Styger

Erich as always you did an excellent job. If memory servers me PCmaster was the original name and when Freescale came about form Motorola it was changed to FreeMaster. None of that really matters.
The early usage was for motor control visual feedback, so the few App Notes and documentation make the package seem to be for DSCs only. We beat our way through usage for motor tuning and drive information in our robots with not enough time to write an App Note. Besides our company is to small by Freescale standards to publish our App Notes.
You are correct in there is no Note out there on how to use and/or configure FreeMaster which in itself is a shame.
Keep up the great work.

Hi Bill,
thanks for feedback and reading :-). Yes, most of the things I have found is DSC oriented, at it looks like only for DSCs (with USBTap/EtherTap) it is possible to use FreeMaster while debugging (if using the debug connection). But I think the value of that tool is well beyond motor control, but unfortunately it got labeled as such.

Erich, I think the original intent was for motor control readback but you have shown what we have not had time to do. I am looking at using it as the data source for joint motion on a screen (robotic arm). We have some other ideas but are not ready to release the thought just yet.

Glad to hear you met an old friend :-). It is like you wrote in your blog a gem, but an unpolished one. And if it would have at least some of the capabilites of National Instrument LabView, that would make that tool really outstanding.

When you made the post on USBDM and Freedom board I use it with Freemaster and I did not use the Freemaster component in my code, and is much faster than for UART. Would be interesting to see you try 🙂

There is the FreeMASTER communication plug-in that allows to access the target hardware over an alternative communication interface. This plug-in supports several BDM interfaces based on open source firmware including USBDM.

To select the USBDM, in the menu Project > Options click on the Plug-in Module and select the “FreeMASTER BDM Communication Plugin” in the drop-down list. Then press the Configure button and select USBDM.

Hi all,
Being an old and very attached user of FreeMaster ( or PcMaster at the beginning of its story ), i’ve just to add a small note to the Erich’s article : FreeMaster view all the global or STATIC variables . In other words , you can view a variable internal to a function like this :

void func( void )
{
int a;

…..
}
simply by adding the static qualifier : static int a;

The static qualifier, infacts, says to he compiler to allocate space in RAM for that var and to not use the stack.

Hi Luca,
thanks for that additional point: yes, indeed, ‘static locals’ can be used too. I just add the note that some compilers might use very special names in the symbol table, so it might be hard to identify them.

Hi Erich, great job as usual.
Despite I’m a very old Freemaster user, your tutorial taught me a lot: thank you very much.
I just would like to point out that Freemaster for KL is not able to read MCU registers (sometimes useful to check configuration on target when you can’t put breakpoints) because target side firmware reads 32 and 16 bit variables (so registers too) byte by byte.
The program jumps to hard fault handler in this case.

Anyway this is OK for S08 MCU where most of registers are 8 bits wide.

Will it be possible to make a modification in the processor expert generated code?

Of course workaround is to stop code generation and modify the generated code but it does not look so smart 😉

Hi Erich, thanks for your reply.
Yes I think it’s a bug too and I have already reported it to FSL…
Anyway to read a register:
Menu Project\Variables\New. The “usual” form will appear: enter for istance register name as variable name and its address in the edit box below, specifying type and size. Then you can set sampling period…That’s it.

I am also using FreeMASTER in my ‘Programming Microcontroller’ Course at my University. The tool is perfect to teach the student in online calibration and even for a HIL enviroment by using the interface between FreeMASTER and Matlab. All this is possible with a free licence. so first of all thank you to Freescale for providing this. However it is not everything nice-and-easy. The amount, the level of details and its widespreaded distribution makes it hard to get used to the tool. Although you are doubtless one of the worldwide experts in everything around the Freescale ecosystem you discovered a lot of obstacles during your work with it and there are still some questions open. Imagine how hard, better say frustrating it could be for a 2nd year student. So what I would love to see is a central place on the Freescale Website that collect everything about FreeMASTER and also has sufficient examples how to use the tools for the different purposes. I know there is already a lot available – but it would help a lot to centralize it.
Another thing are the available communication plug-in’s. I am planning to use the TCP Interface (via Ethernet). The belonging plug-in is marked as ‘experimental’. So I balk a little bit to start the project because I know I will have to solve a lot of things on my microcontroller – but it would be hard if I always have to question the host side as well.
So my conclusion: Great tool for many important things during the developement of an embedded system. However a little bit more attention and development from Freescale side is necessary to get its whole potential.

Hi Markus,
many thanks for your write-up, and this exactly matches what I have encountered while using FreeMaster on my own. I’ll pass this to my Freescale contacts, so hopefully this will be considered.

Great to see the profile of FreeMaster being raised, I have used it since it was PC Master and find it very helpful.

One thing that can be done is to use the FreeMaster driver on your micro and then implement your communications from your own PC software. You can then design your own UI without limitations. I used Visual C# Express to do this, any tool that can write to a serial port can be used. The protocol is fully documented. Just watch out for endian swaps.

Note that I found an issue with the Coldfire V1 Processor Expert component for FreeMaster, which I explain here:

Project created by the wizard are creating a .elf file per default. In my property window of the project (debugging page): debug level maximum(g3), debug format dwarf-2, Other debugging flags -gstrict-dwarf.

I get the same error “Dwarf section corrupted”. My ELF file is compiled with -g3 and -O0. I’m using GCC version 4.8.0 which outputs the Dwarf 4 superset of Dwarf 2. Is it possible Freemaster is unable to parse certain Drawf 4 sections and this results in the error “Dwarf section corrupted”.

I have very well possible that Freemaster is not able to read Dwarf 4, as to my knowledge FreeMaster is using its own parser. There should be a new FreeMaster version out (V1.4), although I have not tried it yet, but you might give it a try. I’m using v1.3.

Hi Erich, Thanks for the post, I have learned a lot :D.(Really xD)
I have a Question:
Can I use P&E multilink USB with FreeMaster?
I want to see the behavior of some data, but I dont see the opcion, I´m using the DEMOEM.
Thanks for Advanced.

Looks like FreeMaster does not have the debug information. Make sure that in the Options/MAP Files tab you ahve your .elf selected, with ‘Binary ELF with DWARF1 or DWARF2 dbd format”, and that it lists the .elf in the list of valid symbol file formats (see https://mcuoneclipse.files.wordpress.com/2013/08/selected-elf-file.png). Maybe browse for that file again.

Hi Erich, veryvery useful site and post! Thank you for taking the time to make such detailed Information avalable!
However, I am having a Problem with the “Cannot detect the board Information” error you mentioned above. It is appearing always and not only when I had the PC in sleep mode. I also noticed, that I need to run FreeMaster as an Administrator explicitely, else it wouldn’t even start. I tried the USBDM plugin mode, too, mentioned by a reader. Nothing helps. Any ideas on how to get this running?
Best regards, Adrian

hmm, download says 1.3.16, installed says 1.3.15… whatever… but it still doesn’t work. What role does the communication driver play? I installed just the most recent one. Your tutorial says that this is only necessary if Processor Expert Component is not used. Do I need to use it at all if I only use the USB OpenSDA Connection?

I had not installed these communication drivers. From the Processor Expert component and application I’m using the normal UART of the microprocessor, which then gets translated by the K20/OpenSDA chip to USB CDC. On the host PC this is a normal virtual COM port which then is used by FreeMASTER. So all what you need for this is a working USB CDC/Virtual COM with the FRDM board. You should have that by default already. Check your Windows device manager if it shows up under the COM ports.

Hi,
I have tried to use PE with FRDM-K64F and to use the Freemaster PE cmponent, but it doesn’t exist, in the alphabetical order I have FreeCntr8 and then FreeRTOS, but NO FreeMaster, where can I find this?
Kind regards,
Anders

Yes, for strange reasons Freescale did not include the FreeMaster component into the KDS and Driver Suite distributions. I guess it was an ovesight, as it is present in CodeWarrior. I have been told that it should be included in the next release.

Hi Anders,
yes, it is not included in KDS (or Driver Suite 10.4). It is part of CodeWarrior for MCU10.6, but I think there is not a way how to extract it from CodeWarrior and install it in KDS. I have been told that it should be included in the next version.

Hi Erich,
I have now been able to port the code in the Freemaster serial driver + using the PE “init_Uart” component to set correct baudrate and pins etc to work with the virtual com port on the FRDM-K64F. And when starting the C:\Freescale\FreeMASTER_Serial_Communication_Driver_V1.8.1\examples\Kxx\TWR-K60N512\demo.pmp and just changing the elf-file + setting the COM9 which is my virtuall port,and it connects!!
BUT the var16 in the control window is the only variable that is updated and NONE of the variables in the watch view in the bottom are updated not even var16 here???
When opening the oscilloscope view doesn’t work either NOT even the var16 is showing any trace at all, have you seen this strange behaviour?
/Anders

Hi Erich,
Its a pitty I can’t upload a screendump of Freemaster, sorry for not being clear about what I was testing: it is a Demo project that comes with the Freemaster serial driver v1.81 that has global variables var16 and var32.

See C:\Freescale\FreeMASTER_Serial_Communication_Driver_V1.8.1\examples\Kxx\TWR-K60N512\demo.pmp

And the realy strange thing is that I can see var16 but just in the “control view” I think it is some html code that uses “inline” the var16 value and this value is changing OK,
BUT in the bottom “Watch view” NONE of the variables are updated, they just show a “?” also the var16 is showing a “?”
/Anders

Hello Anders,
this seems as a known bug which affects the FreeMASTER 1.4.x running on 64bit Windows systems. It will be fixed in FreeMASTER version 1.4.3 which is going to be released by middle of October at http://www.freescale.com/freemaster.

A workaround is to keep the serial port closed when the FreeMASTER starts and to open the port manually (Ctrl+K) when the FreeMASTER main window opens. You can change the start-up port settings in Project/Options… dialog.

We have used PCMaster for a long time with the Motorolla DSP56F80x line of controllers, recently we have swapped up to Freemaster and are experiencing issues when using the scope functionality. It will work as expected for a short period of time, it will then switch to greyscale and is no longer able to be navigated using the mouse. At some point latter it sometimes the whole scope window turns black. This happens on multiple computers so I do not think it is graphics driver based. Any Ideas?

I have not upgraded to the new version, as I have seen reports with issues, and I did not need the new version anyway (“never change a running system”). Not sure if the files are backward compatible, but I hope so.

Erich, the project file of the 1.4. Freemaster are not backward compatible with 1.3.x . The Freemaster 1.4.x is able to read the previous version but when you save the project file with the new version that file will not be more “readable” by 1.3 software.

Anyway, I’d like to suggest to download the latest version ( 1.4.3 ) from the Freescale website . In my experience ( i’m using FreeMaster mainly in conjunction with DSC ), no problem so far ..

I setup the UART0 port correctly and verified that I could communicate to the port and I also see the port in the freemaster utility. But when I try to read a global variable it gives the following error:
App:ReadValue(counter)
ReadVar(addr:0x1fff83dc, size:0x4)
Detect done [ERROR code=0x80000101]
done [ERROR code=0x80000103]
done [ERROR code=0x80000103]

Is there something special that needs to be done to get freeMaster working with an MQX lite application? (other than the steps you mention in this post)

I have FreeMaster connected to the Freescale KIT9Z1J638EVM through the USB and the variables are being read through the scope and in Variable Watch. When I try to add a Recorder I get the following error “Recorder Could Not Be Initialised. Error 0x80000081(Invalid Command).” What does this mean, as I cannot find any information on the web? In the Recorder properties I also see that Board Time Base is “Not Defined” and Current On-Board Recorder Memory is at 0 bytes. I have tried everything I can think of, but I cannot get the recorder to initialize. Any ideas? I had a Freescale technician look at the code and he changed a few things and said that he did not get the recorder error on his system, but I get it on mine.

Changing the SCI base only affects the UART address/port, and I’m wondering why this should have solved your problem. So there must be something else wrong. Have you tried stepping through the FreeMaster code on the target to see where the problem could happen?

The Freescale tech was just correcting anything wrong in the code for my application. I think I found the problem, I am using the BDM communication plugin, because it Freemaster will not connect to KIT9Z1J638EVM via the serial port. The BDM connection has some limitations, see Startmenu | FreeMASTER 2.0 | Protocol & Library Documentation which reads “FreeMASTER Recorder, Application Commands, Target-side Addressing, Masked (bit-wise) write access and other higher protocol features are NOT available with BDM. In order to use such features over the BDM, use Packet Driven BDM Plug-in with FreeMASTER Serial Driver running on the target side.”

Hi Chris,
Ok, good you have found it. I admit that I have not used BDM or direct debug connection in my use cases, so thanks for pointing that out for everyone else who could run into the same problem.

Hello everyone!
I have 3-Phase BLDC/PMSM Low-Voltage Motor Control Drive from Freescale and I uploaded it with sample program from producent. I used to it CodeWarrior 10.6.4. I used to it MC9S08MP16 daughter board. BLDC works well but I have problem with Freemaster application. I didn’t change anything in the code and in it it was part for Freemaster too. When I want to show charts in Freemaster there is error: The hardware recorder could not be initialised. Error 0x80000101 (Response timeout.). I checked freemaster_cfg.h library and I think everything is correct:
#define FMSTR_USE_RECORDER 1 // enable/disable recorder support
#define FMSTR_MAX_REC_VARS 8 // max. number of recorder variables (2..8)
#define FMSTR_REC_OWNBUFF 0 // use user-allocated rec. buffer (1=yes)
Could you help me with this problem?
Greetings,
Pawel

I’m using Freemaster 1.3. That is version which was on the CD with added to kit. I try to use scope and it’s working good.
I don’t know what means triangles and circle appeared in my scope. Do you know?http://postimg.org/image/734yqyuud/

No, I have never seen that message. It seems like the communication between your host and the FreeMASTER agent on the target is corrupted (corrupted checksum). Can you verify that there are no issues with it?

OK
after debug i’ve got 2 new errors :
I2C2.h: No such file or directory Events.h /acc/Sources line 34 C/C++ Problem
I2C2.h: No such file or directory I2C2.h: No such file or directory Events.h /acc/Sources line 34 C/C++ Problem

They’re both in “Events.h”.
I’m extreamly fresh in CodeWarrior and C but I need to grab few scopes (FreeMaster) from ACC on kl25z. This is one-time need but if it end successfuly I’ll take some time to know CW better…

But these messages did not affect debugging in any way, correct?
Just in case, this might help: do a Project > Clean and rebuild your project. Or delete the ‘Debug’ folder in your project and do a rebuild.
I hope this helps.

While runing the debug process I’m getting connection fault.
I have my kl25z on port com3, but in connection settings (OpenSDA Embedded Debug – USB choosed) there is no device detected. This way I can’t perform full debug process. I’ve reinstall usb drivers from P&E.
When I connect the board to SDA port mbed drive shows up.

My bad, I’ve forgot about draging the updated app after updateing the bootloader…
so far so good, but still it’ not perfect – i’ve set the communication options in freemaster, but i get a communication error : could not open the communication port…

No 😦
When I check communication options in freemaster it detects board on com4 (baudrate is set correct) but when I try to connect it pop up’s an error : could not open the communication port… have no idea how to move it…

I know I look stupid but I really need Your help. Everything seems to work fine. I get the x y z values from my acc, I read those values in freemaster but I always get the XYZ values in DEC (i.e. XX,000 where only “XX” changes). I tried to change every settings in freemaster but nothing helps. But thats not all. Can You please tell me how to transform those readings from ACC to any readable form? I mean how to change them to “g” units or even better to “m/s2” or “mm/s2”?
Right now I’m just checking values for each axis in still position and multiplying them by 9,81 (m/s2) but I doubt it’s a good idea…
Mabey there is another way to get valuest form ACC in a readeable form?

I suggest that you make the conversion e.g. to m/s2 on the target and store it a global variable, then read that variable(s) with FreeMaster.
As for decimal->hex conversion: I did not need that, so I don’t know 😦

Hi Erich,
I tried to install FreeMASTER 2.0 using CodeWarrior 10.6 and KL25Z with OpenSDA, but unable to do so. Could you please help and advise the procedures/links where I re-install the FreeMASTER 2.0 for use with OpenSDA.

Hi Hoe Min,
I have used FreeMaster V1.3 and V1.4 sucessfully, and have not seen a reason to upgrade to v2.0. So I don’t know what problems you are facing? I think the previous versions are still available and you could check if the v1.4 or v1.3 works for you?
I hope this helps,
Erich

This is the first time I use FreeMASTER, I just picked the latest version.
I will delete v2.0 and install v1.4.
I presume there are instructions on v1.4 to do the setting to use OpenSDA, otherwise please advise.

The codes written on C were fine, but just cannot get the FreeMASTER 1.4 to display the temperature profile yet because I have trouble in understand what setting need to be done on FreeMASTER 1.4 to get it working.

I was not able to follow the procedures stated in your article because it was written with Process Expert. Could you please provide me with the instructions how to configure the settings of the FreeMASTER 1.4 to capture and display the data.

Enjoyed the article. Was hoping you might help me with a problem I am having. I receive the following warning: Description Resource Path Location Type
Warning: Please call Inhr1_Poll() function regularly and process the FreeMASTER communication (typically in main loop of your application). Pix_4000_Test Inhr1 Processor Expert Problem
I am hoping that you can tell me how to fix this problem.

hi，Erich！
thanks for your sharing，it is a great job！I’m a newer in FreeMaster, I have a question:
how can I connect the FreeMaster with the MC9S12XEP100 by TBDML？
My TBDML——HW Ver:2.0，SW Ver：4.6，DLL Ver：4.6，GDI DLL Ver：v1.7

Erich, as usual, your tutorials are amazing! I was able to make this run in the FRDM-KL02 using CodeWarrior and ProcessorExpert. However, I am trying to do the same thing in Kinetis Studio for the FRDM-KL03, but when configuring the Pins/Signals, the following message appears just by Transmitter modulation: “Problem in the component: property model is not supported by the selected processor – LPUART0_TransmitterModulation (Transmitter Modulation)”. I try to enable and disable this option (according to my experience with KL02 it should be disabled), but the problem continues to appear.
This creates 2 errors in the debugger.
– Error in the inherited component settings (Init_UART) Processor Expert Problem
– Problem in the component: property model is not supported by the selected processor: LPUART0_TransmitterModulation (Transmitter modulation) Processor Expert Problem

Have you ever faced this problem? Do you have an idea on how to solve it?
I tried to create a new project in Kinetis Studio based on the project for Freemaster that I generated for the KL02 in CodeWarrior, replacing several code lines between the UART code of the KL02 and the LPUART on the KL03, but I still haven’t been able to make the code run succesfully with Freemaster. Do you have any suggestion? It is very annoying that CodeWarrior doesn’t support the KL03 Processor Expert.

Hi Andy,
I don’t remember I saw something like this. I have not used FreeMaster for a while because the Segger RTT and Segger Scope is providing me similar functionality with less overhead on the device.
Again, I have to create a project myself with KDS and the KL03Z, just give me some time.
Erich

Hi Andy,
I think I see now your problem. The issue is that Processor Expert does support the KL03Z only with the SDK components. But the FreeMaster component is not compatible with the SDK components (I think the FreeMaster development has been stopped at that time. So support as for the FRDM-KL25Z or KL02Z is not possible the same way, and NXP stopped further development of Processor Expert :-(. The only way I see would be to move the source files over from the KL02Z project to the KL03Z and port them to the UART. For sure not something which can be done in a few hours 😦

Erich, thanks for your fast and insight reply. I will try to finish moving the source files, but I guess it can be more time lost that what it will really benefit me in my application. Thanks anyway! 🙂 Have you tried another scope with KL03Z?

Hi eric,
I wanted to run Freemaster as a FreeRTOS task, because in my application i have delay’s and is causing freemaster not to work. My questions is: Do i just create a task which has contains: FMSTR1_Recorder(); FMSTR1_Poll(); functions in the task ? Do i need to anaything else for the Freemaster to work under FreeRTOS?

I´m trying to make a new baremetal project using Freemaster (I´m new with this) for FRDM-KL25Z board and I found this one https://community.nxp.com/docs/DOC-98836 from Tomas Vaverk. The example worked fine for me, but I coudn´t watch it running on Freemaster. I saw the source code but there is no libraries at all on it to communicate with Freemaster, so how the variables are displayed there? I also tryed to run a demo from FreeMASTER_Serial_Communication_Driver_V2.0 I have download at NXP, but some libraries (for example freemaster_example.h) are missing when I build the project thus getting a lot of errors.

Well, in fact FRDM-KL25Z board was only for testing purposes and the target is a custom board of mine with uses the SKEAZ128MLK4 (KEA128 family). This board has a working RS232 (thru PTC6 and PTC7 pins), I´m debugging with S32 IDE and I have installed the Freemaster SDKs for this project. The major problem here is that there is no way to connect to the board and show the variables on Freemaster. I already checked the baud rate, called FMSTR_Init(); and FMSTR_Poll(); in my source code but with no results. Even in community I didn´t find any reasonable doc explaining how to make Freemaster work when it doesn´t communicate with a board. Can you help me on that?

Hi Marcio,
so I assume your setup works with the FRDM-KL25Z, right?
What I would try is the following:
a) check with a logic analyzer/scope if there is any communication on the PTC6 and PTC7
b) halt the target in the debugger inside the FreeMaster code to see what might be blocking?
The later could be difficult as some portion of it are only delivered as a library.

Using an osciloscope I can see that it is receiving some pulses thru RS232 (Rx line), but it is not transmitting (Tx line) at the boards side. On debug everything seems to be working fine and the code doesn´t halt anywhere, this is weird : S

I have written the following code to test out FreeMaster. Was it suppose to work this way?

Yes, I just called FMSTR_Recorder(); right before FMSTR_Poll(); but it didn´t change anything (still not communicating). And yes it is UART1 I´m using for communication, I have changed the FMSTR_SCI_BASE at freemaster_cfg.h file, 0x4006B000UL should be the UART1 address as I check at its reference manual:

Not sure what else it could be. I cannot try things out as I don’t have your hardware. I think something is missing. Did you reach out in the NXP forums already? Otherwise you have to single step through the Freemaster code to get an idea what is not working.

I understand. The thing is with the FRDM-KL25Z I couldn´t communicate with Freemaster either, so it could be something simple I´m not seeing right now. To make things easier, how about to start a example project for FRDM-KL25Z using PEx and Freemaster component in KDS? I´d be very happy if I´ll be able to watch a simple variable reading at Freemaster. Can you send me this demo project?

Yes, your demo worked here so the problem still remains at my project. The UART1 or SCI1 is working fine as I have tested using hyperterminal to transmitt and receive data and changing the baud rate doesn´t make any difference.
I started an empty project on KDS with PEx and Freemaster component only. The variable “contador” is the one I want to watch and below it folows my code:

/*** Don’t write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON’T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON’T MODIFY THIS CODE!!! ***/
for(;;){}
/*** Processor Expert end of main routine. DON’T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/

Here I´m facing a new problem: when I try to connect to Freemaster using the Stop icon I got a PE_DEBUGHALT(); (!?)

Erich, in fact AN4752 tell us to assign FMSTR_Isr() to the UART1 (my case) interrupt vector on kinetis_sysinit.c file, but it was not generated here. Do you know what is the file and where I can do this?