This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Method for putting EasyDMA buffer into Data RAM

I originally posted this question in the community forum, but I think now that it fits here better.  I won't repeat everything since you can see the details in the community forum link, but I'm getting an error that my rx buffer isn't in the Data RAM - which is fine, but how am I meant to get it in the right spot?  I've tried a variety of things (again see the link) but to no avail.  Is there an example of NRFX_SPIM transfer/receive that I can reference?  I don't see one.

Parents
  • How is the buffer defined? Unless prefixed with "const" or specifically directed to a section it will not be anywhere other than data RAM. Here are some examples where the buffers are in RAM:

    void someFunction1(blah)
    {
      uint8_t TxBuf[2] = {0x80|LIS2DH12_WHO_AM_I, 0x00};
      uint8_t RxBuf[2];
      blah blah
    }
    
    void someFunction2(blah)
    {
      static uint8_t TxBuf[2] = {0x80|LIS2DH12_WHO_AM_I, 0x00};
      static uint8_t RxBuf[2];
      blah blah
    }
    
    static uint8_t TxBuf[2] = {0x80|LIS2DH12_WHO_AM_I, 0x00};
    static uint8_t RxBuf[2];
    void someFunction3(blah)
    {
      blah blah
    }
    

    These are examples where the buffers are in Flash, and will generate an error:

    const static uint8_t TxBuf[2] = {0x80|LIS2DH12_WHO_AM_I, 0x00};
    const static uint8_t RxBuf[2];
    void someFunction4(blah)
    {
      blah blah
    }
    
    void someFunction5(blah)
    {
      uint8_t const TxBuf[2] = {0x80|LIS2DH12_WHO_AM_I, 0x00};
      uint8_t const RxBuf[2];
      blah blah
    }

    Searching the .map file will give a named buffer's location; maybe post the code where the buffers are defined.

  • Thank you!  I wasn't even thinking that this could be referencing the tx buffer (which I had as const), I mistaken figured it was only referencing the rx buffer - although it is clear that DMA will have to access some memory to send data...  Thanks for clearing it up for me.

Reply Children
No Data
Related