Configuring properly sensor fusion project on KL26Z

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

Configuring properly sensor fusion project on KL26Z

Jump to solution
1,681 Views
remibeges
NXP Employee
NXP Employee

Hello,

 

I am trying to develop a project with the sensor fusion library on a Freedom KL26Z

 

I went to this page Sensor Fusion|Freescale

Downloaded and installed the sensor fusion library

Then imported into CodeWarrior the project correctly. So far I think it's good

 

I then tried a first compilation but I get immediatly an error :

DescriptionResourcePathLocationType
mqxlite.h: No such file or directory mqxlite.h: No such file or directoryMQX1.h/FSFK_KL26Z/Generated_Codeline 69C/C++ Problem

 

Hum ok. Is there some code generation to run before being able to compile successfully ?

 

I hope someone can help me out a little to start.

 

Also, just by looking at the code, I found this in GeneratedCode/MQX1.h :

 

#include "PE_Const.h"

#include "IO_Map.h"

/* Include inherited components */

#include "SystemTimer1.h"

#include "task_template_list.h"

/* MQX Lite include files */

#include "mqxlite.h"

#include "mqxlite_prv.h"

 

/* Path to MQX Lite source files */

#define MQX_PATH   "C:/Freescale/CW MCU v10.6/MCU/ProcessorExpert/lib/mqxlite/V1.1.1/"

void      SystemTimer1_OnCounterRestart(LDD_TUserData *UserDataPtr);

 

 

Why is there an absolute path in there ? Which, furthermore, points to nowhere on my computer :

 

53711_53711.pngUntitled.png

 

If I understand correctly, this file is generated automatically when I downloaded and installed the sensor fusion library. Which means, and correct me if I'm wrong, if I want to open source this project, using versionning tools such as github.com, this absolute path will be the same for everyone. But, if other contributors install the library on a different path on their computers than mine, the code will not compile. This is very not portable, so if someone can explain the reason for this, I'd really appreciate it

 

Thank you for your help

 

Message was edited by: Remi Beges

Labels (1)
0 Kudos
1 Solution
1,106 Views
michaelestanley
NXP Employee
NXP Employee

Responses above are correct.  You'll need MQXLite 1.1.1 to complete your build, which you should get if you install all the CodeWarrior updates.

You are correct that absolute paths are bad :smileyblush: The path in question is the default path where the tools set up MQXLite when those CodeWarrior updates were installed.

