bcm2835_peri_write

39 views
Skip to first unread message

Wolfram Köhn

unread,
Mar 12, 2024, 12:21:55 PM3/12/24
to bcm2835
I use bcm2835_gpio_write to generate Pulses for a stepper motor. This function calls  bcm2835_peri_write containing two __sync_synchronize() calls.

This works fine for most of the time but sometimes a pulse is missing. To eliminate this I had to remove the two  __sync_synchronize() calls. It is still working fine just without drops.

Can this be a solution for others who have the same problem ?

Cheers Wolfram

Mike McCauley

unread,
Mar 13, 2024, 7:24:47 PM3/13/24
to bcm2835, Wolfram Köhn
Hello,

The informationwe have is that the __sync_synchronize() are important for
ensuring that the peripheral memory transfers happen correctly. I suspect what
you are seeing is interaction between the __sync_synchronize and the linux
scheduler.

I think its fair to say that it is risky to try to do real-time control like
steppers with non-real-time linux. Have you taken steps to lock the process to
prevent scheduling/swapping?

Cheers.
--
Mike McCauley VK4AMM mi...@airspayce.com
Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia
http://www.airspayce.com 5R3MRFM2+X6
Phone +61 7 5598-7474



Reply all
Reply to author
Forward
0 new messages