Can Any One Help to Start with MKE02Z16VLC02 with Keil Software.

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

Can Any One Help to Start with MKE02Z16VLC02 with Keil Software.

2,373 Views
ravindrashukla
Contributor I


I have make a project in Keil with MKE02Z16XXX2 ,added the Startup File .

in shows a error that

.\test1.axf: Error: L6218E: Undefined symbol SystemInit (referred from startup_mkl02z4.o).

after that i have written

int main()

{

SystemInit();

while(1)

{

 

}

}

but still the error exists.

Please Help Me,

Any Suggestions Welcomed

Thanxxxx

Labels (1)
0 Kudos
Reply
11 Replies

1,476 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ravindra,

You're unnecessary to add the SystemInit() by yourself. I suggest you'd better use the FRDM-KE02 sample code to jumpstart the desgin.

I've included the FRDM-KE02 sample code guide for KEIL MDK with the reply, so please refer to it for details.

If you have any other questions, just feel free to contact with me.

Best regards,

Ping

1,476 Views
ravindrashukla
Contributor I

Thanx Ping and Martin for help,

@Ping Zhou thanx for document,

I am just Starting with the Freescale MCUs, in Past I worked on NXP LPC2148/29(ARM 7) MCUs, Keil i able to simulate these internal Pheripherals

I Suppose Keil Does Not Simulate these Freescale's MCUs (after seaching on net ).

I a week I will got my FRDM-KE02Z dev board .after that i will let you know that it is working or not.

I am also trying to work with IAR,it will compile it but when see the internal registers At First they change,but after that they does not.

#include"MKE02Z2.h"

int main()

{

GPIOA_PDDR |=GPIO_PDDR_PDD( 0xff00);

//GPIOA_PDOR |=GPIO_PDOR_PDO(0x0ffff);

GPIOA_PDDR =GPIO_PDDR_PDD( 0x00ff);

while(1)

{

//GPIOA_PSOR &= ~(GPIO_PSOR_PTSO(0x00ff));

GPIOA_PDOR =GPIO_PDOR_PDO(0x0ffff);

  //GPIOA_PCOR=GPIO_PCOR_PTCO(0xffff);

GPIOA_PDOR =GPIO_PDOR_PDO(0x000000);

//GPIOA_PTOR |=GPIO_PTOR_PTTO(0x0ffff);

}

//return 0;

}

I just want to toggle any of my pins....

from code they go From 0x0000 to 0xffff but not comming again to 0x0000...

Any suggestions?????

0 Kudos
Reply

1,475 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ravindra,

I've included a sample code base on IAR 6.6 that could toggle the PTH1 in the reply.

I think it should be useful for reference and please refer to it for details.

Have a nice day.

Best regards,

Ping

IMG_20140123_150821.jpg

0 Kudos
Reply

1,475 Views
ravindrashukla
Contributor I

Hi Ping ,

I am attaching some screen shots of my system,

i contains that i have success fully compiled the code,

second screenshot displays a function is DISASSEMBLY named __iar_program_start ,this is that code where my code revolves all the time and never go to main....

I have also follows the disassembly code of demo code ,

in that when i Press F5 code runs normally ,but when i go step by step it keeps revolving and never go to main,so iam unable to track which asm code or files are required tocall the main function from startup...

iar_prgm_start.pngsuccess_compiled.png

0 Kudos
Reply

1,475 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ravindra,

Thanks for your reply. I'm glad to hear that you had compliled your project successful. However I've not figured out your new question so far and I think it should be related to the start function.

So I'd like to suggest that you'd better to choose the project which be creted by .exe and the project suit all KE02 miccontrollers. KE02 has been lauched since a year ago, so there's not many documents about it on net and I hope you could understand.

Have a nice day!

Best regards,

Ping

0 Kudos
Reply

1,475 Views
ravindrashukla
Contributor I

HI Ping,

Now i know why there is so much less support on KE02..

anyways Good news I have successfully runned A LED TOGGLE code on FRDM-KE02Z2 board without that .exe maken project,just added a .h file and disabled wachdog timer.

