madmaxno1
Posts: 5
Joined: Fri May 17, 2013 4:13 pm

Pi 2 - Servoblaster, Pi-Blaster etc.

Fri Feb 13, 2015 4:30 pm

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

mikerr
Posts: 2770
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

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

Fri Feb 13, 2015 4:36 pm

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)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

madmaxno1
Posts: 5
Joined: Fri May 17, 2013 4:13 pm

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

Fri Feb 13, 2015 4:44 pm

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.

User avatar
joan
Posts: 14073
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

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

Fri Feb 13, 2015 4:46 pm

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.
Last edited by joan on Mon Feb 16, 2015 8:34 pm, edited 1 time in total.

Jonny_A
Posts: 6
Joined: Mon Feb 16, 2015 4:55 pm

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

Mon Feb 16, 2015 4:59 pm

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...

User avatar
joan
Posts: 14073
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

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

Mon Feb 16, 2015 8:29 pm

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.

Jonny_A
Posts: 6
Joined: Mon Feb 16, 2015 4:55 pm

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

Mon Feb 16, 2015 9:57 pm

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!

rgh
Posts: 211
Joined: Fri Nov 25, 2011 3:53 pm

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

Thu Feb 19, 2015 11:05 pm

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

Jonny_A
Posts: 6
Joined: Mon Feb 16, 2015 4:55 pm

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

Sat Feb 21, 2015 11:35 am

Thanks a lot, it works : - ))!!

Return to “Troubleshooting”