uart4 problem in K70

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

uart4 problem in K70

跳至解决方案
1,216 次查看
Microfelix
Contributor IV

hi,

I am continuing the transition from MQX MQX 3.8 to 4.0.

I have a problem with the UART4.

I use the UART4 with reception interrupt "ittye".

With the RX l.MQX 4.0 does not work.

If I send a data on the TX, RX me back on with many other erroneous data.

I refer to this post:      https://community.freescale.com/message/325979#325979

Maurizio

0 项奖励
回复
1 解答
1,047 次查看
DavidS
NXP Employee
NXP Employee

Hi Maurizio,

I'm using the TWR-K70F120M development kit and removed the Y5 crystal and soldered blue wire to the Y5 pins 1(UART4RX) and 3 (UART4TX).

I then jumpered the Y5 pin 1 to the TWR-SER J17 pin 1,

I then jumpered the Y5 pin 3 to the TWR-SER J19 pin 1.

Running the attached code in your MQX4.0/mqx/examples/io folder the initial printf() goes to the default serial output (i.e. pre-blue wire setup) and the output will look like:

printf("This is printed to the default device\n");

Continuing to step the code the UART4 (ttye:) gets open and is configured to be the default output.  With the blue wire modification the TWR-SER DB9 terminal window will show:

printf("This is printed to the other device\n");

Lastly I did use PE (Processor Expert) on the BSP to disable any configuration of the PTE24/25 pins.  You might check your code or use PE to do the same.

I've attached all files in BSP and application that I've enhanced for this test.

Regards,

David

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,047 次查看
DavidS
NXP Employee
NXP Employee

Hi Maurizio,

I tested the UART4 on TWR-K70F120M several weeks ago using the MQX4.0/mqx/io example.

I had to update the init_gpio.c in the BSP to get the correct pin configuration.

Here is the edit I made in that file in function _bsp_serial_io_init():

    case 4:

            pctl = (PORT_MemMapPtr)PORTC_BASE_PTR;

            if (flags & IO_PERIPHERAL_PIN_MUX_ENABLE)

            {

                /* PTC14 as RX function (Alt.3) + drive strength */

                pctl->PCR[14] = 0 | PORT_PCR_MUX(3) | PORT_PCR_DSE_MASK;

                /* PTC15 as TX function (Alt.3) + drive strength */

                pctl->PCR[15] = 0 | PORT_PCR_MUX(3) | PORT_PCR_DSE_MASK;

            }

Regards,

David

0 项奖励
回复
1,047 次查看
Microfelix
Contributor IV

Thanks for the reply,

but, I started on the project and in production use for MQX 3.8 uart4, pins 24 and 25.

Now with MQX 4.0 does not work anymore.

I can not change the pin.

Maurizio

0 项奖励
回复
1,048 次查看
DavidS
NXP Employee
NXP Employee

Hi Maurizio,

I'm using the TWR-K70F120M development kit and removed the Y5 crystal and soldered blue wire to the Y5 pins 1(UART4RX) and 3 (UART4TX).

I then jumpered the Y5 pin 1 to the TWR-SER J17 pin 1,

I then jumpered the Y5 pin 3 to the TWR-SER J19 pin 1.

Running the attached code in your MQX4.0/mqx/examples/io folder the initial printf() goes to the default serial output (i.e. pre-blue wire setup) and the output will look like:

printf("This is printed to the default device\n");

Continuing to step the code the UART4 (ttye:) gets open and is configured to be the default output.  With the blue wire modification the TWR-SER DB9 terminal window will show:

printf("This is printed to the other device\n");

Lastly I did use PE (Processor Expert) on the BSP to disable any configuration of the PTE24/25 pins.  You might check your code or use PE to do the same.

I've attached all files in BSP and application that I've enhanced for this test.

Regards,

David

0 项奖励
回复