FRDM-K64F using Term component

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

FRDM-K64F using Term component

Jump to solution
1,767 Views
shauldorf
Contributor V

I wrote simple test program using on “Term” component.

do {

    Term1_SendStr("Press any key\r\n");

    Term1_KeyPressed();

    Term1_ReadChar(&ch);

    Term1_SendStr("\nYou pressed:\r\n");

    Term1_SendChar(ch);

     Term1_SendStr("\n**************\r\n");

} while(1);

This component is not supported by KSDK1.2 (on FRDM-K64F) so I select "Processor Expert" option.

Using:

  • Board” option device:  FRDM-K64F No KSDK1.2  and Processor Expert (selected)

         SendStr() is working but ReadChar() is not working

  • “Processor” option  MK64FN1M0xxx12 No KSDK1.2  and Processor Expert (selected),

        making necessary modifications (CP{U type to 100 pin package and PinSetting Switch Configuration) ,

        The test is working perfect

Is there any explanation for this behavior?

Shaul

1 Solution
1,205 Views
shauldorf
Contributor V

Hello Mark

Your work around (solution) is working well.

Based on my little experience it might be helpful to add to
fsl library “Term” component.

Thanks’ for your effort.

Shaul  :smileyhappy:

View solution in original post

0 Kudos
14 Replies
1,205 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

can you please send both of your two projects so that i can test it directly on my side?

thanks!


Have a great day,
Zhang Jun

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

0 Kudos
1,205 Views
shauldorf
Contributor V

Hello;

Zip using Export

Thanks again

Shaul

0 Kudos
1,205 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

The problem is caused by routing of the RxD pin of the AsynchroSerial component (inherited by the Term component), see the following screenshot:

pastedImage_0.png

When you select the PTB16 pin in the RxD item (and also generate project and build the application again), the application will work properly.

Best Regards,

Marek Neuzil

0 Kudos
1,205 Views
shauldorf
Contributor V

Hello Marek

Attached my not working screenshot

Term1_Board+PE.jpg

Sorry it doesn’t help

Shaul

0 Kudos
1,205 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

I am sorry but the application does work properly on my target board. I have also checked the generate code and it is the same. It seems that the issue is caused by your target board. The UART device is sensitive for precise clock source. I have noticed that you are using FEI mode of the MCG (internal oscillator of the MCU). Try to use an external crystal that is available on the FRDM-K64F target board. For example you can use the 50MHz external clock that is provided for RMII (external crystal is used that is stable and precise). You can set the PBE mode of the MCG and directly use this clock source for core and bus clock. See for example the attached application.

Please note, that your target board can be also damaged. If you have another FRDM-K64F target board try to use this other board to verify the functionality of the UART device and OpenSDA (OpenSDA provides virtual serial COM port on your host computer).

Best Regards,

Marek Neuzil

0 Kudos
1,205 Views
shauldorf
Contributor V

Hello Marek

There is no problem using your or my programs. You build your program using processor option.

I found the problem when I used Board option (see in attached fig).

I'm attaching zip project with your main.c. The "Term1_ReadChar(&ch)" read is not working.

Thanks

Shaul

0 Kudos
1,205 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Shaul,

I am sorry I don't understand you. I have used the same application that does not work on your host computer with FRDM-K64F target board. But the same application works on my host computer and target board properly.

Do you use OpenSDA debug connection? Do you use Segger j-link or PEMicro OpenSDA debug connection (firmware)?

What version of FRDM-K64F target board are you using?

Best Regard,

Marek Neuzil

0 Kudos
1,205 Views
shauldorf
Contributor V

Attached board revision

Thanks

Shaul

0 Kudos
1,205 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Shaul,

Thank you for the project. I have been able to reproduce the problem. The issue is caused by the AsynchroSerial component (inherited in the Term component) when two or more clock configurations are defined in the project (in the CPU component).

In this case the initialization code does not contain calling of the ReceiveBlock for the read buffer, i.e. there is not any buffer for receiving data and all characters are dropped in the inherited Serial_LDD component driver.

If you freeze the code of the Inhr1:AsynchroSerial component and add the following code (marked by bold) in the HWEnDi() function in the Inhr1.c program module the receiving of data will works.

static void HWEnDi(void)

{

  if (EnMode) {                        /* Enable device? */

    (void)ASerialLdd1_Enable(ASerialLdd1_DeviceDataPtr); /* Enable device */

    (void)ASerialLdd1_ReceiveBlock(ASerialLdd1_DeviceDataPtr, &BufferRead, 1U); /* Receive one data byte */

  } else {

    (void)ASerialLdd1_Disable(ASerialLdd1_DeviceDataPtr); /* Disable device */

  }

}

I will report this issue to the Processor Expert development team.

Best Regards,

Marek Neuzil

1,205 Views
shauldorf
Contributor V

Marek Thanks’

I’m traveling with imitated internet access, on my back I will check yours work around.

Shaul

0 Kudos
1,206 Views
shauldorf
Contributor V

Hello Mark

Your work around (solution) is working well.

Based on my little experience it might be helpful to add to
fsl library “Term” component.

Thanks’ for your effort.

Shaul  :smileyhappy:

0 Kudos
1,205 Views
shauldorf
Contributor V

Hello Again

In attached pdf there is description what I'm doing + zip project

Shaul

0 Kudos
1,205 Views
shauldorf
Contributor V

Hi;

See in attached.

Thanks !!!!!!

0 Kudos
1,205 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Shaul,

In my personal view, i  recommend you use the ""Processor", for i fund the "Board" is not perfect about all of the function .

Hope it helps

Alice

0 Kudos