izmit escort escort ankara adana escort

 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: SAM3S CRCCU
PostPosted: Tue Jul 24, 2012 8:00 pm 
Offline

Joined: Mon Nov 06, 2006 2:06 pm
Posts: 2
Location: Leiria, Portugal
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: SAM3S CRCCU
PostPosted: Thu Aug 16, 2012 10:32 pm 
Offline

Joined: Tue Feb 05, 2008 11:46 am
Posts: 20
did you try the crccu example from ASF?

it seems to check the DMA IT, even if it does polling...


Top
 Profile  
Reply with quote  
 Post subject: Re: SAM3S CRCCU
PostPosted: Fri Aug 17, 2012 1:09 am 
Offline

Joined: Mon Nov 06, 2006 2:06 pm
Posts: 2
Location: Leiria, Portugal
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: SAM3S CRCCU
PostPosted: Tue Jan 08, 2013 6:51 pm 
Offline

Joined: Mon Oct 29, 2012 7:31 pm
Posts: 8
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: SAM3S CRCCU
PostPosted: Tue Jan 08, 2013 7:10 pm 
Offline

Joined: Mon Oct 29, 2012 7:31 pm
Posts: 8
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: SAM3S CRCCU
PostPosted: Wed Jan 09, 2013 3:21 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 877
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: SAM3S CRCCU
PostPosted: Wed Sep 13, 2017 3:55 pm 
Offline

Joined: Sun Jun 30, 2013 7:08 pm
Posts: 34
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!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Baidu [Spider] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: