Page 1 of 1

Pi 2 - Servoblaster, Pi-Blaster etc.

Posted: Fri Feb 13, 2015 4:30 pm
by madmaxno1
Hi All, So I'm anxious to get this working, basically I'm running some code to track an image and generate appropriate PWM outputs on the PI B+ and would like to upgrade to a RPi 2, however I'm aware that there are some issues with the new board with regards to this (I've seen the previous posts), I just wondered if anyone had succeeded in making either Pi-Blaster or Servoblaster work yet and how they did it (as some of the technical stuff on the posts is beyond confusing).
Cheers

Re: Pi 2 - Servoblaster, Pi-Blaster etc.

Posted: Fri Feb 13, 2015 4:36 pm
by mikerr
Remember the pi has 2 hardware PWM pins,
which work fine on the Pi 2.

It's only servoblaster and software PWM for > 2 servos that is currently broken on pi2 (but is being worked on)

Re: Pi 2 - Servoblaster, Pi-Blaster etc.

Posted: Fri Feb 13, 2015 4:44 pm
by madmaxno1
Thanks, I know it was being discussed but seemed to have gone dead over the last few days, I ideally need to have more than two pwm channels but cheers for the suggestion.

Re: Pi 2 - Servoblaster, Pi-Blaster etc.

Posted: Fri Feb 13, 2015 4:46 pm
by joan
The latest version (V28) of my pigpio library works on my Pi 2. It is much slower to initialise (about 10 seconds) than on earlier Pi models (<1 second). That may be sorted eventually.

Edited to add V29 superseded V28 and initialises in < 1 second.

Re: Pi 2 - Servoblaster, Pi-Blaster etc.

Posted: Mon Feb 16, 2015 4:59 pm
by Jonny_A
Dear Joan,
I also use Servoblaster for my current project, do you have any hints what has to be changed besides the base adress to get it running on the pi 2?
I had a look at your library and it looks quite good and flexible, if I can't find a solution, I might change to using this. However it would be quite some work to port the program...

Re: Pi 2 - Servoblaster, Pi-Blaster etc.

Posted: Mon Feb 16, 2015 8:29 pm
by joan
Jonny_A wrote:Dear Joan,
I also use Servoblaster for my current project, do you have any hints what has to be changed besides the base adress to get it running on the pi 2?
I had a look at your library and it looks quite good and flexible, if I can't find a solution, I might change to using this. However it would be quite some work to port the program...
1. The peripheral base address from 0x20000000 to 0x3F000000
2. The bus offset from 0x40000000 to 0xC0000000
3. Removing the bus offset addition to the mmap call

Those are the changes I (think I) made in the servod.c code earlier in the thread.

In addition you need to find some way to ensure that the initialised DMA control blocks are flushed through the caches to actually end up in physical memory. I do that by repeatedly allocating large memory chunks, initialising them with any old values (to make sure the memory is actually allocated) and then freeing the allocated memory. In pigpio this allocation, set, free loop is repeated for something like 10 milliseconds during initialisation.

Re: Pi 2 - Servoblaster, Pi-Blaster etc.

Posted: Mon Feb 16, 2015 9:57 pm
by Jonny_A
Dear Joan,
thanks a lot for your fast and kind feedback!
I tried the code that you posted earlier and the Pi2 now stops freezing down, but still nothing moves (no PWM on the GPIOs).
I never did so HW near programming, so that I can not adopt your proposal to ensure that the initialised DMA control blocks end up in physical memory. But I will look at that again in 1-2 weeks when I have more time. Maybe I'm lucky and someone else figures out how it works before. And many thanks for your extensive work in your library, it looks like a very good and licence free alternative!

Re: Pi 2 - Servoblaster, Pi-Blaster etc.

Posted: Thu Feb 19, 2015 11:05 pm
by rgh
There is a version of ServoBlaster for testing on this thread:

http://www.raspberrypi.org/forums/viewt ... 5&start=25

Reported working by a couple of people.


Richard

Re: Pi 2 - Servoblaster, Pi-Blaster etc.

Posted: Sat Feb 21, 2015 11:35 am
by Jonny_A
Thanks a lot, it works : - ))!!