If you have downloaded the gertboard software package gertboard_sw_20120725.zip from the farnell site at http://www.element14.com/community/docs … rd-techdoc on your Raspberry Pi 2, you’ll find it doesn’t work right away.
When you run “make all” to build the library and example code, you’ll find the gb_common.o file created for the Raspberry Pi (the single-core ARM1176JZF-SARM CPU bcm2835) will not work with the Raspberry Pi 2 (which is a quad-core ARM Cortex-A7 bcm2836).
The hardware connections on the boards are the same; the problem is due to memory map differences between the 256/512Mb on the Pi vs. 1Gb memory on the Pi 2. Basically, the peripheral address map has moved.
The Gertboard examples are all written using hard coded peripheral addresses. So all your reads and writes using the addresses assumed by the gertboard library end up in the wilderness.
All the peripheral addresses are defined as an offset from BCM2708_PERI_BASE which is set to 0x20000000 in gb_common.c
Change that to ‘0x3F000000’ and it should all work again on the Pi 2.
What to do
1. edit gb_common.c , changing the constant definition for the base peripheral address location in line 39 from
#define BCM2708_PERI_BASE 0x20000000
#define BCM2708_PERI_BASE 0x3F000000
2. then re-build the complete package
3. And finally, run one of the test programs
And provided you’ve set the right jumpers on your gertboard and connected it up right, watch the LEDs blinking.