When is UART Tx done after calling wiced_hal_puart_synchronous_write()?

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

cross mob
JeHu_3414236
Level 5
Level 5
10 likes received First like received

I am using 20719 and I want to go to PDS after UART Tx is done after I call wiced_hal_puart_synchronous_write().  In the sleep handler, I always allow PDS when I get the event WICED_SLEEP_POLL_SLEEP_PERMISSION.  However, it seems the UART Tx is not finished when I get this event and UART Tx will stop in PDS.  How do I check UART Tx is really finished so I can go to PDS?  If I call wiced_rtos_delay_milliseconds(50, KEEP_THREAD_ACTIVE) after wiced_hal_puart_synchronous_write(), the UART Tx will finish before PDS but I don't want to put in a busy wait.

0 Likes
1 Solution
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi,

There is no API to know whether UART Tx done or not.

Also PUART will be off during PDS.

So you have to write the application logic in such a way that , before doing any PUART write, it should not be in any sleep mode.

You may send a acknowledge from the peer device after receiving the PUART tx data from our side and upon receiving the ACK, put the 20719 in PDS again. Can you try some logic like that?

Thanks,
Anjana

View solution in original post

2 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi,

There is no API to know whether UART Tx done or not.

Also PUART will be off during PDS.

So you have to write the application logic in such a way that , before doing any PUART write, it should not be in any sleep mode.

You may send a acknowledge from the peer device after receiving the PUART tx data from our side and upon receiving the ACK, put the 20719 in PDS again. Can you try some logic like that?

Thanks,
Anjana

I will try something on the application level. Thanks.

0 Likes