No data on bus using mmap on ARM9 board

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
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)
        return -1;

    gpio_mem = (unsigned long int) mmap(NULL, 0x10000,
        PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd,  0x10000000);

    if (-1 == gpio_mem)
        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)
        pBuf[0] = 0xf0f0;


    return 0;

Re: No data on bus using mmap on ARM9 board

Quoted text here. Click to load it

Does it change if you are using a "volatile unsigned int *pBuf" here


Site Timeline