MQX and Kinetis Design Studio as working

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

MQX and Kinetis Design Studio as working

Jump to solution
6,332 Views
kevincarcel
Contributor II

Hello at present, I'm trying to work with the new develoment tool "Kinetis Design Studio". I want to develop an aplication with MQX in the FRDM-K64F.

I've tried to create a project MQX in KDS for differents ways:

*Create a project in Codewarrior 10.6 and import to KDS.(not compile)

*Create a project in KDS with/without Process Expert and KSDK.

*Create a simple project with Process Expert and KSDK, and include the component MQX and MQX task in my project.

Of the last two forms, I get to compile without errors, but i can't debug. Show the error "Can not read register XX (XX) while CPU is running".

How can i work with KDS and MQX? How can i create a MQX project?

Thanks for the help.

1 Solution
3,990 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

With IAR and Keil we don't have any wizard, copy&paste the folder Project use to work. But some paths need to be modified.

For KDS would have to do the same.

  1. Copy from the example folder a MQX project (i.e. C:\Freescale\Freescale_MQX_4_1\mqx\examples\hello) and paste in any other folder.
  2. I remove the projects I don't need for other toolchains or other boards.
  3. Open for editing the .cproject with any text editor
  4. Search in file for "MQX_ROOT_DIR"  and change the value like this : "MQX_ROOT_DIR" type="VALUE_TEXT" value="C:\Freescale\Freescale_MQX_4_1"/>
  5. Replace the string '${ProjDirPath}/../../../../../..' by ‘{MQX_ROOT_DIR}'  (All the matches)
  6. Save the changes
  7. Import the project into KDS and build. You should build without errors.
  8. Change the project name if you want and now you have a MQX Template project that you can copy&paste any times and add the new sources.

Perhaps there is an easier path, but this one works for me.

Best Regards,

Luis

View solution in original post

0 Kudos
Reply
44 Replies
1,532 Views
BlackNight
NXP Employee
NXP Employee

Could it be that the code for FLEXCAN_DRV_IRQHandler is not linked?

That would explain why the breakpoint settings fail.

Can you check in the linker .map file that this function indeed is linked?

Erich

0 Kudos
Reply
1,532 Views
kevincarcel
Contributor II

hello Luis and Erich

thanks for your help. I've reviwed the file .MAP and the interruo handleris inclose.

I attach the file .MAP for if it is helpful

0 Kudos
Reply
1,532 Views
kevincarcel
Contributor II

hello Luis and Erich

I attach the file logs when download de code in the board and when I add a breakpoint for if it is helpful.

0 Kudos
Reply
1,532 Views
LuisCasado
NXP Employee
NXP Employee

Hi Kevin,

Perhaps is better if you post the project.

Luis

0 Kudos
Reply
1,532 Views
kevincarcel
Contributor II

Hi Luis

I attach all folder of eth_to_serial example with all files. My project is for the board FRDMK64F

Thanks

0 Kudos
Reply
1,532 Views
LuisCasado
NXP Employee
NXP Employee

Hi Kevin,

I can debug your code

There are multiple issues (Watch and read the Warnings, they are also important). Basically you have many implicit function calls, aka, it has not been resolved by linker. You need prototypes of functions in header files, for example:

void IniciarCAN(void);

And I have commented out all the ‘printf' as they are also implicit calls.

But the more important issue is that you have a function static void init_hardware(void) that is also included in the MQX BSP. I have not investigated why GCC linker doesn't complain, but removing the function, it works.

Luis

0 Kudos
Reply
1,532 Views
kevincarcel
Contributor II

Hi Luis

I also could debug and add breakpoints in the function IniciarCan(), but I don't add a breakpoint in the interrupt or interrup handler.

void CAN0_ORed_Message_buffer_IRQHandler (void)

o

void FLEXCAN_DRV_IRQHandler (uint8_t ejemplo);

img1.png

I've added your changes, but I can not.

