UART stops receiving after some time in half duplex but not in full duplex

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

cross mob
KePe_1376176
Level 1
Level 1

I have a custom board using the CY8C3666LTI-201 PSoC 3 device.  I have a UART that is configured as half duplex, 115200 bps, 8 bits, no parity, 1 stop bit, HW Tx enable, RX interrupt on FIFO not empty, no addressing, and both Tx and Rx buffers left at 4 bytes.  The device is a slave on a Modbus RTU network.  The problem I'm seeing is that after a varying time and hundreds of thousands of exchanges between the master and slave, the UART will just flat out stop receiving. I have verified the UART control register and rx/tx status registers have the correct settings to be receiving and interrupting on RX FIFO not empty. I verified the interrupt vector is still correct. I verified the clock enable bit is still set for the UART. Every register has the correct settings to be receiving and it worked for hundreds and hundreds of thousands of messages (I'm intentionally hitting it hard to bring out the error as quick as possible while still in the bounds of the protocol) but for some reason at some point it just stops. Running out of things to try, I changed the UART to full duplex and it appears to have either removed the issue or prolonged the time before it comes back. I have no idea why this is but suspect it could be related to the sharing of status registers when i half duplex mode

0 Likes
1 Solution

Hi KePe_1376176,

I tried replicating your project with the settings that you have mentioned. I enabled a half-duplex UART which receives a character and sends the same character back. I then used a Tera Term script to continuously send a character to the device through UART. I was unable to reproduce the issue.

I have attached my project. Can you please try programming your device with this project and see if the issue persists? Please let me know if I need to change anything in my project to recreate your issue.

Also share a minimal version of your project so that I can reproduce the issue.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B

View solution in original post

0 Likes
3 Replies
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi kepe_1376176​,

Are you still facing the issue in half duplex mode?

If yes, please follow these steps -

1. When UART stops working, click on Debug tab and then Attach to running target.

2. Share a screenshot of the Call Stack window, so that we get to know at which point the program gets stuck

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes

Hello Rakshith,

The problem still exists in half duplex but it does appear that it is completely gone in full duplex. As for where the program is getting stuck, I had already tried what you suggested and my program is still executing everything in my main loop as well as other timer interrupts, etc. but just not the rx interrupt even though I confirmed via oscilloscope that the pins were receiving valid data

0 Likes

Hi KePe_1376176,

I tried replicating your project with the settings that you have mentioned. I enabled a half-duplex UART which receives a character and sends the same character back. I then used a Tera Term script to continuously send a character to the device through UART. I was unable to reproduce the issue.

I have attached my project. Can you please try programming your device with this project and see if the issue persists? Please let me know if I need to change anything in my project to recreate your issue.

Also share a minimal version of your project so that I can reproduce the issue.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes