Creating a new project - FRDM-KL02Z

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

Creating a new project - FRDM-KL02Z

Jump to solution
2,097 Views
markadamson
Contributor II

Hi,

I have been able to get the example projects that where supplied with the package to work. I have also been able to edit the projects, adding my own c code (simple code, like creating integer arrays, basic loops). At the moment I am just practicing to program in C so nothing too complicated with the board. I have been using the putty terminal to practice programming in C.

My problem however is that I have tried to create my very own project and practice programming on a brand new project rather than editing the example projects. When I created my own project, I just put in a simple printf() statement, but I got errors saying saying something about WriteUARTN, ReadUARTN.....

So my question is how do I create a new project that I can put onto the board (maybe toggle LEDs for example)?

Labels (1)
0 Kudos
Reply
1 Solution
1,698 Views
adriancano
NXP Employee
NXP Employee

Hi,

Please check the image below, these are the configurations you should have in your Console component:

UART pins_2.png

Also I did a simple project to test this issue; in the attachments you can find my project.

Note: Be careful with the syntax of the printf function, it could be a problem sometimes.

I hope this information can help you.

Regards,

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. It would be nice!

-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
10 Replies
1,698 Views
adriancano
NXP Employee
NXP Employee

Hi,

You need to change the library you are using. Please follow the Jorge´s answer in this thread to achieve that: Re: MK10DX256VLK7 doesn't run standalone, just when debugging. Verified it's running from FLASH, not...

I hope this information can help you.

Regards,

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. It would be nice!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,698 Views
markadamson
Contributor II

I'm afraid that didn't work.

I have been following the guides on the following links, and although the errors get fixed, when copy and paste the .s19 over to the board, nothing happens on the putty terminal. It should just print the words Hello World.

Tutorial: Printf() with (and without) Processor Expert | MCU on Eclipse

printf() with the FRDM-KL25Z Board and without Processor Expert | MCU on Eclipse

Any ideas??

0 Kudos
Reply
1,698 Views
adriancano
NXP Employee
NXP Employee

Hi,

Are you using the Console component in Processor Expert? if yes, did you selected the PTB2/UART0_RX and the PTB1/UART0_TX in the pins of the component. These are the pins connected to the OpenSDA hardware.

Also, what happens when you debug your project? It execute the printf function without problems?

Regards,

Adrian

0 Kudos
Reply
1,698 Views
markadamson
Contributor II

I selected PTB4/UART0_RX and the PTB3/UART0_TX. How can I change the pins that you are specifying?

When I compile the project, I get no errors. It builds the .elf file, .s19 file and so on.

Don't I have to initialise the pins in the code itself?

0 Kudos
Reply
1,698 Views
adriancano
NXP Employee
NXP Employee

Are you using Processor Expert?

0 Kudos
Reply
1,698 Views
markadamson
Contributor II

Yes I am

0 Kudos
Reply
1,698 Views
adriancano
NXP Employee
NXP Employee

Hi,

Processor Expert will do the appropriate initialization of the module, you just need to set correctly the values you want in the Processor Expert's interface. The image bellow shows you where to change the pins value for the ConsoleIO component: (the names and values do not correspond to your project because this picture is for another project I have but the steps are the same).

UART pins.png

1. Select the Serial_LDD component.

2. Select UART0

3. Select PTB2/UART0_RX in the Receiver pin.

4. Select PTB1/UART0_TX in the Transmitter pin.

5. Generate processor expert code.

With this changes the UART0 is configured to send and receive data through the OpenSDA feature to a terminal in your PC.

I hope this information can help you.

Regards,

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. It would be nice!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,698 Views
markadamson
Contributor II

That'd the interface I have been working with however, I don't get PTB2 and PTB1. The image I have provided only shows PTB4 and PTB3UART0 screenshot.png

0 Kudos
Reply
1,699 Views
adriancano
NXP Employee
NXP Employee

Hi,

Please check the image below, these are the configurations you should have in your Console component:

UART pins_2.png

Also I did a simple project to test this issue; in the attachments you can find my project.

Note: Be careful with the syntax of the printf function, it could be a problem sometimes.

I hope this information can help you.

Regards,

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. It would be nice!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,698 Views
markadamson
Contributor II

Apologies for the late reply. Thank you for the example project and steps that you provided. I managed to follow it and create my own project, displaying Hello World.

0 Kudos
Reply