CRC Driver with DMA problem

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

vrollei
Posts: 121
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 8 times

CRC Driver with DMA problem

Postby vrollei » Sat Jun 16, 2018 8:33 am

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
Vitaly

steved
Posts: 730
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 10 times
Been thanked: 105 times

Re: CRC Driver with DMA problem

Postby steved » Sat Jun 16, 2018 8:49 am

The DMA controller supports up to 64K items - i.e. 256K bytes if transferring 32-bit words. Could this be the limit?

User avatar
Giovanni
Site Admin
Posts: 13020
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 748 times
Been thanked: 621 times
Contact:

Re: CRC Driver with DMA problem

Postby Giovanni » Sat Jun 16, 2018 11:03 am

If this is the problem then the driver needs to split transfers in chunks.

Giovanni

vrollei
Posts: 121
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 8 times

Re: CRC Driver with DMA problem

Postby vrollei » Sun Jun 17, 2018 9:59 am

Steved, you are right.

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

User avatar
Giovanni
Site Admin
Posts: 13020
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 748 times
Been thanked: 621 times
Contact:

Re: CRC Driver with DMA problem

Postby Giovanni » Sun Jun 17, 2018 10:30 am

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

vrollei
Posts: 121
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 8 times

Re: CRC Driver with DMA problem

Postby vrollei » Sun Jun 17, 2018 10:53 am

There are some mistakes with defines as well, I will post changes here later.
Vitaly

vrollei
Posts: 121
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 8 times

Re: CRC Driver with DMA problem

Postby vrollei » Sun Jun 17, 2018 11:21 am

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

mobyfab
Posts: 451
Joined: Sat Nov 19, 2011 6:47 pm
Location: Versailles, France
Has thanked: 12 times
Been thanked: 17 times

Re: CRC Driver with DMA problem

Postby mobyfab » Mon Jun 18, 2018 9:58 am

hi,

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

Thanks!

vrollei
Posts: 121
Joined: Sun Nov 13, 2016 8:44 am
Been thanked: 8 times

Re: CRC Driver with DMA problem

Postby vrollei » Mon Jun 18, 2018 1:00 pm

Hi mobyfab,

done

#161 and #162
Vitaly


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 7 guests