Hello
My Raspberry Pi is equipped with Debian 6 (dated 2012-04-19). I'm working on a program that controls an expansion board connected to the GPIO connector. The board is wired to the I2C bus. My program accesses /dev/mem to control to BCM2835 I2C part.
My concern now is that my program is built as an armv6l/armel executable and it runs on other computers as well (including the BeagleBoard) but it needs the BCM2835 specifically so this means trouble when not run on a Raspberry Pi. So I'm looking for a way to detect whether my program is running on a Raspberry or not. Any ideas?
Thanks
Detecting the Raspberry Pi
4 posts
- Posts: 10
- Joined: Wed Jun 27, 2012 12:12 am
Gimme just a min..
- Posts: 393
- Joined: Mon Jun 04, 2012 9:06 pm
- Location: Berkshire
grep -i "Hardware" /proc/cpuinfo | sort
or
cat /proc/fb
or cat /proc/iomem and crosscheck the gpio memory map?
please be advised that it shows as a BCM2708 on my pi :/
or
cat /proc/fb
or cat /proc/iomem and crosscheck the gpio memory map?
please be advised that it shows as a BCM2708 on my pi :/
- Posts: 393
- Joined: Mon Jun 04, 2012 9:06 pm
- Location: Berkshire
Thanks.
I'm going to extract the "Hardware" line from /proc/cpuinfo in my program as it states the hardware family name "BCM2708". This line is also present on the BeagleBoard ("OMAP3 Beagle Board"). It's doesn't show up on my x86-based Linux systems though.
A related question: what's the character encoding of the text returned by /proc/cpuinfo and other procfs files? UTF-8?
I'm going to extract the "Hardware" line from /proc/cpuinfo in my program as it states the hardware family name "BCM2708". This line is also present on the BeagleBoard ("OMAP3 Beagle Board"). It's doesn't show up on my x86-based Linux systems though.
A related question: what's the character encoding of the text returned by /proc/cpuinfo and other procfs files? UTF-8?
- Posts: 10
- Joined: Wed Jun 27, 2012 12:12 am