Examples / tutorials with PE but without KSDK?

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

Examples / tutorials with PE but without KSDK?

1,021 Views
rolffreitag
Contributor III

I have to program a board with a MK60DNZVLL10, so i can make a project with PE but without KSDK.

I could do a basic configuration, timer configuration, via the CPU component, but there ist no component (i can add to the project and use) to configure the pins, e. g. the GPIO pins for LED toggling.

Is the only way to do it reverse programming, looking which functions are used in projects with KSDK, and do copy&paste them to main() or functions called by main()?

And where can i find examples / tutorials with PE but without KSDK?

0 Kudos
6 Replies

605 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Rolf Freitag:

As suggested by Erich you should give a look to his tutorials.

In addition attached is a guide for K60 with Processor Expert. It is an old guide for CodeWarrior and some things have changed, so do not try to follow it meticulously. However the general procedure is the same, so you could base on that guide and develop your own project with KDS + Processor Expert. The next thread is where the creator James Trudeau shared the guide:

Get Started with K60 and Processor Expert

Regards!

Jorge Gonzalez

0 Kudos

605 Views
rolffreitag
Contributor III

Thanks, i could get it (nearly) working with the double definition of the signal in the guide (which is ugly because not orthogonal) and the clear/set function.

The build and PE build works without warnings/errors.

But the debugger starts with some errors:

SEGGER J-Link GDB Server V5.00d Command Line Version

JLinkARM.dll V5.00d (DLL compiled Jun 17 2015 22:33:29)

-----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:     0 ms

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

J-Link Host interface:         USB

J-Link script:                 none

J-Link settings file:          none

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

Target device:                 Cortex-M4

Target interface:              SWD

Target interface speed:        1000kHz

Target endian:                 little

Connecting to J-Link...

J-Link is connected.

Firmware: J-Link V9 compiled May 22 2015 17:20:50

Hardware: V9.30

S/N: 269300706

OEM: SEGGER-EDU

Feature(s): FlashBP, GDB

Checking target voltage...

Target voltage: 3.28 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 = 0x20008000)

Target interface speed set to 1000 kHz

Resetting target

Halting target CPU...

...Target halted (PC = 0x000004D8)

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= 20008000, MSP= 20008000, PSP= 00000000

R14(LR) = FFFFFFFF, R15(PC) = 000004D8

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 (2000 kHz)

Flash breakpoints enabled

Semi-hosting enabled (VectorAddr = 0x08)

Semihosting I/O set to TELNET Client

SWO disabled succesfully.

ERROR: CPU clock frequency detection is not supported for this device!

Failed to enable SWO. Could not measure target CPU frequency.

Downloading 480 bytes @ address 0x00000000 - Verify failed

Downloading 16 bytes @ address 0x00000400 - Verify failed

Downloading 1720 bytes @ address 0x00000410 - Verify failed

Downloading 8 bytes @ address 0x00000AC8 - Verify failed

Downloading 4 bytes @ address 0x00000AD0 - Verify failed

Downloading 4 bytes @ address 0x00000AD4 - Verify failed

Downloading 96 bytes @ address 0x00000AD8 - Verify failed

Downloading 36 bytes @ address 0x00000B38 - Verify failed

Writing register (PC = 0x000006d4)

Read 4 bytes @ address 0x000006D4 (Data = 0xFA270320)

Resetting target

Halting target CPU...

...Target halted (PC = 0x000004D8)

Read 2 bytes @ address 0x000004DE (Data = 0xF001)

Read 2 bytes @ address 0x000004DE (Data = 0xF001)

Read 2 bytes @ address 0x000004DE (Data = 0xF001)

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= 20008000, MSP= 20008000, PSP= 00000000

R14(LR) = FFFFFFFF, R15(PC) = 000004D8

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 0x000004D8 (Data = 0xF001B672)

Setting breakpoint @ address 0x000004DE, Size = 2, BPHandle = 0x0002

Starting target CPU...

And the debugger always stops at main, at

  /* Write your code here */

  LED0_ON;

with the define in the header:

  #define LED0_ON GPIO1_ClearPortBits(NULL, GPIO1_LED0_MASK);

Is it impossible do debug with the MK60DNZVLL10?

0 Kudos

605 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Rolf:

What do you mean with the "debugger stops"?

By default the debugger stops at main and it is expected, but I assume that code you show is after the PE_low_level_init() function.

Can you clarify or share your project?

Regards!

Jorge Gonzalez

0 Kudos

605 Views
rolffreitag
Contributor III

With debugger stop i mean when i stop the debugger (suspend), restart (resume) etc. the result is that the the Debug Current Instruction Pointer is always at the same point (line), here at clearing the port bit.

And the breakpoints are all ignored, although NOT "Skip all Breakpoints" is selected.

I attached the project.

I configured the clocks for the external source and a pin for LED toggling.

0 Kudos

605 Views
BlackNight
NXP Employee
NXP Employee

I have several tutorials on mcuoneclipse, google for "mcuoneclipse tutorial" and you should hopefully find what you need.

E.g.

Tutorial: Enlightning the Freedom KL25Z Board | MCU on Eclipse

(applicable to your board too).

BitIO_LDD should help you (see Tutorial: Bits and Pins with Kinetis and the FRDM-KL25Z Board | MCU on Eclipse ). Or you might use the McuOnEclipse LED component (see McuOnEclipse Releases on SourceForge | MCU on Eclipse  how to get them installed).

I hope this helps,

Erich

0 Kudos

605 Views
rolffreitag
Contributor III

Thanks for the links but the first is using a trick: The projects uses a board which has a LED component, but i have to start with a CPU, so i have no LED component.

So i tried the second, but with the component GPIO_LLD because i have to define the other pins layer. But it does not work: I defined a bit field for PTB9 with "Pin signal" LED0 and generated PE code, also selected "genarate code" for all methods which chould be selected, but the build always says that LED0, LED0_DeviceData, GPIO_DRV_SetPinOutput and LED0_SetVal are all undefined.

Why is LED0 not defined?

And how can i do pin toggling?

0 Kudos