I'm trying to transfer blocks of data (stored in C arrays of type static unsigned short, 16-bit) between memory and eUSCI using DMA on FR5xxx. I keep getting incorrect result. A debug run in Code Composer Studio shows that, the consecutive elements in arrays are stored in +2 memory locations, for example, array[0] is at 0x001CCC2, while array[1] is at 0x001CCC4 instead of 0x001CCC3, and so on... But according to the device user guide, in "block transfer" DMA moves data in +1 memory address. So I believe this is the problem. (However if I'm wrong, please correct me.)
So, what's the solution?
First it seems that DMA can't increment address by +2 in block transfer, so I need to arrange data in consecutive memory locations.
Does the way the array is stored have anything to do with compiler optimization setting? For example, if I increase compiler optimization setting, will the array elements be put consecutively in memory? (Both array "unsigned short" and memory are 16-bit, so it's possible?)
Or, should I change the array type to "static constant" or "unsigned 8-bit" or something else? (The actual data being transferred is only 8 bit)
Or, should I just write the data to a specified address in assembly line... However what's the correct format of specifying the starting address in assembly line? I can't find examples or specifications. For example if the starting address is 0x01CCC0, is the format .ALIGN 0x01CCC0 followed by the data sequence? And if I do this, is there any way to prevent C compiler from overwriting the data?
Thanks.