| |
 |
|
|
Linux Forum Index » Linux Embedded » No data on bus using mmap on ARM9 board...
Page 1 of 1
|
| Author |
Message |
| fwang11 at (no spam) pub3.fz.fj.cn... |
Posted: Thu Sep 11, 2008 2:09 am |
|
|
|
Guest
|
Hi, there
I am using mmap on S3C2410 ARM9 board to write the data to SRAM, I can
get nGCS2 and WE pulse, but there is no data on data bus, the code is
listed below.
What could be the problem?
Thanks in advance.
int TestBus()
{
/*write data to an ADDR */
unsigned char chKey;
unsigned int *pBuf = NULL;
int mem_fd = 0;
unsigned int GPEDATA = 0;
unsigned int gpio_mem = 0;
printf("Bus Test\n");
mem_fd = open("/dev/mem", O_RDWR);
if ( 0 == mem_fd)
{
perror("open");
return -1;
}
gpio_mem = (unsigned long int) mmap(NULL, 0x10000,
PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd, 0x10000000);
if (-1 == gpio_mem)
{
perror("mmap");
close(mem_fd);
return -1;
}
pBuf = (unsigned int *)gpio_mem;
printf("Write 0xf0f0 to Bus Press q to exit");
pBuf[0] = 0xffffff;
while (1)
{
scanf("%c", &chKey);
if ('q' == chKey)
{
break;
}
pBuf[0] = 0xf0f0;
}
close(mem_fd);
return 0;
} |
|
|
| Back to top |
|
| Juergen Beisert... |
Posted: Sat Sep 13, 2008 1:49 pm |
|
|
|
Guest
|
fwang11 at (no spam) pub3.fz.fj.cn wrote:
Quote: Hi, there
I am using mmap on S3C2410 ARM9 board to write the data to SRAM, I can
get nGCS2 and WE pulse, but there is no data on data bus, the code is
listed below.
What could be the problem?
Thanks in advance.
int TestBus()
{
/*write data to an ADDR */
unsigned char chKey;
unsigned int *pBuf = NULL;
Does it change if you are using a "volatile unsigned int *pBuf" here
instead?
jbe |
|
|
| Back to top |
|
| |
|
Page 1 of 1
All times are GMT - 5 Hours
The time now is Fri Dec 05, 2008 3:48 am
|
|