CS-9302 External SDRAM and NOR Flash Access / Read-Write

Hi,

I have a board of olimex CS 9302 which has booted linux 2.6 on ep9302.

I try to develop some code to reach external 32MB SDRAM and 16MB Nor Flash.

But i could not reach those memory spaces using mmap and open functions as below:

fd = open(”/dev/mem”, O_RDWR );

if (fd == -1) {

fprintf(stderr ,”\n%s\n”, “Cannot open /dev/mem device!”);

return(errno);

}

sdrambase = (unsigned int*) mmap(0, getpagesize(), PROT_READ|PROT_WRITE, \

MAP_SHARED, fd, 0xF0000000 );

(0xF0000000 : Base adress of SDRAM.)

Even though , ı didnt take segmentation fault error, ı couldnt change the values with the line below:

*sdrambase=0x01;

I can read those adress inclusion as

printf(“%u”,*sdrambase); but that value is not 1.

How can ı wite and read data to the external SDRAM or NOR flash on cs 9302 board.

Do you have an idea or sample code.

Thank you for helps.

what about this question ? was that so silly ? I couldn’t find any thing about the usage of external memory on ep 9302. No sample no idea? is writing or reading from sdram difficult job ?

thnx.