2015-12-20 11:58 AM
Someone knows how to implement a circular buffer with HAL Drivers F1?
2015-12-20 01:54 PM
You can find several good implementations around on the web. Google knows about them.
There are no special requirements for using a ring buffer on a STM32 MCU. For example, you can considerhttps://github.com/cnoviello/mastering-stm32/tree/master/nucleo-f103RB/Middlewares/RingBuffer
even if I don't like it too much (it could be implemented in a faster way if it's ok to lose a bit of ''safeness''). Please, consider that this library works well only if you have just two ''threads'' operating on it. Otherwise, you have to add locking mechanisms.2015-12-21 03:44 AM
Check this ''thread'' safe implementation.
https://github.com/MaJerle/stm32fxxx_hal_libraries/blob/master/00-STM32_LIBRARIES/tm_stm32_buffer.hIf you don't use my libs, then just remove includes for libraries in this library://Remove these 2 lines:#include ''stm32fxxx_hal.h''#include ''defines.h''And you are ready to go.Lib supports memory allocation with malloc, or if you want, you specify it by yourself.Ask here for more info, if needed.2024-03-06 10:25 AM
Hi Carmine,
Thanks for your post.
One question for you and I would be very glad if you could answer. I am using STM32F407VG-DISC1 board.
I have checked the repo you ve provided. I wonder that, is that OK if I copy ringbuffer.c under core-->src and also ringbuffer.h under core -->inc.
Then, can I use ringbuffer functions with ease ?
2024-03-06 11:31 AM
You're responding to a very old post, I think several forum transitions ago, the OP might not respond.
I'd imagine you can use C rule to determine how best to integrate this into your build. Ring / Circular buffers being a pretty basic concept.
2024-03-06 11:38 AM
Thanks for the heads up.
I have already raised a question here, but no one responded yet, meanwhile I was looking for a solution then I noticed this thread.
As it is pretty basic, could you please check my issue in above link and also please point me to the right direction ?