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
5,913 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,571 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
44 Replies
1,970 Views
kevincarcel
Contributor II

Hello Luis and Alice

I've got buil a example  MQX project thanks to your explanations also I've tried to include in a project with PEx, the component MQX and MQX task after of take out all errors and compile without problems I can't debug because appear this error in console:

SEGGER J-Link GDB Server V4.88a Command Line Version

JLinkARM.dll V4.88a (DLL compiled Jul 17 2014 18:20:19)

-----GDB Server start settings-----

GDBInit file:                  none

GDB Server Listening port:     2331

SWO raw output listening port: 2332

Terminal I/O port:             2333

Accept remote connection:      localhost only

Generate logfile:              off

Verify download:               on

Init regs on start:            on

Silent mode:                   off

Single run mode:               on

Target connection timeout:     5 sec.

------J-Link related settings------

J-Link Host interface:         USB

J-Link script:                 none

J-Link settings file:          none

------Target related settings------

Target device:                 MK64FN1M0xxx12

Target interface:              SWD

Target interface speed:        1000kHz

Target endian:                 little

Connecting to J-Link...

J-Link is connected.

Firmware: J-Link OpenSDA 2 compiled Apr 24 2014 14:44:11

Hardware: V1.00

S/N: 621000000

Checking target voltage...

Target voltage: 3.30 V

Listening on TCP/IP port 2331

Connecting to target...Connected to target

Waiting for GDB connection...Connected to 127.0.0.1

Reading all registers

Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF)

Target interface speed set to 1000 kHz

Resetting target

Halting target CPU...

...Target halted (PC = 0xFFFFFFFE)

R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000

R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000

R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000

R12= 00000000, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= 00000000

R14(LR) = FFFFFFFF, R15(PC) = FFFFFFFE

XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000

CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00

Reading all registers

Select auto target interface speed (1429 kHz)

Flash breakpoints enabled

Semi-hosting enabled (VectorAddr = 0x08)

Semihosting I/O set to TELNET Client

Downloading 20 bytes @ address 0x00000410 - Verified OK

Writing register (PC = 0x00000410)

Read 4 bytes @ address 0x00000410 (Data = 0x20000000)

Resetting target

Halting target CPU...

...Target halted (PC = 0xFFFFFFFE)

R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000

R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000

R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000

R12= 00000000, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= 00000000

R14(LR) = FFFFFFFF, R15(PC) = FFFFFFFE

XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000

CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00

Reading all registers

Read 4 bytes @ address 0xFFFFFFFE (Data = 0x20000000)

Starting target CPU...

ERROR: Can not read register 15 (R15) while CPU is running

...Target halted (PC = 0x00000000)

Reading all registers

ERROR: Can not read register 0 (R0) while CPU is running

ERROR: Can not read register 1 (R1) while CPU is running

ERROR: Can not read register 2 (R2) while CPU is running

ERROR: Can not read register 3 (R3) while CPU is running

ERROR: Can not read register 4 (R4) while CPU is running

ERROR: Can not read register 5 (R5) while CPU is running

ERROR: Can not read register 6 (R6) while CPU is running

ERROR: Can not read register 7 (R7) while CPU is running

ERROR: Can not read register 8 (R8) while CPU is running

ERROR: Can not read register 9 (R9) while CPU is running

ERROR: Can not read register 10 (R10) while CPU is running

ERROR: Can not read register 11 (R11) while CPU is running

ERROR: Can not read register 12 (R12) while CPU is running

ERROR: Can not read register 13 (R13) while CPU is running

ERROR: Can not read register 14 (R14) while CPU is running

ERROR: Can not read register 15 (R15) while CPU is running

ERROR: Can not read register 16 (XPSR) while CPU is running

ERROR: Can not read register 17 (MSP) while CPU is running

ERROR: Can not read register 18 (PSP) while CPU is running

ERROR: Can not read register 24 (PRIMASK) while CPU is running

ERROR: Can not read register 25 (BASEPRI) while CPU is running

ERROR: Can not read register 26 (FAULTMASK) while CPU is running

ERROR: Can not read register 27 (CONTROL) while CPU is running

ERROR: Can not read register 32 (FPSCR) while CPU is running

ERROR: Can not read register 33 (FPS0) while CPU is running

ERROR: Can not read register 34 (FPS1) while CPU is running

ERROR: Can not read register 35 (FPS2) while CPU is running

ERROR: Can not read register 36 (FPS3) while CPU is running

ERROR: Can not read register 37 (FPS4) while CPU is running

ERROR: Can not read register 38 (FPS5) while CPU is running

ERROR: Can not read register 39 (FPS6) while CPU is running

ERROR: Can not read register 40 (FPS7) while CPU is running

ERROR: Can not read register 41 (FPS8) while CPU is running

ERROR: Can not read register 42 (FPS9) while CPU is running

ERROR: Can not read register 43 (FPS10) while CPU is running

ERROR: Can not read register 44 (FPS11) while CPU is running

