// Configure DMA channel 0. Settings:
dmaConfig0.SRCADDRH = ((uint16)ram >> 8) & 0x00FF;
dmaConfig0.SRCADDRL = (uint16)ram & 0x00FF;
dmaConfig0.DESTADDRH = ((uint16)&X_FWDATA >> 8) & 0x00FF;
dmaConfig0.DESTADDRL = (uint16)&X_FWDATA & 0x00FF;
dmaConfig0.VLEN = DMA_VLEN_USE_LEN;
dmaConfig0.LENH = (DATA_AMOUNT >> 8) & 0x00FF;
dmaConfig0.LENL = DATA_AMOUNT & 0x00FF;
dmaConfig0.WORDSIZE = DMA_WORDSIZE_BYTE;
dmaConfig0.TMODE = DMA_TMODE_SINGLE;
dmaConfig0.TRIG = DMA_TRIG_FLASH;
dmaConfig0.SRCINC = DMA_SRCINC_1;
dmaConfig0.DESTINC = DMA_DESTINC_0;
dmaConfig0.IRQMASK = DMA_IRQMASK_DISABLE;
dmaConfig0.M8 = DMA_M8_USE_8_BITS;
dmaConfig0.PRIORITY = DMA_PRI_HIGH;
/*
* This is the part that is making the problem
*/
// DMA configuration
DMA0CFGH = ((uint16)&dmaConfig0 >> 8) & 0x00FF;
DMA0CFGL = (uint16)&dmaConfig0 & 0x00FF;