Hello,
I am just asking myself if the MQX Lite is also supported by the MQX Tools (Runtime TAD and Performance Tool). So far I could not find a hint on it. However the MQX Lite has the logging feature. So it might be possible to use the MQX Tools also with the MQX Lite RTOS. Has anyone already made some experience?
Best Regards
Markus
Hello,
it took me a while to get my own MQX Lite application running and also be able to use most of the MQX Tools (timeline, stack and cpu usage) to have the possibility of monitoring everything.
If someone has the same attempt please do not forget:
Finally I want to say thank you to Petr that helped me with his hints and demo application to find all the traps:smileyhappy:
Best Regards Markus
Performance Tool works, just enable Kernel Logging in the MQXLite component. Note you need to use _klog_create_at to provide the memory for the kernel log, maybe on a task's stack.
For the Runtime TAD, there is no FreeMASTER OpenSDA plugin. We will provide one but as far as I know it is not ready yet. In using the RS232 connection (directly with a PC host or with the CDC device in OpenSDA application), there is Processor Expert FreeMASTER plugin under CPU External Devices -> FreeMaster. However, there is currently one problem on Kinetis L (for Kinetis K this works OK). For Kinetis L, the Processor Expert FreeMASTER component will be usable with next upgrade. There is just small change needed in order to support Cortex M0.
Dear Martin,
today I had a closer look again to the 'performance tools' in connection with MQX Lite. I started with the MQX because I am convinced that it works there and the plan was to move step by step from MQX to MQX Lite while always maintaining the logging. I was able to repeat the lwdemo example that comes with the MQX (not Lite!). After a while I get it to work.
So I tried to transform that logging scheme to a MQX Lite project. However it does not work and give me always the message: 'kernel log is not activated' - However it is enabled for sure.
Some other things takes me an incredible lot of time around MQX Lite. I am struggling with using floating point and printf(). It is unclear to me if floating point is an allowed or mandatory or option to MQX Lite. If I keep the default settings in the project wizard of MQX Lite the linking failed as soon as I include somewhere a printf() - and the logging function uses that call - I got an error message from the linker that it can not merge the whole applicatinon because of some I/O inconsistency. If I change the order or Libs that are included to use the floating point lib as the last one I get rid of the printf() error - however I add an error that the linker does not know where fp_init() to take from :-(
Even more investigation on MQX Lite shows me some other strange thing. I looked for an official MQX Lite demo (that comes with the installation) that uses the kernel logging. I found surprinsingly the lwdemo. However as soon as I turned on the logging in the MQX-Lite PE-Component you end up with a lot of error messages during the build process. If you look now more in detail you discover that there are logging functions used that are not allowed in MQX Lite. For instance the demo code uses _klog_create() that is a function that is explicitly forbidden and unsupported for good reasons in MQX Lite. So I come to the conclusion that the logging option of this demo has not been tested by freescale before getting released :-( If I am right with my conclusion I have to say I am pretty much disappointed about the quality process at freescale - so hopefully I overlooked something.
I will do some further investigations tomorrow and if I found a solution for MQX Lite and logging I will post it here. Again, if someone has a demo application based on MQX Lite that also uses the performance tools based on the logging I would be happy if you can post it here.
Best Regards
Markus
Hi Marcus,
can you please specify following information to better help you
I have tested the kernel logging on Freedom KL25Z board.
Attached are modified V1.0.1 files. Unzip the V1.0.1.zip into "c:\Freescale\CW MCU v10.4\MCU\ProcessorExpert\lib\mqxlite\V1.0.1" directory.
The LWDEMO_KL25Z.ZIP contains the fixed lwdemo application which runs with MQX Lite.
If you are using different toolset the documentation can be found in full MQX in \mqx\doc\tools directory.
The fixed kernel logging issue is going to be fixed in MQX Lite V1.1.0
Regards Petr
Dear Petr,
I changed my MQX Lite v1.0.1 files according to your instructions and load the demo project into my workspace. I first decide to stay with the K25 configuration because from what I have discovered till now my problems seems not to be related to the microcontroller that is used.
Trying to build the application showed the following:
So finally I stopped my activities on your demo application because I'm not sure if this application is able to demonstrate the kernel logging of MQX Lite and also to show that the Timeline-, Stack and CPU view will work with MQX Lite. If your have a working example I will be happy to adopt it to my needs.
To move to MQX is currently not really an option for my because the amount of memory that is required for MQX is for my kind of applications too much in comparison to what I need from an operating system.
Best Regards
Markus
Dear Petr,
thanks for your example. I get it to run within seconds and also the performance tools works. So great to see that MQXLite is capable to do so. However then I start to develop my own application and had the same problem that I had before. I tried to copy almost everything concerning the logging from your demo project. But i still get the error message:
I attached my project. I would be great if you can have a look at it and find the configuration problem that I obvious still have.
Best Regards
Markus
Dear Marcus,
if you change some settings in MQX Lite component specifically the ones which have conditional compilation in
assembly file dispatch.S #if MQX_KERNEL_LOGGING, #if MQX_ENABLE_USER_MODE, you have to "Clean Project" to get rid of object files before build. Its because of issue GCC assembly pre-processor which does not detect change in included header files. The issue has been already reported and will be fixed in CW 10.5 which will be released in Q3 2013.
Regards Petr
Hi Petr,
thanks for your hint with the clean. I did it and get finally rid of all 'grey' blocks around #if MQX_KERNEL_LOGGING. Acutally the clean+build does not do the whole job. I had to insert a 'blank' in user_conf.h and save it again. After that the header file was reloaded correctly and the build works fine. However the logging still do not work and I had a closer look again. I realized that in your demo project the debugger is aware of 8 threads. One for each task and one for the idle-task or the logging (depending at which point in time I paused the debugger). See screenshot below for explaination.
In my application there is only one thread that the debugger is aware of although the two tasks run in an infinity loop and they really do if I follow step by step with the debugger (see below the single thread in the debugger).
I inserted a printf() in each task to follow on the serial line what the application does and as expected it runs in an infinitey loop and switches the tasks as expected.
So I am asking myself if this could be a hint what goes wrong in my application that causes still the message 'The debug application has no kernel logging enabled'. Just to say it again. The logging function (e.g. _klog_context_switch_internal() ) is called as expected in my application and writes to the belonging data structure. It is just the the displaying tool like timeline or CPU usage is not able to detect and display the filled data structure.
Another hint might be that I did not install the latest patch of MQX. I installed the version 4.0.1 (that reports itself as 4.0.0 if I ask for the '_mqx_version'). The reason for this that I was unable to locate where to install the patch directories because I found no instructions in the zip file (see the zip file contents below).
Finally I took your demo application and modified it to my task scheme and to the application contents. I did this without changing any line of code inside mqy_tasks.c to my original application where the displaying of the logging data does not work. I did this to be sure it is an configuration and not an application program issue. I got two surprises: 1.) I got a thread for every task in the debugger + a thread for the actual position in the application (see below). 2.) the timeline etc. works :smileyhappy:.
However I have to find out what the reason is that my original application does not work. Otherwise I could not use the MQX Lite in my university course because I am 100% sure that the students will run into the same problem that I have and I have to help them out.
So any hint why I am not able to display the logging data in my original application will be welcome - final question for today- does it belong to the fact that my original application is build for RAM and not for FLASH?
Best Regards
Markus
Dear Petr,
thanks for your reply. I try to answer your questions:
I will try to get you example running on my board later this afternoon and come back with the results.
Best Regards
Markus
Dear Martin,
I followed your advice and setup a simple application consisting of two tasks. Task 1 is already enabled and 'creates' Task 2 at its end. Task 2 runs in an infinite loop. So far the application works fine if I step through by using the debugger. However I did not get any result from the performance tools. Even worse - the timeline tool tells me that kernel log is not switched on. But I did it for sure in the PE configuration and checked it also in the user_conf.h file. I am writing the logging data to a global data structure and and monitor that it gets filled very quickly. So it seams that the logging works but the displaying of the data does not. Do you have any hints?
Additional I got the following warnings related to the printf when I switch on the logging. Does that give any hint to my mistake?
Best Regards
Markus
MQX and MQX lite are not supposed to use together. MQX lite is included in CW install package. if you want to use MQX lite, you needn't install MQX. CW10.4 can support MQX lite. To work with MQX lite, user must use professional license. You can check MQXLite_User_Guide.pdf under CW10 install folder.