What am I missing, FRDM-KL25Z, Desire Debug and Serial comms.

cancel
Showing results for 
Search instead for 
Did you mean: 

What am I missing, FRDM-KL25Z, Desire Debug and Serial comms.

Jump to solution
1,759 Views
philipfreidin
Contributor II

Here's what I have:

FRDM-KL25Z

Keil MDK 4.60

CMSIS-DAP_OpenSDA.S19

DEBUG-APP_Pemicro_v102.SDA

MSD-FRDM-KL25Z_Pemicro_v107.SDA

What I want is to be able debug a program and have serial

communications through the same USB cable.

Here's what I have achieved:

A) CMSIS-DAP_OpenSDA.S19

      Can download and run/debug app, but no serial comms.

B) DEBUG-APP_Pemicro_v102.SDA

      Can download and run/debug app, but no serial comms.

C) MSD-FRDM-KL25Z_Pemicro_v107.SDA

      Can drag/drop to download and run, serial comms works,

      but no debug. Only the pre-compiled .srec files .

      Keil compiler generates HEX or AFX files that can't be

      drag/drop and since no debug, compiler download does

      not work. So can't create new apps.

Is there an SDA that supports debug and comms?

Am I doing something wrong?

On a separate note, there seems to be two totally different

ways of referring to registers:

The examples for this board that are part of the Keil install

(Blinky) looks like this

    SIM->SCGC5    |= (1UL <<  10) | (1UL <<  12);

    PORTB->PCR[18] = (1UL <<  8);

The Freescale KL25_Sample_Code.exe unpacks to a pile

of directories. In the klxx-sc-baremetal source files it looks

like this:

    SIM_SCGC5 |= (SIM_SCGC5_PORTA_MASK)

Why are there two styles? Which should I use.

On another separate note, I can't find an example directory

for a Keil version of demo program that the board is shipped with.

I did an IAR version:

    kl25_sc\klxx-sc-baremetal\build\iar\FRDM_KL25ZDemo


Labels (1)
0 Kudos
1 Solution
118 Views
peter_fenn
Contributor III

Philip

Both the DEBUG-APP_Pemicro_v102.SDA and MSD-FRDM-KL25Z_Pemicro_v105.SDA applications support USB CDC serial comms (via the KL25's UART0 to the K20 SDA MCU on the Freedom board).


The CMSIS-DAP_OpenSDA.S19 debug App however does not include a USB CDC serial driver at this time but my understanding is that it will do so in future version of this SDA App...


More on OpenSDA at:

http://www.freescale.com/files/32bit/doc/user_guide/OPENSDAUG.pdf

The differences between the SDA applications are covered in detail in Avnet's Kinetis-L hands-on Speedway Workshops! :-)

http://www.em.avnet.com/KinetisLSpeedway


Peter

View solution in original post

0 Kudos
4 Replies
119 Views
peter_fenn
Contributor III

Philip

Both the DEBUG-APP_Pemicro_v102.SDA and MSD-FRDM-KL25Z_Pemicro_v105.SDA applications support USB CDC serial comms (via the KL25's UART0 to the K20 SDA MCU on the Freedom board).


The CMSIS-DAP_OpenSDA.S19 debug App however does not include a USB CDC serial driver at this time but my understanding is that it will do so in future version of this SDA App...


More on OpenSDA at:

http://www.freescale.com/files/32bit/doc/user_guide/OPENSDAUG.pdf

The differences between the SDA applications are covered in detail in Avnet's Kinetis-L hands-on Speedway Workshops! :-)

http://www.em.avnet.com/KinetisLSpeedway


Peter

View solution in original post

0 Kudos
118 Views
philipfreidin
Contributor II

Hi Peter,

Your answer that DEBUG-APP_Pemicro_v102.SDA  does support USB CDC serial comms contradicts

item B in my original post.  So that's where I started looking.  Eventually I uninstalled the device drivers

and re-installed them, and now I see both the Debug port and the Comms port in the Windows device

manager display. Once I got to this point I was able to get back to debugging my program, and also

having serial output to a console terminal.


Thanks,

Philip

0 Kudos
118 Views
BlackNight
NXP Employee
NXP Employee

Hello,

this tutorial/demo shows how to debug and to do serial communication through the OpenSDA USB cable:

A Shell for the Freedom KL25Z Board | MCU on Eclipse

Erich

118 Views
philipfreidin
Contributor II

Thanks for your reply and link to your blog site. I have spent several hours reading your excellent

articles/tutorials.

The underlying problem though is that in my original post I wrote:

B) DEBUG-APP_Pemicro_v102.SDA

      Can download and run/debug app, but no serial comms.

and this is incorrect. I have now got this going. See my response below to Peter.

On a more tragic note, I just spent about 10 hours trying to debug the I2C link to the MMA8451 on my

board, with the link hanging up at random times. I eventually found it was related to the way the

I2C clock was created (choice of the various control values). Even creating the same frequency but

with different combinations of control values could cause a success or failure. Then I found your

article describing this problem.

In case anyone else is having this problem, I found the following works:

Crystal is 8MHz , CPU clock is 48 MHz, Bus Clock is 24 MHz

I2C0 F register (@ 0x6000_6001) value is 0x14 Mult field is 0b00 -> mul = 1

and ICR is 0b010100  which gives an SCL divider value of 80

Thus 24MHz/80 = 300KHz for SCL

Also, various examples I found have a delay/pause at the end of each read or write

sequence. I adjusted the delay to be 20us so the gap between each sequence is

real obvious on an oscilloscope.


0 Kudos