Starting with MCUExpresso and SDK for K02

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

Starting with MCUExpresso and SDK for K02

Jump to solution
2,504 Views
arnogir
Senior Contributor II

Hello

Previously, I devellop project with codewarrior and KDS on K60/K70.

Today, I start a new project with K02 and then, Start with the new tools, Then MCUExpresso.

In it, I download the SDK for the K02, add some driver, middleware etc..

I configured my CPU, code "hello word" compile with some remark.

Many question:

1) The PRINTF("Hello word") is not recognized. Which component do I add to be taken?

2) I use the Spi, Then I Add the spi_adapter.

The DSPI_MasterInit is called from the generated file "Peripheral.c" => Ok

Now, I read the HAL dspi_adapter. If I want use it, there are a function HAL_SpiMasterInit which will call also DSPI_MasterInit… Then there is exemple code to use all the driver and HAL? with API detail, exemple code etc... I not find it!

3) The main function fall in infinite loop, then this is redundant with previous question, but I add timer / timer_manager. It seem with this I can configure and start some task. there is exemple? My need is to create some task, with different period and priority..

4) UART driver: how use the function LIN break detection? (may be response is in SDK documentation I asked in question 1?...)

Thank

0 Kudos
1 Solution
2,262 Views
soledad
NXP Employee
NXP Employee

Hi,

Please check the following document and let me know if that is what you need.

https://community.nxp.com/docs/DOC-334074

Regards

Soledad

View solution in original post

0 Kudos
12 Replies
2,262 Views
arnogir
Senior Contributor II

Ok

It is clear for me now.

I was confused with the printf via debug consol and a real UART.

Only what I need is via the console.

I will test that as soon as I will have the target!

0 Kudos
2,262 Views
arnogir
Senior Contributor II

Ok,

Then for the support of PrintF, can we modify an existing project to support it? If yes, how? I do not find how.

0 Kudos
2,262 Views
soledad
NXP Employee
NXP Employee

Hi,

You need to implement it by software, in the following link you will find more information about the lpuart driver

MCUXpresso SDK API Reference Manual: LPUART Driver 

Regards

Soledad

0 Kudos
2,262 Views
arnogir
Senior Contributor II

Ok thank for the Lin.

 What about add the printf on existing project?

0 Kudos
2,263 Views
soledad
NXP Employee
NXP Employee

Hi,

Please check the following document and let me know if that is what you need.

https://community.nxp.com/docs/DOC-334074

Regards

Soledad

0 Kudos
2,261 Views
soledad
NXP Employee
NXP Employee

Hi,

Did you create a new project? or Did you import a project?

Please check the following document and let me know if this helps with your questions:

 https://community.nxp.com/docs/DOC-334074

Regarding the SPI example code, after download the sdk for k02, you can find the DSPI examples at the following path:

\SDK_2.7.0_MK02FN128xxx10.zip\boards\frdmk22f\driver_examples

pastedImage_1.png

In addition, I am attaching the MCUXpresso SDK API Reference Manual_MK22

Please let me know if this helps,

have a nice day!

Regards

Soledad

0 Kudos
2,262 Views
arnogir
Senior Contributor II

Hello

I start new project from scratch

-Which module exactly must I add to have the "PrintF" function?

-For the UART module, I think the C code is designed to configure the BreakLin Dtetection, but the MCU expresso IDE do not allow to activate this option. I'm right?

Alos, If I understand, If I use the UART_Adpater, I mudt not configure into MCUExpresso peripheral the UART? (Because It will init by the UART_adapter) I'm Right?

0 Kudos
2,262 Views
soledad
NXP Employee
NXP Employee

Hi,

Please follow the below steps:

1. Click on New project

pastedImage_1.png

2. Select the MCU from installed SDK, click Next

pastedImage_2.png

3. In project, Options select UART and add the uart driver

pastedImage_3.png

4. Select Redirect SDK "PRINTF" to C library "printf", then click Finish

pastedImage_4.png

5. At this point, you should be able to use printf.

pastedImage_5.png

Please check the fsl_uart.h

You will find the structure with the settings for all of the UART interrupt configurations.

pastedImage_6.png

I hope this helps, have a nice day !

Regards

Soledad

0 Kudos
2,262 Views
arnogir
Senior Contributor II

Hello,

Thank for the information about the Printf. But now, when the project is already existing, how set this functionnality?

For the LinBreak, it is what I said. The Break Lin interrupt detection is on the c code, but on the MCUXpresso, it is not ?

LinBreak.jpg

0 Kudos
2,262 Views
soledad
NXP Employee
NXP Employee

Hi,

MCUXpresso IDE does not allow to activate this option like you previously mentioned.

Regards

Soledad

0 Kudos
2,262 Views
arnogir
Senior Contributor II

Do you answer about the use of lin break or use of printf?

0 Kudos
2,262 Views
soledad
NXP Employee
NXP Employee

LinBreak

0 Kudos