Code Monkey home page Code Monkey logo

dma_memcpy's People

Contributors

jmagnuson avatar jpinspace avatar

Stargazers

 avatar

Watchers

 avatar

dma_memcpy's Issues

Possible race-condition

Mutual exclusion (i.e. sync_bool_compare_and_swap) should be used for reserving access to the DMA engine.

Support GCC

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.

Handle len > 1024

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.

Match memcpy interface more closely

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:

  • a callback argument should be a special use-case requiring a separate function definition
  • dma_memcpy should block by default, requiring another function definition that could not-block and pass a callback pointer

I.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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.