cirular buffer & blackpill

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
max.tisc
Posts: 145
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 11 times

Flowcode v10 cirular buffer & blackpill

Post 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?
Attachments
CONTROLLO_STRINGA_STM32F411_FC10_.fcfx
(22.39 KiB) Downloaded 7 times
Screenshot 2025-12-14 182502.png
Screenshot 2025-12-14 182502.png (211.07 KiB) Viewed 52 times

LeighM
Valued Contributor
Posts: 522
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 89 times
Been thanked: 278 times

Re: cirular buffer & blackpill

Post 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

max.tisc
Posts: 145
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 11 times

Re: cirular buffer & blackpill

Post 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

Post Reply