Touch Tuning variables not plotted on Oscilloscope for a Custom FreeMASTER Project

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Touch Tuning variables not plotted on Oscilloscope for a Custom FreeMASTER Project

2,664 Views
arun07
Contributor III

Hello Everyone,

I am using FreeMASTER for a touch tunning exercise for the MKE15Z micro-controller.

I used the sample project which is available with SDK and it works well.

Here are the below snapshot of it's working.

FreeMASTER Default Working-1.png

FreeMASTER Default Working-2.png

But due to some reason I wanted to create a new FreeMASTER project from scratch, with just visualization part, no other information.

The idea is to create an oscilloscope view for each electrode without other information.

But it's not working.

FreeMASTER Custom Not Working.png

The following images show the comparison, left side is working and right side is not working one.

FreeMASTER Comparison.png

The following image shows the variable, although I used the same *.out file in both the projects, the same variables are used but in the working project, variable addresses are shown but in not working one it is not shown.

FreeMASTER Comparison-2.png

In the project which is not working, if I used a variable which is having a fixed address it works, as shown below.

Here I added a "millisecond" variable which I increment in 1ms SysTick interrupt and this works well.

FreeMASTER not working but some variables with fixed address are shown.png

Can someone help me in understanding and how to fix this problem?

Why with the custom project it is not working, and why this is not able to detect the touch-related variables in one project and why working in the other?

PS: I have clicked reload symbol file several times, but even this doesn't work.

Thanks in advance.

9 Replies

2,521 Views
arun07
Contributor III

Thanks, MichalH

For your support.

At least I learned about the "valueof", and I will use this.

Thanks, and Regards

0 Kudos

2,521 Views
MichalH
NXP Apps Support
NXP Apps Support

Hello, 

if the variable properties dialog does not show any resolved symbol address, the problem is most likely in the .out ELF file path or type. Please go again to the Project Options (Ctrl+T) to the "MAP Files" tab. The OUT file should be specified there and should be "Binary ELF ..." type.

To make sure the symbols are loaded correctly, press the "View" button. You should get a listing of all C symbols parsed from the ELF file.

pastedImage_1.png

If this does not help, it is also possible that your project uses a TSA runtime symbol tables embedded directly in the microcontroller application. Do you use the same application as in the first case which is working or have you created a new one?

Regards,

Michal

0 Kudos

2,521 Views
arun07
Contributor III

Hi MichalH

Thank You for your quick response.

I am using the same *.out file in both FreeMASTER's projects (*.out file is generated by IAR and I think it is equivalent to *.elf file).

I also checked the "List of all Valid symbol files", and they both are the same for both FreeMASTER Projects.

Both the files are attached at the bottom.

Apart from this, I am not using RS232/Serial and FreeMASTER drivers, I am using J-Link to plot this data on the oscilloscope view.

In the not working project at the startup, I get this error.

Variables Not Found.png

Here I clicked on the checkbox "Access the variables anyway at their last-known addresses"

My question is if we see the FreeMASTER Working project the value of the variable "electrode_usafa_0_baseline" is "nt_kernel_data.modules[0]->electrodes[0]->baseline"

And I put the same value in my custom FreeMASTER project, but it is not working.

Why FreeMASTER able to find the address in the project available with NXP SDK but not with my custom FreeMASTER project.

Is there something which I am missing.

Updated:

In the above update, I mentioned that when I opened the project (custom FreeMASTER project) I get the Missing Symbol Definition, which I didn't get in the FreeMASTER project which is working, I found the reason that this is warning is disabled with the FreeMASTER project provided with the NXP SDK, as shown below.

Left Side is Working Project (NXP SDK) and right side custom project.

Project Comparison.png

And after checking this option, in the working project, I also get the same message in the project which is working, and even though it works fine.

Variables Not Found with Working FreeMASTER project.png

I will keep this post updated.

0 Kudos

2,521 Views
MichalH
NXP Apps Support
NXP Apps Support

Hello,

I think the magic of why the original project works well is hidden in the control page JavaScript code. The FreeMASTER project for Touch Sensing applications needs to be quite universal as it needs to handle different electrode and touch controls configurations and structures. The author of the UI project did not want to depend on how each electrode and control structure is named.

I'm not sure, but I think that the script takes just the root pointer named nt_kernel_data. Then it reads the pointer value and walks through the chains of other linked lists and defines all necessary symbols and variables dynamically using DefineSymbol and DefineVariable methods. Then it uses the variables to generate Oscilloscope graphs also dynamically.

In your new fresh project, you do not have the script thus you also do not have the symbols defined.

Regards,

Michal

2,521 Views
arun07
Contributor III

Thanks, MichalH‌ for your response.

Does this mean that I can't use these variables in a standalone project?

I will explain to you the reason why I need a separate project.

If you remember a few months back I created a post in the FreeMASTER project.

NXP Touch Tuning not Opening Properly in FreeMASTER 

The touch tuning project doesn't work on my laptop (office) due to some company policies.

That's why I thought to create a separate project.

Is there some way, to solve this problem?

Or is it possible in FreeMASTER to get the data from a particular memory address, I will specify the type of data and it's size manually?

Please let me know if this is possible, thanks in advance.

0 Kudos

2,520 Views
MichalH
NXP Apps Support
NXP Apps Support

I think this should be possible. All Electrode structures are available in memory as global symbols - this means FreeMASTER is definitely able to visualize them. I'm not sure if the Touch library makes any dynamic allocations - in this case it would be problematic (but also solvable I think).

