How to use uart print in critical section?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Charlie9527
Level 2
Level 2
5 questions asked 10 sign-ins 5 replies posted

Hi guys,

I want to print out uart logs for debug in critical section;  but  I found that the uart output is abnormal, and the system hang.

    portENTER_CRITICAL();
    Ifx_print("test in cs\n");
    portEXIT_CRITICAL();

Now in the aurix code example, the uart print relies on the interrupt.

Does the uart print in TC39x can work well in critical seciton or interrupt disabled?

Do you have any method for uart print which not relis on the interrupt?

0 Likes
1 Solution
Nambi
Moderator
Moderator
Moderator
50 likes received 5 likes given 100 solutions authored

Hi,

I find APIs like Ifx_Console_print(), Ifx_Console_printAlign(), IfxStdIf_DPipe_print() as a part of the ILLD. You can check if any of these suit your need.

I do not see an API Ifx_print() as a part of ILLD. Could you let us know the driver and driver version in which the API Ifx_print() is defined?

Best Regards.

View solution in original post

0 Likes
4 Replies
Nambi
Moderator
Moderator
Moderator
50 likes received 5 likes given 100 solutions authored

Hi,

I find APIs like Ifx_Console_print(), Ifx_Console_printAlign(), IfxStdIf_DPipe_print() as a part of the ILLD. You can check if any of these suit your need.

I do not see an API Ifx_print() as a part of ILLD. Could you let us know the driver and driver version in which the API Ifx_print() is defined?

Best Regards.

0 Likes

Hi Nambi,

In Ifx_print,  the following function is used for uart output.

 

IfxStdIf_DPipe_write(&g_drv_asc_lin_uart.asc_sandard_interface, (void *)message, &count, TIME_INFINITE);

 

 

Best Regards.

0 Likes
Charlie9527
Level 2
Level 2
5 questions asked 10 sign-ins 5 replies posted

Can anyone help me for this question?

0 Likes
Nambi
Moderator
Moderator
Moderator
50 likes received 5 likes given 100 solutions authored

Hi,

Based on the available implementation using interrupts, you can adapt to an implementation based on polling.

Best Regards.

0 Likes