SAM3S CRCCU

Discussion around product based on ARM Cortex M3 core.
This forum will be discontinued soon.

Moderators: nferre, ncollot

Violao
Location: Leiria, Portugal
Posts: 2
Joined: Mon Nov 06, 2006 2:06 pm

SAM3S CRCCU

Tue Jul 24, 2012 8:00 pm

Is anyone using the CRCCU peripheral in SAM3S microcontroller family?
I found this peripheral to be very useful, since it gives me a way to perform CRC calculations "on-the-fly" with minimal CPU intervention.
However, now that I am trying to use it, I am experiencing 2 issues:
1 - I was expecting to use DMA interrupts to signal the end of a transfer (hence, the end of the CRC calculation); I cannot seem to make the interrupts work, despite having configured CRCCU interrupt in NVIC and enabled both DMA interrupt in CRCCU_DMA_IER and set IEN flag in TR_CTRL.

2 - Forgetting the use of interrupts (polling CRCCU_DMA_SR), reading CRCCU_SR yields a different value than expected (test case for CCIT16 polynom), when compared to software calculation.

Does anyone had a previous experience with CRCCU module?
Do you find it to work well?
aethaniel
Posts: 20
Joined: Tue Feb 05, 2008 11:46 am

Re: SAM3S CRCCU

Thu Aug 16, 2012 10:32 pm

did you try the crccu example from ASF?

it seems to check the DMA IT, even if it does polling...
Violao
Location: Leiria, Portugal
Posts: 2
Joined: Mon Nov 06, 2006 2:06 pm

Re: SAM3S CRCCU

Fri Aug 17, 2012 1:09 am

yes, I have checked the ASF CRCCU example, but it doesn't make use of the DMA interrupt.
Polling the DMA status register, as in Atmel's example, works for me as well, but I wanted to raise an interrupt at the end of the calculation, instead of doing a busy loop while polling.
tomwbarclay
Posts: 8
Joined: Mon Oct 29, 2012 7:31 pm

Re: SAM3S CRCCU

Tue Jan 08, 2013 6:51 pm

Hi, I am using a SAM4S chip but it has the same CRCCU module as the SAM3.

I use it in a polling loop as per the example from ASF3.5.1 for SAM4XPlain board.

I have a similar problem in that calculating CCITT16 CRC for the same 10 bytes of memory space, with unchanged content yields a different CRC each time I run the 'compute_crc' method.

I have inspected the memory in the debugger to check this.

Anyone else with same problem .. solution.

It smells like an initialization problem, but the 'compute_crc' method starts with a call to 'crccu_reset()' in the ASF driver.

Any ideas welcome.
tomwbarclay
Posts: 8
Joined: Mon Oct 29, 2012 7:31 pm

Re: SAM3S CRCCU

Tue Jan 08, 2013 7:10 pm

Oops, found the answer.

I have placed the 'crc_desc' variable inside the 'crc_compute' function.

When I follow the SAM4XPLAIN example it places 'crc_desc' in heap as follows

__attribute__ ((aligned(512))) crccu_dscr_type_t crc_dscr;

the crc subsytem behaves properly. Clearly the alignment with a 512 byte boundary is important, though I don't quite see why as yet.

Hope someone finds this useful.
CptTitanic
Posts: 877
Joined: Sat Oct 30, 2010 6:04 pm

Re: SAM3S CRCCU

Wed Jan 09, 2013 3:21 am

tomwbarclay wrote:Clearly the alignment with a 512 byte boundary is important, though I don't quite see why as yet.
In the SAM4S manual it specifies a 512 byte alignment for the descriptor pointer stored in CRCCU_DSCR, with the register definition indicating the low order 9-bits are not latched, or ignored.
MikeMyhre
Posts: 34
Joined: Sun Jun 30, 2013 7:08 pm

Re: SAM3S CRCCU

Wed Sep 13, 2017 3:55 pm

tomwbarclay wrote:Oops, found the answer.

I have placed the 'crc_desc' variable inside the 'crc_compute' function.

When I follow the SAM4XPLAIN example it places 'crc_desc' in heap as follows

__attribute__ ((aligned(512))) crccu_dscr_type_t crc_dscr;

the crc subsytem behaves properly. Clearly the alignment with a 512 byte boundary is important, though I don't quite see why as yet.

Hope someone finds this useful.
Thanks for posting the answer. It saved me a lot of time and solved my problem!

Return to “SAM3 Cortex-M3 MCU”

Who is online

Users browsing this forum: No registered users and 0 guests