AnsweredAssumed Answered

Does anyone have MOVEM.L-based memcpy() libraries for MCF53xx?

Question asked by TomE on Dec 28, 2009
Latest reply on May 6, 2011 by TomE

I'm using the MCF5329.


I have posted previously about the limited speed of the supplied (with the gcc compiler) library memcpy() function on this hardware. The SDRAM bus at 240MHz has a bandwidth of 128MB/s, but with the supplied copy function I'm getting a maximum of 80MB/s, and usually less.


The Coldfire 3 User Manual (from Freescale's site) says in part:


   5.4.3 RAM Initialization

... There are various instructions to support
this function, including memory-to-memory

move instructions, or the MOVEM opcode.
The MOVEM instruction is optimized to

generate line-sized burst fetches on 0-modulo-
16 addresses, so this opcode generally

provides maximum performance.


So I should be using MOVEM.L-based library copies.


I could write my own, but it'd be better to get some debugged and optimised ones of these.



Does anyone have any good library copy routines for the Coldfire chips that use MOVEM.L instructions in the inner loops? I can't find any examples on Freescale's site.


Even better would be some that are set up to use the EDMA channels. It'd be good to start big copies running on the DMA and then get some other work done with the CPU.


Thanks for any pointers, URLs, code.