Thanx for you help ,But Problem dosen't stops here:smileylaugh: actually so many to come now,

i am trying UART1 cofigurations so that i can comuunicate with my PC and board(AS OpenSDA  degugger is connected with UART1 in board) it not running and it will also hang the debugger and my code (even led blink hangs..)

0 Kudos
Reply

1,475 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ravindra,

Thanks for your reply. I'm glad to to hear that you had corrected the Led Toggle code. Regarding to the UART1 issue, I'd like to suggest give you two advices. First advice, you could use oscilloscope to test the signal of UART1's pins, It's efficent way to figure out the exactly problem. Second advice, I've attached the uart.c and uart.h which from our demo core and I think it should be useful for reference.

Best regards,

Ping

0 Kudos
Reply

1,475 Views
ravindrashukla
Contributor I

Hi Ping,

Thanx for your Support,

But i have already Done this thing ,and my code is also success fully runned at the board.

When i debug setp(F11) by step it will remain in loop to the statup and never go the void main()..(This is problem 1)

when i press F5 code runs correctly..(I don't unserstand why!!)

Problem2 . when i make a project that .exe it will automatically add lots of files in my project and it will eat my precious(3.5kb) of my flash memory.and the contoller i Work later is of only 8KB,so remain only 4.5 kb space ,that is not good for me.

Problem3. I am confused that may be by making projects by that .exe will work on FRDM-KE02Z2 board but what will happen when i buy a fresh new controller(not board),will my code work in that.

I am trying to to run my controller baremetal type ,just some neccesarry startup.s,headerfile.h and some low level intialization code(ASM and C)  are included and rest of the code i will write by my own(like for WDOG,UART,GPIO,IIC,Clock  etc).

I heartly thanks to you for your interest in helping me out, as i googled it i found very less support is available on net and also on freescale site and community.

0 Kudos
Reply

1,475 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ravindra,

As I know, MDK 4.72 can support to debug KE02. Your code had confused me, so could you tell me what's the exacly funtion do you want?

I'm looking forward to your reply.

Best regards,

Ping

0 Kudos
Reply

1,475 Views
ravindrashukla
Contributor I


Hi Ping ,

i have received my board KE02Z ,I am successful to rum demo applications which were available on Freescale site.

in code i Just want to toggle my pins ,

I have MDK 4.73 and does Not simulate. i dont know why??,it shows no read or write access at (some watchdog's address).

in IAR in am able to compile the code but again it is not running on the board .

#include"MKE02Z2.h"

#define LED0_Init()    GPIOB_PDDR |= (2<<24)     // RED Light
#define LED0_Toggle()      GPIOB_PTOR = (2<<24)
#define LED0_On()          GPIOB_PCOR = (2<<24)
#define LED0_Off()          GPIOB_PSOR = (2<<24)

#define LED1_Init()    GPIOB_PDDR |= (4<<24)     // Green
#define LED1_Toggle()      GPIOB_PTOR = (4<<24)
#define LED1_On()          GPIOB_PCOR = (4<<24)
#define LED1_Off()          GPIOB_PSOR = (4<<24)

#define LED2_Init()    GPIOB_PDDR |= (0x01<<7)
#define LED2_Toggle()      GPIOB_PTOR = (0x01<<7)
#define LED2_On()          GPIOB_PCOR = (0x01<<7)
#define LED2_Off()          GPIOB_PSOR = (0x01<<7)

unsigned int i,j;

int main()
{
 
  LED0_Init();
 
  while(1)
  {
    LED0_Toggle();
    for(i=0;i<1000000;i++)
    {
      for(j=0;j<1000000;j++);
    }
   
  }

  //return 0;
}

Just trying to make things work..

let u know...for updation

0 Kudos
Reply

1,475 Views
paulmartin
Contributor III

When you add "startup_mkl02z4.s" to your project, you also need the corresponding system file: "system_mkl02z4.c" .

SystemInit() is defined in that file and you do not need to call it yourself.

hope it helps.

0 Kudos
Reply