Page 1 of 1

cirular buffer & blackpill

Posted: Sun Dec 14, 2025 5:28 pm
by max.tisc
HELLO,
I'm trying to use the circular buffer component with the Blackpill board to intercept responses from a modem. This modem is currently simulated by a terminal program on the PC that connects to the USART1. I then send the captured data to the same software via serial software. The strange thing is that whether I try to use the string capture functions or the array capture functions, characters are added. Furthermore, with the string function, 9 characters are captured, not 10. Am I using the circular buffer component wrong?

Re: cirular buffer & blackpill

Posted: Sun Dec 14, 2025 6:24 pm
by LeighM
Hi,
If you use the RX interrupt, then you should only process one received character within the called macro, putting it into a circular buffer is the best approach. Then in your main macro use the circular buffer commands to determine when you have received a string and process it.
(You can't mix interrupts and string get functions)
Also note that strings are null terminated (i.e. 0), so any buffers that you use should be at least the size of the maximum string expected plus one (for the terminator).

There should be some examples of use on the Circular buffer component wiki

Re: cirular buffer & blackpill

Posted: Mon Dec 15, 2025 10:03 pm
by max.tisc
Hi,
The other day I tried the CircAT.fcfx code I found on the wiki, but I couldn't get it to work. I tried it today, and it works fine. Maybe it's a bug on my hardware.
Thanks