Going from CW 10.6 to KDS

cancel
Showing results for 
Search instead for 
Did you mean: 

Going from CW 10.6 to KDS

366 Views
juanm
Contributor III

Hi! I have a simple program for a KL05 running on CW 10.6, I tried to use the same code in KDS but it seems that many definitions are missing from MKL05Z4.h. For example, this code compiles fine on CW:

#include "derivative.h" /* include peripheral declarations */   unsigned int i;   int main(void) {   SIM_SCGC5 = SIM_SCGC5_PORTA_MASK ; //Activo reloj PTA   PORTA_PCR10 = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;   GPIOA_PDDR |= (1<<10); //PTA10 como salida     for(;;) {      GPIOA_PTOR=(1<<10); //Toggle PTA10   for (i=61000; i; i--);   }    return 0; }

 

In KDS I change the include to #include "MKL05Z4.h", but when I compile I get errors saying that SIM_SCGC5, PORTA_PCR10, GPIOA_PDDR and GPIOA_PTOR aren't defined.

I'm missing another include file? It's strange because those definitions are present on the KL25Z include but not on the KL05Z.

Thanks.

Labels (1)
0 Kudos
2 Replies

145 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello juanm,

(1) When create bareboard project (without Processor Expert ) on KDS ,Yes,,some header of chips have not define the "SIM_SCGC5" ..... ,

I think we can refer to the header of CodeWarrior to use the header of KDS or define .

For example :

SIM->SCGC5 = SIM_SCGC5_PORTA_MASK ;

PORTA->PCR[10] = PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK;

(2) When create a Processor Expert project on KDS , in the header file of  "MKL05Z4.h",  there have the definition of "SIM_SCGC5" ....." 。


Have a great day,
Alice

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

0 Kudos

145 Views
juanm
Contributor III

Freescale is planning on fixing this problem?

Thanks for the reply!

0 Kudos