Processor Expert code generation IS covered in the "Getting Started" portion of the user guide.  And just FYI, the Source/*.h and *.c files are also available under the MIG GitHub site at Home · memsindustrygroup/Open-Source-Sensor-Fusion Wiki · GitHub .

Regards,

Mike

View solution in original post

0 Kudos
9 Replies
1,106 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Remi,

After you install the sensor fusion library , please do refer to "Freescale Sensor Fusion for Kinetis Product Development Kit User Guide",

it under the directory : ...docs\XSFLK_UG.pdf


After you refer to it , if still have error when build , please contact me !

Hope it helps!


Have a great day,
Alice

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,106 Views
remibeges
NXP Employee
NXP Employee

Hello Alice, I did follow this guide already to setup the project. At the step where it says I should be able to run the program, this is where I get the error. Please tell me which information I can provide to get some help, because I'm absolutely stuck here.

0 Kudos
1,106 Views
remibeges
NXP Employee
NXP Employee

I have found the solution. First, in the Components tab, I changed manually the MQXlite version from 1.1.1 to 1.1.0. This removed the warning ("MQXlite version not found, ...") Then right click on ProcessorExpert in the treeview, and click on generate processor expert code. Compiling the code now works after that.

So indeed there was some code generation to perform, which was not specified on the documentation. Now, my main problem is solved, but I would like to understand why the specified path in MQX1.h was wrong, preventing I suppose processor expert to generate code appropriately. If you have any information about that, I would appreciate it a lot. Regards

0 Kudos
1,106 Views
isaacavila
NXP Employee
NXP Employee

Hi Remy,

Actually there is a V1.1.1 version for processor expert libraries (as shown below) but you need to update some packages (I dont remeber which one exactly) in CodeWarrior.

pastedImage_0.png

I think Sensor fusion library was made supposing last update for processor expert was already installed.

Could you try installing all packages for CodeWarrior?

You can make this on CodeWarrio's Help Tab and select Check for Updates.

Check for Updates.jpgI hope this can help you.

Best Regards,

Isaac

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,106 Views
remibeges
NXP Employee
NXP Employee

Hello Isaac I tried updating all packages, but I get several errors

Some sites could not be found.  See the error log for more detail.

No repository found at jar:file:C:%5CUsers%5CB48923%5CDownloads%5CCW%20for%20MCU%2010.6%5Ccom.freescale.mcu10_6.kinetis.updatesite.zip!/.

No repository found at jar:file:C:%5CUsers%5CB48923%5CDownloads%5CCW%20for%20MCU%2010.6%5Ccom.freescale.mcu10_6.e200.updatesite.zip!/.

No repository found at jar:file:C:%5CUsers%5CB48923%5CDownloads%5CCW%20for%20MCU%2010.6%5Ccom.freescale.mcu10_6.coldfire.updatesite.zip!/.

An error occurred while collecting items to be installed

session context was:(profile=PlatformProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).

Unable to read repository at http://freescale.com/lgfiles/updates/Eclipse/MCU10_6/com.freescale.mcu.updatesite/plugins/com.freesc....

chunked stream ended unexpectedly

Unable to read repository at http://freescale.com/lgfiles/updates/Eclipse/MCU10_6/com.freescale.mcu.updatesite/binary/com.freesca....

chunked stream ended unexpectedly

Most packages have not updated, because when I re-run the update tool I still have the same packages proposed.

And there is still no 1.1.1 folder for mqxlite

Any idea what is causing that ?

EDIT : I also tried to manually update MQX lite. I downloaded the drivers from here (Freescale MQX™ Lite Real-Time Operating|Freescale ) but once installed, I still do not have the 1.1.1 folder

Untitled.png

EDIT 2 : I tried again to do the update, this time it worked (although I still had the "no repository found" error). Maybe it was just bad luck and the server was down when I tried the first time, but anyway now I have the 1.1.1 version

So now I am able to launch the debug. but new issue :

Untitled2.png

I have the special edition of CodeWarrior, but limits are at least 64kB. Does the sensor fusion lib takes more space than that ?

0 Kudos
1,106 Views
isaacavila
NXP Employee
NXP Employee

Hi Remi,

I was starting to ask you to try more times until updates will be installed (sometimes some errors are gotten but after some retries updates will be installed correctly), fortunately, you already did it.

About Code size i do not have that information, but you can enable codewarrior to print code size.

You can check this post: How to check the code size and memory use in codewarrior V10.3

or go directly to this one: Code Size Information with gcc for ARM/Kinetis | MCU on Eclipse

Hope this can help you

Best Regards,

Isaac Avila

0 Kudos
1,106 Views
michaelestanley
NXP Employee
NXP Employee

Some of the algorithms in the fusion library do take more then 64KB flash.  And the default build definately exceeds those limits.  Open up docs/XSFLK_DS.pdf (the datasheet) and check out tables 15 through 17.

Altough I personally prefer CodeWarrior, it has been deprecated in favor of KDS, which is 100% free with no code size limitations.

Mike

0 Kudos
1,106 Views
remibeges
NXP Employee
NXP Employee

Thank you for the answer, Allright I'll switch to KDS then. Thank you for the help everyone, I really appreciate it Regards, Remi

0 Kudos
1,107 Views
michaelestanley
NXP Employee
NXP Employee

Responses above are correct.  You'll need MQXLite 1.1.1 to complete your build, which you should get if you install all the CodeWarrior updates.

You are correct that absolute paths are bad :smileyblush: The path in question is the default path where the tools set up MQXLite when those CodeWarrior updates were installed.

Processor Expert code generation IS covered in the "Getting Started" portion of the user guide.  And just FYI, the Source/*.h and *.c files are also available under the MIG GitHub site at Home · memsindustrygroup/Open-Source-Sensor-Fusion Wiki · GitHub .

Regards,

Mike

0 Kudos