UART KL05Z and Termite 2.9

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

UART KL05Z and Termite 2.9

Jump to solution
2,315 Views
nguyennhatminh
Contributor IV

Hi Pro,

 

I'm using KL05Z and codewarrior10.6 to communication with the computer.

 

I wish to receive the character from Computer and send back by Termite.

 

My program has some problem that I can't solve it.

 

I tried to debug and found this error

 

No source available for "__udivsi3 (0x00000828)() "

 

in init_uart0 function.

 

Please see attached file for my project.

 

please help me on this issue.

 

Thank a lot.

 

Nhat Minh

Original Attachment has been moved to: UART.rar

Labels (1)
0 Kudos
Reply
1 Solution
1,739 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Nhat Minh.

     Sorry for my later reply!

     Your configuration is still not enough.

     Please follow the sysinit.c in the KL05_bare_uart.rar  which I give you step by step.

    This file is do the system init, your system is not configured OK!

    Actually, you can use the sysinit at first directly, just add this file and the according head files.

    you can create a new project, and then add my file to your project.

   Wish it helps you!

   

      


Have a great day,
(my name)

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

View solution in original post

0 Kudos
Reply
9 Replies
1,739 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Nhat Minh,

    I checked your project, but I didn't find your error"No source available for "__udivsi3 (0x00000828)() ". it stop in  uart0_init function.

    I think it is the configuration error.

    Now, I do a uart project based on PE of Codewarrior 10.6. and it works OK.

    Please find my project from the attachment.

    My project function is : when receive the character from Computer and send back.

  My test platform is FRDM_KL05.

  UART BAUD IS 9600 bps.

  The test result is as follows:

pastedImage_0.png

  Wish it helps you!

If you still have question, please contact with me!

Have a great day,
Jingjing

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

1,739 Views
nguyennhatminh
Contributor IV

Hi Jingjing Zhou,

Thank you very much for your reply and giving me the sample project with PE.

But , can you help me to have look my project and help me point out the error ?

I'm newbie to ARM. I read very carefully driver UART sample code and USER manual to do this project.

But I don't know what is real problem.

Your help will be highly appreciate,

Thank you,

Nhat Minh.

0 Kudos
Reply
1,739 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Nhat Minh,

      You project is incomplete, you didn't configure the mcg clock,  the core clock, peripheral clock ect, and this is the most important to the cup.

      Attached is a new prject, and the main is neally the same as you, just add the sysinit() to configure the system clock, for details, please see the sysinit function.

     Besides, you need to read the MCG chapter in our reference manual.

pastedImage_1.png

    My baud is 19200 bps, and the test result is as follows:

pastedImage_2.png

Wish it helps you!

If you still have question, please let me know!


Have a great day,
Jingjing

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

0 Kudos
Reply
1,739 Views
nguyennhatminh
Contributor IV

Hi Jingjing Zhou,

thank you for your support,

I'm study MCG clock .

Your project that you sent to me , I can't run it.

It gives me the error "

Description    Resource    Path    Location    Type

mingw32-make: *** No rule to make target `F:/KinetisCode/practice/KL05/KL05_bare_uart/src/projects/LED_Blink/LED_Blink.c', needed by `Sources/projects/LED_Blink.o'.  Stop.    LED_Blink             C/C++ Problem

I think it relevant to the Path of the file 'F. 'put the project file in working directory but it doesn't show such as E:/...

Please help me how to correct this issue,

thank you,

Minh.

0 Kudos
Reply
1,739 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Minh,

   Please do the clean project at first, just like follows:

pastedImage_0.png

then build it again!

If you still have question, please contact with me!

Jingjing

1,739 Views
nguyennhatminh
Contributor IV

Hello Jingjing Zhou,

I hope you are well.

As you told me I didn't configure the Clock for the system. So I read the mcg.c and copy the function and create the MCGOUTCLK for Core, bus,.. as below

SIM_SCGC5 |= (SIM_SCGC5_PORTA_MASK |SIM_SCGC5_PORTB_MASK);

       fei_fee(32768, 1, 1);

       SIM_CLKDIV1 = ( 0

                              | SIM_CLKDIV1_OUTDIV1(0)

                              | SIM_CLKDIV1_OUTDIV4(1) );

But the file still doesn't work, and I recognize the hex file wasn't  created. ( I set Create Flash Image).

So that to Create Flash Image file what compiler need is ?

In practical, I think NO ONE like me create a separate project like this , doesn't it ?

Would you like share with me your produce make a new project that based on Diver Class also create a new driver ?:smileysilly:

Thank a lot ,

Nhat Minh.

0 Kudos
Reply
1,740 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Nhat Minh.

     Sorry for my later reply!

     Your configuration is still not enough.

     Please follow the sysinit.c in the KL05_bare_uart.rar  which I give you step by step.

    This file is do the system init, your system is not configured OK!

    Actually, you can use the sysinit at first directly, just add this file and the according head files.

    you can create a new project, and then add my file to your project.

   Wish it helps you!

   

      


Have a great day,
(my name)

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

0 Kudos
Reply
1,739 Views
nguyennhatminh
Contributor IV

Hi Jingjing Zhou

Thank you for your support,

Minh.

0 Kudos
Reply
1,739 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Minh,

    No thanks!

    As a new learner, you still can refer to our quick reference, this document will help you too:

http://cache.freescale.com/files/32bit/doc/quick_ref_guide/KLQRUG.pdf?fasp=1&WT_TYPE=Users Guides&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation

  Of course, if you have question, please let me know!

  And, if your question is solved, please click the correct answer button to close this question, Thank you!


Have a great day,
jingjing

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

0 Kudos
Reply