Is it possible to use all 6 UARTs on a K64 when using MQX and PEx?

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

Is it possible to use all 6 UARTs on a K64 when using MQX and PEx?

1,731 Views
johnmccollin
Contributor II

Hi,

I am using KDS 2.0.0 and KSDK_1.2.0 for a project using a custom board which has a MK64FN1M processor connected to 6 RS485 ports via UARTS 0-5.

I am using Processor expert and MQX because I need RTCS and MFS.

I am struggling to see how to use all 6 ports because MQX seems to require one to be defined for the debug console. I see it is possible to use semi-hosting for debugging to the KDS console but I still can't see how to prevent MQX requiring the UART.

Any advice would be very welcome!

0 Kudos
9 Replies

1,276 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello John,

Please try disable the UART pin of fsl_debug_console, and also disable the "Aout initialization" :

pastedImage_0.png

pastedImage_1.png

while here need select one UART ,and also configuration the Baud rate .

Then add the six UART.

Hope it helps


Have a great day,

Alice

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

0 Kudos

1,276 Views
johnmccollin
Contributor II

Hi Alice

Thanks very much for your reply.

I have tried your suggestion but I probably didn't explain the problem very well. I am still struggling because MQX has a UART associated with it which currently is set to use UART0. This is preventing me from adding the 6th UART to the project.

UART1.png

UART6.png

I wondered if I could use the uart1 component as it stands but I want to have control over the callback and interrupt settings. Unfortunately all of these settings are disabled, presumably because they have to be set in a certain way for MQX.

Any further thoughts?

Thanks again

John

0 Kudos

1,276 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello John.

On my side , it can select the 6 UART with no error , please see :

pastedImage_0.png

pastedImage_1.png

And I also use KSDK 1.2, while use KDS 3.0 , i recommend you use the latest version KDS 3.0 .

While i think in you KDS 2.0 , it also can work , have you do refer to i said before :

"Please try disable the UART pin of fsl_debug_console, and also disable the "Aout initialization" :" , maybe in KDS 2.0 , it is different from KDS 3.0 ,

please fund carefully.

Hope it helps

Alice

0 Kudos

1,276 Views
johnmccollin
Contributor II

Hi Alice,

Sorry, I am using KDS 3.0 and I have disabled both the UART pins of "fsl_debug_console" and disabled "Auto initialization".

Could you show me how you have set up the OS? I used the guide "How to add RTCS to a Processor Expert Project Using KDS and KSDK" to set up the project initially. It tells you to disable DbgCs1 and configure the "inherited component" debug console.

OS1.png

Thanks again

John

0 Kudos

1,276 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello  John,

There is seem some difference between us, the attachment is my test project , you can check, and please also send your simple

project only with  the UART and MQX to me , i will check it .

pastedImage_0.png

Oh, the project is too large, it can not attach , if you want , please tell me our email, i will send it to you .

BR

Alice

0 Kudos

1,276 Views
johnmccollin
Contributor II

Hi Alice

My email address is john.mccollin@a-s.co.uk

I have just created a new project from scratch which still has the same problem so I will send it to you when I get your email.

Thanks

John

0 Kudos

1,276 Views
marek_neuzil
NXP Employee
NXP Employee

Hello John,

I see that you are using "MQX standard" version of the MQX (Alice use the MQX Lite version).

If you needn't the "MQX standard" version of the MQX you can switch to MQX Lite and you can use the 6th UART for your application according to Alice's instructions.

To switch the MQX version, use the Configuration set property in the mqx_ksdk component, see below:

pastedImage_2.png

Note: When you disable fsl_debug_console you cannot use the PRINTF() function.

Best Regards,

Marek Neuzil

0 Kudos

1,276 Views
johnmccollin
Contributor II

Hi Marek and Alice

I have eventually managed to get my 6th UART to work.

I have let MQX define the UART but I have made sure I am not using it i.e. I'm not calling any functions like printf which talk to STDOUT. Obviously I don't have a debug console but I'm not too worried about that.

After the PEX_components_init() I added calls to set up the UART in the way I wanted. (see below)

#ifdef MainTask_PEX_RTOS_COMPONENTS_INIT

PEX_components_init();

#endif

NVIC_SetPriority(UART0_RX_TX_IRQn, 7U);

OSA_InstallIntHandler(UART0_RX_TX_IRQn, uart1_IRQHandler);

UART_DRV_Init(FSL_UART1,&uart1_State,&uart1_InitConfig0);

UART_DRV_InstallRxCallback(FSL_UART1, uart1_RxCallback, NULL, NULL, true);

UART_DRV_InstallTxCallback(FSL_UART1, uart1_TxCallback, NULL, NULL);

I also added the uart1_IRQHandler and the 2 callbacks and everything seems to work fine.

Anyway, thanks again for your help.

John

0 Kudos

1,276 Views
johnmccollin
Contributor II

Hi Marek

Unfortunately the project I am trying to build also needs RTCS and MFS so I believe I need the standard version of MQX.

Best regards

John

0 Kudos