MQX task hangs on Vybrid UART0_C4 register read

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

MQX task hangs on Vybrid UART0_C4 register read

Jump to solution
1,041 Views
gordonsmith
Contributor II

I am using MQX 4.0.2 on M4 core of Vybrid SOM with Linux running on A5 core.

I modified mqx/examples/hello to write to "ttya:".

In DS-5 debugger, when fopen( ttya:, default mode) call gets to _kuart_change_baudrate() and I step over C4 register read, nothing more happens. C4 read is:

    sci_ptr->C4 &= (~ UART_C4_BRFA_MASK);

I verified read problem by first running:

    uint8_t c4 = sci_ptr->C4;

sci_ptr value is 0x40047000, which looks right. I don't know what happened to the task, I'm new to MQX and DS-5.

Does anyone know what I can look at to troubleshoot this?

user_config.h

#define BSPCFG_ENABLE_TTYA       1

#define BSPCFG_ENABLE_ITTYA      0

hello.c

char const * const deviceSci0 = "ttya:";

hndSCI0 = fopen( deviceSci0, BSP_DEFAULT_IO_OPEN_MODE );

0 Kudos
Reply
1 Solution
851 Views
gordonsmith
Contributor II

The problem was Linux was starting uart0 clock regardless of device tree settings. I removed the clock start in arch/arm/mach-imx/clk-vf610.c and MQX could then use "ttya".

View solution in original post

0 Kudos
Reply
4 Replies
852 Views
gordonsmith
Contributor II

The problem was Linux was starting uart0 clock regardless of device tree settings. I removed the clock start in arch/arm/mach-imx/clk-vf610.c and MQX could then use "ttya".

0 Kudos
Reply
851 Views
DavidS
NXP Employee
NXP Employee

Hi Gordon,

Just FYI that there is MQX_4.1.1 and MQX_4.2.0 updates available which might have solution.

For your MQX_4.0.2 have you verified that the A5/Linux is not using the UART0 (I'm assuming it is running)?

I recall a post long ago that mentioned if both cores accessing same peripheral that bad things might happen.

Regards,

David

851 Views
gordonsmith
Contributor II

Other PTB10/11 devices such as DCU display are also not defined in Linux. The PTB10/11 IO MUX can be seen in the debugger to be configured for SCI0 TX/RX.

0 Kudos
Reply
851 Views
gordonsmith
Contributor II

MQX 4.1.1 is currently incompatible with the Linux we are using. I will double check that I have the 4.0.2 patches applied.

The Linux device tree does not have UART0 device defined and the running Linux OS does not create a UART0 device.

0 Kudos
Reply