GPIO port access in MPC8323E-RDB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO port access in MPC8323E-RDB

436 Views
vadrevujyothi
Contributor I

Hi,

         I am using MPC8323E-RDB board for application development in Linux environment. On Ubuntu 8.10 PC I generated kernel image by suing LTIB with kernel version of 2.6.20. Now I want to blink LEDs (Present on the board and named D3,D4 & D5)  which are connected to PORT-D 16,17 & 18 pins. I tried to access pins by providing address of Port registers, but I am getting segmentation fault.

How can I access I/O Port registers? and What might be the base address if required?

I have seen IMMR address range 0xE0000000 - 0xEFFFFFFF . Is it the base address to access GPIO port pins?

Please respond as soon as possible.

Regards,

V JYOTHI.

0 Kudos
1 Reply

286 Views
bpe
NXP Employee
NXP Employee

If you are trying to access a peripheral by offset from IMMR
in Linux environment, segmentation fault is what you should expect.
Linux uses virtual memory, you must explicitly map the range you want to access
first. If you are accessing a peripheral from the
kernel mode, use ioremap():

http://man.cx/ioremap(9)

if you are working from userland, use mmap():

https://linux.die.net/man/2/mmap
http://stackoverflow.com/questions/9662193/how-to-access-kernel-space-from-user-spacein-linux


Have a great day,
Platon

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos