UART communication with MQX driver fails

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

UART communication with MQX driver fails

跳至解决方案
1,121 次查看
soli
Contributor I

Hello,

 

I use MQX with the UART_0 for default output. So the bsp is configured with:

#define BSPCFG_ENABLE_TTYA              1

//…

#if BSPCFG_ENABLE_TTYA

#define BSP_DEFAULT_IO_CHANNEL                    "ttya:"    /* OSJTAG-COM   polled mode   */

#define BSP_DEFAULT_IO_CHANNEL_DEFINED

 

 

In my application the uart driver opens without error messages and I can step with debug mode into the uart sending functions. In the kernel function “_kuart_polled_putc(KUART_INFO_STRUCT_PTR io_info_ptr, char c)” I stop an read out the memory and register settings.

 

In this example (have a look at the screenshot) I try to send the value 0x78 (stored in char c) to uart output. But after step over the code line number 607 the register “sci_ptr->D” (UARTDataRegister) does not change and still stay on value 0x00. A forced writing of another value by a JTAG-debugger does not change too. The Register never change but the kernel function returns like everything was fine. The hardware never change his output-signal.

 

Does anyone know why the uart will not send any character? And does anyone know why I cannot overwrite this register by JTAG-debugger (J-Link Ultra)?

 

By the way: My measured pin on hardware is the right pin (pin PTA14). I tested this by using the gpio-driver. I have the same problem if I use another uart device.

 

Thanks for help.

 

0 项奖励
回复
1 解答
673 次查看
MarkP_
Contributor V

Hi,

uart output pins are initialized in init_gpio.c: _bsp_serial_io_init().

In MQX3.8 Uart device 0 (TTTYA) uses pins PTD6 and PTD7 pins, not PTA14.

~Mark

 

在原帖中查看解决方案

0 项奖励
回复
3 回复数
673 次查看
kysel
Contributor I

Can you send your program (basic init, send, recw data) to me ? I use it only for education and to understand uart.

0 项奖励
回复
674 次查看
MarkP_
Contributor V

Hi,

uart output pins are initialized in init_gpio.c: _bsp_serial_io_init().

In MQX3.8 Uart device 0 (TTTYA) uses pins PTD6 and PTD7 pins, not PTA14.

~Mark

 

0 项奖励
回复
673 次查看
soli
Contributor I

Thank you Mark. You point me to the right mistake.

 

0 项奖励
回复