ERROR: Can not read register 45 (FPS12) while CPU is running

ERROR: Can not read register 46 (FPS13) while CPU is running

ERROR: Can not read register 47 (FPS14) while CPU is running

ERROR: Can not read register 48 (FPS15) while CPU is running

ERROR: Can not read register 49 (FPS16) while CPU is running

ERROR: Can not read register 50 (FPS17) while CPU is running

ERROR: Can not read register 51 (FPS18) while CPU is running

ERROR: Can not read register 52 (FPS19) while CPU is running

ERROR: Can not read register 53 (FPS20) while CPU is running

ERROR: Can not read register 54 (FPS21) while CPU is running

ERROR: Can not read register 55 (FPS22) while CPU is running

ERROR: Can not read register 56 (FPS23) while CPU is running

ERROR: Can not read register 57 (FPS24) while CPU is running

ERROR: Can not read register 58 (FPS25) while CPU is running

ERROR: Can not read register 59 (FPS26) while CPU is running

ERROR: Can not read register 60 (FPS27) while CPU is running

ERROR: Can not read register 61 (FPS28) while CPU is running

ERROR: Can not read register 62 (FPS29) while CPU is running

ERROR: Can not read register 63 (FPS30) while CPU is running

ERROR: Can not read register 64 (FPS31) while CPU is running

Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF)

Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF)

How can i solve this errors? This is a method valid method to create a MQX project?

Thanks for your help

0 Kudos
1,970 Views
LuisCasado
NXP Employee
NXP Employee

Hi Kevin,

Review your debug configuration comparing with a working Project. In the process something has been modified in the configuration.

Luis

0 Kudos
1,970 Views
kevincarcel
Contributor II

Hello  Luis and Alice

I am unable to debug a sample project eth_to_serial. I've gotten buil without errors but not generated .elf. In comand windows appear this error:

arm-none-eabi-gcc: error: ..\..\..\..\..\..\..\..\..\lib\ksdk_mqx_lib\kds\K64F12\debug\ksdk_mqx_lib.a: No such file or directory

How I can generate the file .elf installation? Does anyone have an example that i can debug in the FRDMK64F?

Thanks.

0 Kudos
1,970 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

You have to build the MQX-KDSK libs (Working set in C:\Freescale\MQX_KSDK_1.0.0\rtos\mqx\build\kds\workspace_frdmk64f120m)

Then, you need to build rtcs lib, importing the project C:\Freescale\MQX_KSDK_1.0.0\tcpip\rtcs\build\kds\rtcs_frdmk64f120m

Then the KSDK lib, importing and building C:\Freescale\MQX_KSDK_1.0.0\lib\ksdk_mqx_lib\kds\K64F12 (the one your project is missing)

Import the example and build eth_to_serial.

Luis

1,970 Views
kevincarcel
Contributor II

Hello Luis

Thanks for help me, your respond has been useful. Now I tried to change the original project, and appear again this error:

08:49:00 **** Incremental Build of configuration Int Flash Debug for project eth_to_serial_frdmk64f120m ****

Info: Internal Builder is used for build

"C:\\Users\\kevin\\workspace" KDS v1.1.0/eth_to_serial_frdmk64f120m/makedir.bat C:/Users/kevin/workspace KDS v1.1.0/eth_to_serial_frdmk64f120m/int flash debug

C:\Users\kevin\workspace KDS v1.1.0\eth_to_serial_frdmk64f120m\Int Flash Debug>IF NOT EXIST "C:/Users/kevin/workspace" mkdir "C:/Users/kevin/workspace"

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -Wno-missing-braces -g3 -gdwarf-2 -gstrict-dwarf -gstrict-dwarf -gstrict-dwarf -T "C:/Users/kevin/workspace KDS v1.1.0/eth_to_serial_frdmk64f120m/../../../../../../../rtos/mqx/lib/frdmk64f120m.kds/debug/bsp/K64FN1Mxxx12_flash.ld" -nostartfiles -nodefaultlibs -Xlinker --gc-sections -Wl,-Map,eth_to_serial_frdmk64f120m.map -Xlinker --cref -Xlinker -z -Xlinker muldefs -Xlinker -static -o eth_to_serial_frdmk64f120m.elf -Xlinker --start-group "Sources\\main.o" "Sources\\TCP_IO.o" "Sources\\FlexCAN_IO.o" "C:\\lib\\ksdk_mqx_lib\\kds\\K64F12\\debug\\ksdk_mqx_lib.a" "C:\\lib\\frdmk64f120m.kds\\debug\\rtcs\\rtcs.a" "C:\\rtos\\mqx\\lib\\frdmk64f120m.kds\\debug\\nshell\\nshell.a" "C:\\rtos\\mqx\\lib\\frdmk64f120m.kds\\debug\\bsp\\bsp.a" "C:\\rtos\\mqx\\lib\\frdmk64f120m.kds\\debug\\psp\\psp.a" "C:\\rtos\\mqx\\lib\\frdmk64f120m.kds\\debug\\mqx_stdlib\\mqx_stdlib.a" "C:\\Freescale\\KDS_1.1.0\\toolchain\\lib\\gcc\\arm-none-eabi\\4.8.0\\m4\\fp\\v4-sp-d16\\libgcc.a" "C:\\Freescale\\KDS_1.1.0\\toolchain\\arm-none-eabi\\lib\\m4\\fp\\v4-sp-d16\\libc.a" "C:\\Freescale\\KDS_1.1.0\\toolchain\\arm-none-eabi\\lib\\m4\\fp\\v4-sp-d16\\libsupc++.a"

