Go to advanced search

by tonygrim
Tue Jul 02, 2013 10:58 pm
Forum: Advanced users
Topic: [SOLVED]GPIO issues
Replies: 4
Views: 1003

Re: [SOLVED]GPIO issues

Yep, that got it going - thanks!! :) It's odd that it worked under the older OS. All I've effectively done is change the type of the gpio_map pointer returned by mmap from char* to volatile uint32* (previously this was done after the fact via a cast: gpio = (volatile unsigned long *) gpio_map). Tony
by tonygrim
Tue Jul 02, 2013 9:04 pm
Forum: Advanced users
Topic: [SOLVED]GPIO issues
Replies: 4
Views: 1003

Re: GPIO issues

Does another process on your system access the GPIO memory? I note you don't have MAP_SHARED. specified as it is here: http://elinux.org/RPi_Low-level_peripherals#GPIO_Code_examples EAGAIN The file to be mapped is already locked using advisory or mandatory record locking. See fcntl(2). Is there ano...
by tonygrim
Tue Jul 02, 2013 5:53 am
Forum: Advanced users
Topic: [SOLVED]GPIO issues
Replies: 4
Views: 1003

[SOLVED]GPIO issues

I'm running 3.6.11+ #474 (soft float) and I've written a c++ app (in Qt4.8.2) that listens for signals on one or more GPIO pins. My app was working just fine until I upgraded to the current release, but now it can't map the GPIO locations. The code (somewhat abridged, but you get the idea): #define ...
by tonygrim
Wed Jun 26, 2013 6:00 am
Forum: General discussion
Topic: /dev/mem again ...
Replies: 4
Views: 617

Re: /dev/mem again ...

Ok, some progress - i *can* access /dev/mem; it's the following invocation of mmap that's failing - with error code 11 (EAGAIN - The file has been locked, or too much memory has been locked). Investigations continue ... :geek:
by tonygrim
Wed Jun 26, 2013 5:13 am
Forum: General discussion
Topic: /dev/mem again ...
Replies: 4
Views: 617

Re: /dev/mem again ...

joan wrote:Seems to work fine on 3.6.11+ #474 on soft float. Haven't tried on hard float, don't see why it should be different.
Hmm. Built my app under this OS release but got the same result. Using Qt4, by the way.

Tony
by tonygrim
Tue Jun 25, 2013 12:59 am
Forum: General discussion
Topic: /dev/mem again ...
Replies: 4
Views: 617

/dev/mem again ...

I wrote a program that accesses /dev/mem in order to manipulate GPIOs and it works fine with release 3.2.27+ OS, but the same code compiled under 3.6.11+ fails to open /dev/mem, even though I'm running as root (chmod 4755). if((mem_fd = open("/dev/mem", O_RDWR | O_SYNC)) < 0) return false; etc. Anyo...

Go to advanced search