ayu5h
Posts: 5
Joined: Sat Feb 06, 2016 4:16 pm

GPIO port Un-Mapping

Thu Jul 28, 2016 4:20 pm

Is there any way to un-map the GPIO ports of Raspberry Pi 2 B. I am trying to build a driver to control the GPIO pins using the GPIO registers. The GPIO ports are mapped to (from cat /proc/iomem) 3f200000-3f2000b3 : /soc/gpio@7e200000. Now I tried to create a new mapping from 3f000000-3f00003f, but I am not able to read/write into this address. Do I need to un-map the default GPIO port address and then use my custom ports or something else. Please help?
Thank you

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

Re: GPIO port Un-Mapping

Thu Jul 28, 2016 4:29 pm

You are doing something wrong. Many processes can map the same memory. The contents of /proc/iomem are irrelevant to your problem.

ayu5h
Posts: 5
Joined: Sat Feb 06, 2016 4:16 pm

Re: GPIO port Un-Mapping

Thu Jul 28, 2016 5:07 pm

Don't I need to disable the default GPIO port addresses before using my custom made address? I am trying to build a driver to control GPIO pins. I am referring this link http://www.codeproject.com/Articles/103 ... aspberryPi
and updated the PORT address to 3f000000. The module gets loaded without any problem but when I try to write some value into the port, I don't get any response. I have chose the address from 3f000000 to 3f00003f. Any leads will be appreciated.
Thank you.

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

Re: GPIO port Un-Mapping

Thu Jul 28, 2016 6:24 pm

Perhaps other things have changed in recent kernels. I did a kernel module some time ago, have a look for krydab.c in the search box and see if anything looks different.

Return to “C/C++”