"C:\\Freescale\\KDS_1.1.0\\toolchain\\arm-none-eabi\\lib\\m4\\fp\\v4-sp-d16\\libm.a" -Xlinker --end-group

arm-none-eabi-gcc: error: C:\lib\ksdk_mqx_lib\kds\K64F12\debug\ksdk_mqx_lib.a: No such file or directory

arm-none-eabi-gcc: error: C:\lib\frdmk64f120m.kds\debug\rtcs\rtcs.a: No such file or directory

arm-none-eabi-gcc: error: C:\rtos\mqx\lib\frdmk64f120m.kds\debug\nshell\nshell.a: No such file or directory

arm-none-eabi-gcc: error: C:\rtos\mqx\lib\frdmk64f120m.kds\debug\bsp\bsp.a: No such file or directory

arm-none-eabi-gcc: error: C:\rtos\mqx\lib\frdmk64f120m.kds\debug\psp\psp.a: No such file or directory

arm-none-eabi-gcc: error: C:\rtos\mqx\lib\frdmk64f120m.kds\debug\mqx_stdlib\mqx_stdlib.a: No such file or directory

08:49:00 Build Finished (took 203ms)

I have compile this libraries. Can you help me? thanks.

img5.png

0 Kudos
1,970 Views
LuisCasado
NXP Employee
NXP Employee

Hi Kevin,

Can you build the example Project without errors?

In the new project, what modifications have you done?

Luis

0 Kudos
1,970 Views
kevincarcel
Contributor II

Hello Luis

Yes I build the example project and the new project without errors. I have changed much of the project and have included cunimucacion CAN.

Thanks Luis

0 Kudos
1,922 Views
LuisCasado
NXP Employee
NXP Employee

Hi,

Your problem is in the path of the libraries:

C:\rtos\mqx\lib\frdmk64f120m.kds\debug\xxxxx

Review the projects paths in your new project.

Luis

0 Kudos
1,922 Views
kevincarcel
Contributor II

Hi

The paths of the libraries are same as in the example project and I check that exist.

img4.png

Which  be the problem?

thanks Luis

0 Kudos
1,922 Views
LuisCasado
NXP Employee
NXP Employee

Hello kevin,

And the linker settings?

Luis

0 Kudos
1,922 Views
kevincarcel
Contributor II

Hi

the linker settings is same.

img3.png

thanks

0 Kudos
1,922 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

Post your project. I don't know what the problema is.

Luis

0 Kudos
1,922 Views
kevincarcel
Contributor II

Hi Luis


I inclose the project. thanks

0 Kudos
1,922 Views
LuisCasado
NXP Employee
NXP Employee

Hi Kevin,

I see all the paths modified to absolute location. So, what is your goal? do you want to generate a MQX-KSDK project position independent? And work outside of the MQX-KSDK source tree?

Luis

0 Kudos
1,922 Views
kevincarcel
Contributor II

Hello Luis         

My intention was to create the project in my workspace, for not modify the sample project.

thanks

0 Kudos
1,922 Views
LuisCasado
NXP Employee
NXP Employee

Hi,

If you are using a MQX-KSDK project and you're integrating CAN, you should use the KSDK driver. But in any case, in you use your CAN code, your project fails because this include file is not found : #include "frdmk64f.h". That is a MQX file (non MQX-KSDK file). You could copy to your project, but probably will bring many more error. You shouldn't mix things.

If you want to reuse code, I would stay in MQX 4.1.1 with KDS. And if you plan to use MQX-KSDK, use the KSDK drivers.  

Luis,

1,922 Views
kevincarcel
Contributor II

Hello Luis

I've returned to create the proyect with all references at same MQX-KSDK libreries. I've gotten to compile and debug my code, but when I add a breakpoint a reference file of MQX the debug session is close.

Am I doing something wrong?

thanks Luis

0 Kudos
1,922 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

Difficult to know, you will have to provide more details or how  to reproduce it.

Luis

0 Kudos
1,922 Views
kevincarcel
Contributor II

hello Luis

When I add a breakpoint appear the warning:

img1.png

in de debug windows appar:

img2.png

the error log is:

img2.png

Finaly, in the console windows appear:

img2.png

I hope that this pictures help you

thanks Luis

0 Kudos
1,922 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

It looks like KDS related. I see that issue is in one of the files you added.

Erich Styger , Any idea about this error?

Regards,

Luis

0 Kudos