Page 1 of 1

CRC Driver with DMA problem

Posted: Sat Jun 16, 2018 8:33 am
by vrollei
Hi,

there is a problem with CRC Driver (community) with CRC_USE_DMA=TRUE,
driver does not work correctly with buffer more 300k.
ChibiOS version - 17.6.3

Re: CRC Driver with DMA problem

Posted: Sat Jun 16, 2018 8:49 am
by steved
The DMA controller supports up to 64K items - i.e. 256K bytes if transferring 32-bit words. Could this be the limit?

Re: CRC Driver with DMA problem

Posted: Sat Jun 16, 2018 11:03 am
by Giovanni
If this is the problem then the driver needs to split transfers in chunks.

Giovanni

Re: CRC Driver with DMA problem

Posted: Sun Jun 17, 2018 9:59 am
by vrollei
Steved, you are right.

Giovani, yep, this is a problem, I check the firmware CRC and it could be up to 1M.

Re: CRC Driver with DMA problem

Posted: Sun Jun 17, 2018 10:30 am
by Giovanni
Hi,

There are other issues in that driver, for example crcCalcI() should be crcCalcS() because it calls an S-class inside (in the LLD). It also needs a SW fallback mode so other drivers can use it, right now we have several CRC SW implementation in various places, this is not good.

I will look into importing in in the main repository and make adjustments.

Giovanni

Re: CRC Driver with DMA problem

Posted: Sun Jun 17, 2018 10:53 am
by vrollei
There are some mistakes with defines as well, I will post changes here later.

Re: CRC Driver with DMA problem

Posted: Sun Jun 17, 2018 11:21 am
by vrollei
Sorry, there is no any define mistakes in CRC module, I mixed up it with QEI driver:

community/os/hal/include/hal_qei.h

Code: Select all

 */
 typedef enum {
   QEI_OVERFLOW_WRAP    = 0,     /**< Counter value will wrap around.        */
-#if QEI_USE_OVERFLOW_DISCARD == TRUE
+#if defined(QEI_USE_OVERFLOW_DISCARD) && QEI_USE_OVERFLOW_DISCARD == TRUE
   QEI_OVERFLOW_DISCARD = 1,     /**< Counter doesn't change.                */
 #endif
-#if QEI_USE_OVERFLOW_MINMAX == TRUE
+#if defined(QEI_USE_OVERFLOW_MINMAX) && QEI_USE_OVERFLOW_MINMAX == TRUE
   QEI_OVERFLOW_MINMAX  = 2,     /**< Counter will be updated upto min or max.*/
 #endif
 } qeioverflow_t;

Re: CRC Driver with DMA problem

Posted: Mon Jun 18, 2018 9:58 am
by mobyfab
hi,

Please open a ticket here: https://github.com/ChibiOS/ChibiOS-Contrib/issues
We'll have a look at the driver.

Thanks!

Re: CRC Driver with DMA problem

Posted: Mon Jun 18, 2018 1:00 pm
by vrollei
Hi mobyfab,

done

#161 and #162