jmagnuson / dma_memcpy Goto Github PK
View Code? Open in Web Editor NEWAn ARM-based DMA memcpy
An ARM-based DMA memcpy
Mutual exclusion (i.e. sync_bool_compare_and_swap
) should be used for reserving access to the DMA engine.
The atomic functions used to broker DMA access were designed for compatibility with GCC's atomic builtins, but currently the library fails when attempting to build with anything other than TI's CCS compiler (where intrinsics being used, such as __ldrex
, et al. are only defined).
The most basic fix would be to prefix the atomic functions in arm_atomic.h
with __
to match GCC's, and then put a compiler-driven preprocessor switch around the header include inside dma_memcpy.c
.
Currently dma_memcpy
returns an error for buffer lengths greater than 1024 bytes. This is because of limitations in the TM4C uDMA peripheral.
A potential replacement for failure is to handle the buffer in 1024 byte chunks, either doing a simple loop and pointer increment in dma_memcpy
, or re-initializing each new transfer in the uDMAIntHandler
.
Currently the target architecture only has one SW DMA channel, so it would make more sense to move the channel defines into the library itself, allowing the API to look more like an actual memcpy
call.
Furthermore, to better match memcpy
:
dma_memcpy
should block by default, requiring another function definition that could not-block and pass a callback pointerI.e.:
dma_memcpy(uint32_t *dst, uint32_t *src, size_t len, uint32_t chan, void *cb);
would become something like:
dma_memcpy(uint32_t *dst, uint32_t *src, size_t len);
dma_memcpy_nowait(uint32_t *dst, uint32_t *src, size_t len, void *cb);
This may increase the complexity of the lib implementation (which might make it harder to port), but the simplification on the application side should outweigh those concerns.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.