Details:
We are using the SPI port in master mode with 16-bit words and DMA. I changed the .ctl_reg value in spi_adc_chip_info in stamp.c to 0x1e00 to configure it with CPOL=1, CPHA=1, LSB first. Everything else is in the default configuration.
When sending packets of 8 bytes (4 words) everything works fine. When sending packets of 20 bytes (10 words) or more, it sometimes drops the last word. The write() function return value indicates all the bytes were sent, but the logic analyzer shows that it sometimes drops the last word. This error seems to happen about 1 out of 10 times. I haven't tested packets between 8 and 20 bytes, those just happen to be the sizes of the packets I'm using. If I disable DMA, the problem goes away. Since the driver only uses DMA for 12+ byte packets, it appears there is a bug in the DMA transmission handling, possibly in the DMA completion interrupt handler.
This problem exists using using the SVN sources & toolchain or the R06R2 sources & toolchain.
|
Details:
We are using the SPI port in master mode with 16-bit words and DMA. I changed the .ctl_reg value in spi_adc_chip_info in stamp.c to 0x1e00 to configure it with CPOL=1, CPHA=1, LSB first. Everything else is in the default configuration.
When sending packets of 8 bytes (4 words) everything works fine. When sending packets of 20 bytes (10 words) or more, it sometimes drops the last word. The write() function return value indicates all the bytes were sent, but the logic analyzer shows that it sometimes drops the last word. This error seems to happen about 1 out of 10 times. I haven't tested packets between 8 and 20 bytes, those just happen to be the sizes of the packets I'm using. If I disable DMA, the problem goes away. Since the driver only uses DMA for 12+ byte packets, it appears there is a bug in the DMA transmission handling, possibly in the DMA completion interrupt handler.
This problem exists using using the SVN sources & toolchain or the R06R2 sources & toolchain.
|