Dear all,
I am using the GPMC bus to read data from an FPGA FIFO. I use async read of 16-bit data. In particular, when a fraction of a long-long FIFO is full, I send a signal (active high) to the ARM. This signal goes to a GPIO pin which is monitored by the ARM. When the ARM see that signal high, it starts a read cycle. In Fig.A, it is possible to see how it works: the yellow signal is the signal sent from the FPGA to the ARM to say that a fraction of the FIFO is full. After a while, the ARM starts a read cycle (which is the green line). The time-length of the read cycle is decided by me using:
if (gpio_get_value(gpio)) { memcpy(p,extbus,256); }
where:
-> gpio_get_value(gpio) is the function monitoring the GPIO state
-> memcpy(p,extbus,256) is the function coping the GPMC bus on a variable p and 256 is the length of the copy (which is fixed).
Normally it works and if a try to do several read cycles, I obtain something shown in Fig. A :
1) a fraction of the FIFO is filled (e.g. one third)
2) a signal is sent to the ARM to say that a fraction of the FIFO is filled (yellow goes high)
3) the ARM see that signal and starts to read
4) in the meanwhile, the signal coming from the FIFO (yellow) goes down because now the fraction of the FIFO filled is less than one third.
Sometimes happens something like FIG. B : the read cycle (which should be fixed: it is the number -256- written in the memcpy) randomly stops to work after a few reads (see the green path which stops after a few reads). Only after a while, it finishes the read cycle doing the remaining reads. Summarizing:
1) a fraction of the FIFO is filled (e.g. one third)
2) a signal is sent to the ARM to say that a fraction of the FIFO is filled
3) the ARM see that signal and starts to read
4) in the meanwhile, the signal coming from the FIFO goes down because now the fraction of the FIFO filled is less than one third
5) the ARM stops the read cycle for a while (for a reason that I do not understand)
6) in the meanwhile the FIFO is filled for one third again
6) the ARM starts again to read doing the remaining reads
If I try to sum the reads of the Fig. B I obtain 256, which means that it does the full read cycle.
Now, I know that there are better solution in terms of starting the read cycle (I could use a GPIO interrupt etc..etc) but this is not a problem for me. I would like to understand why it stops to read.
Possible question:
-> Are you sure that the FIFO is working correctly?
Yes: I did several tries to check it and it seems to work.
I thing it to be a problem coming from the ARM.
Do you have any ideas?
Thanks a lot.
Alberto
N.B : GPMC clock = 100 MHz