Hi Daniele, Sebastien,

Daniele Ziglioli wrote:
Sebastien Baldacchino ha scritto:
I am new with uclinux. I would like to read and write in a peripheral that I have put in uclinux. I use the kernel 2.4.

I have seen on internet that uclinux has no MMU. So I think to I can write and read directly to the physical address of my peripheral.

Is it possible to use this code to read and write directly to the physical address of my register?

char *ptr = (char *)0x30000000;
*ptr=0x01;

Is there a tutorial or anything else to write in a peripheral user?

yes you can, but it's a good practice to use volatile keyword to avoid compiler optimization issue
when access to hw registers.

Example:
#define CS1_BASE                (0x41000000)
#define CPGA_LCD_D_W         *((volatile unsigned char *)(CS1_BASE+0x100))

Some uClinux platforms by default will trap on this sort of thing.
For example many of the ColdFire CPU's can trap on accesses to certain
address regions when running in user mode. Typically it can be disabled
though.

Regards
Greg



------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     [EMAIL PROTECTED]
Secure Computing Corporation                PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to