Thank you very much Luis.

0 Kudos
Reply
1,532 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

I think that code isn't linked in the application. You're not installing the CAN interrupts in the MQX application.

Luis

0 Kudos
Reply
1,532 Views
kevincarcel
Contributor II

Hi Luis

I added the libraries in the option project.

img1.png

How can it keep happening? How can I install the CAN interrupt?

0 Kudos
Reply
1,532 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

In MQX (any version) you need to install the interrupts _int_install_isr

Check this: https://community.freescale.com/message/429868#429868

Luis

0 Kudos
Reply
1,532 Views
yarannan
Contributor III

Hi Luis

I am currently running an issue that i couldnt run CAN as a loopback mode, do you know which settings that i should change to?

Thanks in advance.

Yaran

0 Kudos
Reply
1,532 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

Also, follow this guide: https://community.freescale.com/thread/330061

To integrate KSDK driver in MQX-KSDK code.

Luis

0 Kudos
Reply
1,580 Views
LuisCasado
NXP Employee
NXP Employee

Hi,

your path is "C:\Freescale\Freescale_MQX_4_1_1" not "C:\Freescale\Freescale_MQX_4_1", so change MQX_ROOT_DIR accordinly.

Luis

0 Kudos
Reply
1,580 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Luis

Yes , my path is MQX_4_1_1,  and so  in the .cproject  file i already  write accordingly like the screenshot below .

21.png

22.png

And  the attachment is the .cproject file.

Thank you !

Alice

0 Kudos
Reply
1,580 Views
LuisCasado
NXP Employee
NXP Employee

Hi,

Attached a project I created, change the path to 4_1_1 and try it out.

Luis

1,580 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

oh, sorry  luis,  the project can work normally now .

Alice

0 Kudos
Reply
1,580 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi luis,

I  put your project on the desktop, and build it use kds 1.1.1 ,while it still have error , i need your help .

erro1.png

Thank you !

Alice

0 Kudos
Reply
1,580 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Kevin,

For the debug configuration you can refer to the kds_user_guide(C:\Freescale\KDS_1.1.1\doc\pdf\kds_user_guide.pdf) about   "4 debugging an embedded application"

and  kinetis SDK k64 User's Guide (C:\Freescale\KSDK_1.0.0\doc) about ( 4.4.3 Run a demo application)

Hope it helps

Alice

0 Kudos
Reply
1,580 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello kevin,

MQX 4.1 does not have KDS project files included.

Official support of KDS in MQX is planned in MQX 4.2 & MQX 5.0 coming later this year.

At that time MQX plug-ins for KDS (e.g. Task Aware Debug & New Project Wizard) will be available.  Also, MQX project files for all libraries and examples will be available for KDS. 


In the meantime, I recommend to make a copy of an existing demo or example and edit this project. You can find them in the following paths.

C:\Freescale\MQX_KSDK_1.0.0\demos

C:\Freescale\MQX_KSDK_1.0.0\rtos\mqx\mqx\examples

Compiling MQX Libraries and Demos for the KDS  you can refer to  Compiling MQX Libraries and Demos for the KDS Toolchain.

Best Regards,

Alice

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

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

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

0 Kudos
Reply
1,580 Views
LuisCasado
NXP Employee
NXP Employee

Hi Alice,

MQX 4.1.1 does include support for KDS.

From release notes:

Freescale MQX RTOS was compiled and tested with these development tools:

• Kinetis Design Studio version IDE 1.1.0

• Support available for Kinetis devices

• See build projects in the Kinetis Design Studio

subdirectory

Makefile build option: TOOL=kds

….

Luis

0 Kudos
Reply
1,580 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Luis and Kevin

There are many demo about  MQX + KDS under MQX4,1,1, while it seems that in KDS can't creat project like CW(file->new->mqx project), so in my opinion,  make use of the demo under the mqx is a good choice. what do you think?

Best Regards

Alice

0 Kudos
Reply