Page 1 of 1

STM32F103 Uart transmission complete callback problem

Posted: Sat Mar 20, 2021 11:37 am
by franek.bmw
Hello,

I am using Chibios 17.6.4 and STM32F103RBT6. I implemented Freemodbus library into my firmware. I have some problems with RS-485 driver enable signal. I set RS_485_DE signal just before calling uartStartSend() and clear this signal (RS_485_DE) in end of transmission callback. Everything works almost fine and the modbus communication works. Unfortunately, sometimes it happens that TC callback will not be called/fired. Then the RS-485_DE signal remains set so I can't receive anything. What could be the reason why callback TC is not called after using uartStartSend() and transmission is finished?

Thank you in advance for your help!
Franek

Re: STM32F103 Uart transmission complete callback problem

Posted: Sat Mar 20, 2021 12:18 pm
by Giovanni
Hi,

Hard to tell without info, are debug options enabled in chconf.h? you should also consider trying a recent version, 17.x is out of maintenance and missing a lot of fixes.

Giovanni

Re: STM32F103 Uart transmission complete callback problem

Posted: Sat Mar 20, 2021 4:12 pm
by franek.bmw
Hi,
Thank you for your quick reply.
I have all debug options enabled in chconf.h, is this wrong and could cause this issue?

Yes, I know that I use very old version of chibios. I will try to upgrade to newest one. But just for now I have to fix issue with TC callback first.

What other info I should provide to you about my project?

I also find one similar thread on this forum: viewtopic.php?t=2572
Is this possible that this could cause my issue with sometimes lost TC Callback?

Thank you a lot!

Franek

Re: STM32F103 Uart transmission complete callback problem

Posted: Sat Mar 20, 2021 6:06 pm
by Giovanni
Moving this topic in "bug reports" so I will check it. I don't remember if I committed that fix.

Giovanni

Re: STM32F103 Uart transmission complete callback problem

Posted: Sat Mar 20, 2021 6:07 pm
by Giovanni
Probably I cannot look at this immediately, could you check that patch in the meanwhile?

Debug options are fine, you should keep those ON during development.

Giovanni

Re: STM32F103 Uart transmission complete callback problem

Posted: Sat Mar 20, 2021 8:55 pm
by franek.bmw
Unfortunately this patch didn't help. Same issue still occurs. I have to add that this issue only occur when opt = 1 or higher. When opt = 0 then always work fine.

Franek