Hello,
currently I have some behavior on my DM814x that I really don't understand. To put it short: "old" data that has been in a buffer before an edma transfer into this buffer reappears and destroys current data. This happens only with release builds and only if caching is enabled.
This is what I do:
// Initialisation of buffer (U_FIFO_SIZE==4096) :
g_au32FPGAData = (uint32_t*) Memory_alloc( NULL, sizeof( uint32_t ) * U_FIFO_BUFFER_SIZE,
EDMA3_CACHE_LINE_SIZE_IN_BYTES,
rEH.GetErrorBlockPtr());
rEH.SysRaise( CPTErrorHandler::DEC_MALLOC_FAILED, 0, "Memory_alloc failed", 0);
// Usage of the buffer:
// Only for debugging: fill the buffer with easy to recognize data.
// Make sure the 0xBD are written to the buffer and caches are invalidated
memset( g_au32FPGAData, 0xBD, U_FIFO_BUFFER_SIZE * sizeof(uint32_t) );
Cache_wbInvAll();
// get a big part of the fifo in one go
edmaTransfer( (UInt32*) (PCIMEM_BASE + UI_FIFODATA),
(UInt32*) &g_au32FPGAData[0],
u32ToRead );
The data in the buffer consists of short message frames. All frames have to start with a magic start-of-frame value. Usually right after the first transfer (about 3000 uint32_ts / floats) the check for the start of frame of a message fails. When I look at the data in the memory browser, I see this:
Hmm, I hope one can read this...
So, somewhere, usually in about the same place there appears 0xBD. It appears there instead of the valid frames data. Everything else in the buffer is correct. The large amount of 0xBD at the end of the buffer has not been overwritten.
I recognized this behavior only after I started to transfer data from my fifo in "large" (~4K floats) chunks instead of small ones (~ one message per transfer). When I disable caching or do a release build or have a look at the buffer in CCS's Memory Browser /before/ the frames are evaluated, I don't get the error.
Just for completeness I'll attach the code for edma setup and the edmaTransfer.
I really hope you can help...
TIA
Markus