The reason why the original project does it such a difficult way is that it needs to be ready for any configuration. The information about which electrode is assigned to what control is generally unknown and must be parsed by reading nt_kernel_data live data.

In your project, you will probably have a fixed electrodes, fixed controls and static assignments, so you will be able to visualize the signals directly from El_0, El_1 and other structures. I'm not an expert on this technology, so I cannot give an advise on what structure members are to be monitored (baseline etc.). Please try it this way and let me know. I would contact an owner of the Touch project here to reach out for more information if needed.

Thanks,

Michal

2,519 Views
arun07
Contributor III

Thanks, MichalH‌ for your response.

Yes, this is true that all the Electrode structure in memory is global.

For the touch project, the following information is important, and I have used the symbols which I have used in my custom FreeMASTER project, and these symbols are same in the sample project available with SDK FreeMASTER project.

  • baseline signal - nt_kernel_data.modules[0]->electrodes[0]->baseline
  • filtered signal - nt_kernel_data.modules[0]->electrodes[0]->signal
  • deadband h counts - nt_kernel_data.modules[0]->electrodes[0]->keydetector_data.usafa->deadband_h
  • predicted signal - nt_kernel_data.modules[0]->electrodes[0]->keydetector_data.usafa->predicted_signal
  • noise floor - nt_kernel_data.modules[0]->electrodes[0]->keydetector_data.usafa->noise
  • entry level count - nt_kernel_data.modules[0]->electrodes[0]->keydetector_data.usafa->entry_event_cnt
  • deadband count - nt_kernel_data.modules[0]->electrodes[0]->keydetector_data.usafa->deadband_cnt

If I put the symbols on IAR Live Watch, I am able to see the correct values but not on my Custom FreeMASTER project.

Regarding your below point.

In your project, you will probably have a fixed electrodes, fixed controls and static assignments, so you will be able to visualize the signals directly from El_0, El_1 and other structures. I'm not an expert on this technology, so I cannot give an advise on what structure members are to be monitored (baseline etc.). Please try it this way and let me know. I would contact an owner of the Touch project here to reach out for more information if needed.

If I understood you correctly, I am already doing this, as mentioned above the symbols. Somehow in my custom FreeMASTER project, FreeMASTER is not able to evaluate the addresses while with the SDK project it is able to evaluate the address properly and plot the data (This is shown in the above post).

Thank you for your support, if I am able to solve this problem it will be really helpful for me and my team members.

Thanks in advance, waiting for your feedback.

0 Kudos

2,521 Views
arun07
Contributor III

Hi MichalH

Did you get any feedback?

Thanks in advance

0 Kudos

2,521 Views
MichalH
NXP Apps Support
NXP Apps Support

I have some bad news - the Touch library uses a pseudo-dynamic allocation to create runtime structures with electrode data. It uses a small memory pool and a simple memory allocator for this purpose. From the FreeMASTER point of view, the only thing which is static at fixed address in memory is the nt_kernel_data, all other structures have dynamic address (fixed after allocated, but not known in compile time). The El_xx structures that I originally thought would be usable in FreeMASTER are just ROM-based configuration structures.

I'm afraid that it is inevitable to use a script that reads the nt_kernel_data and related memory and dynamically creates FreeMASTER symbols and variables. I'm sorry for the confusion and false hope I gave above.

If using existing scripts and the Internet Explorer is not an option for you, we will need to rework the script from ActiveX to JSON-RPC and make it working in the Chrome environment (more about these technologies in this video). This rework will take more time, I cannot give any commitments.

However, there is one thing you can do in the target MCU application to make it working. It is more a "hack" and needs some work, but it is better than nothing. The idea is simple: "If FreeMASTER script cannot do the job, so let's use the MCU application to help". The MCU app would somehow store the "dynamically" allocated data to static variables accessible by FreeMASTER.

  • For example, there is a short integer "signal" member accessible by the MCU code as nt_kernel_data.modules[0]->electrodes[0]->signal. You may need to include some private headers to get access to internal Touch structures, but it should be doable.
  • There are two options to get this "signal" value to FreeMASTER. A trivial one is to periodically copy its value to a dedicated static variable e.g. "el0_signal_copy" which can be visualized in FreeMASTER.
    In the main application loop you would do something like:

    el0_signal_copy = nt_kernel_data.modules[0]->electrodes[0]->signal;
    You can of course copy the whole electrode structure and access other members too in FreeMASTER.
  • A non-trivial way would be to access the signal value directly in the memory pool. 
    • You need a helper static variable which keeps the pointer to the signal member. 
      static short* el0_signal_ptr = & nt_kernel_data.modules[0]->electrodes[0]->signal;
    • In FreeMASTER, you will then need to create two variables.
    • One representing the pointer itself (e.g. named el0_signal_ptr, size=4 bytes to read the pointer value). The sampling rate of this variable can be set to "once" in FreeMASTER because this value never changes in the application runtime. The memory is never freed or moved:
    • The other FreeMASTER variable would be the el0_signal itself, size=2 bytes and address set to valueof(el0_signal_ptr) - this is a special operator in FreeMASTER which enables to use an indirect address.
    • Basically, this is the "hard way" of achieving the same result as if using the script. The script reads the target memory to define a FreeMASTER variable. In this case you use helper variable to do the same thing.

I know this not a nice solution and I don't expect you will be happy about it :smileysad:

Regards,

Michal