No data on bus using mmap on ARM9 board - Embedded

This is a discussion on No data on bus using mmap on ARM9 board - Embedded ; 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: No data on bus using mmap on ARM9 board

  1. No data on bus using mmap on ARM9 board

    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;
    }



  2. Re: No data on bus using mmap on ARM9 board

    fwang11@pub3.fz.fj.cn wrote:

    > 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


+ Reply to Thread