Part Number: MSP432P401V
I am converting existing and generally-working UART RX code at 115200 to DMA because an occasional character is dropped. I disabled the currently-used EUSCI_A_UART_RECEIVE_INTERRUPT and wrote the following code to implement DMA. DMA_INT2_IRQHandler() is not being called. I'm also unsure of what code needs to be inside this interrupt handler to make sure DMA is re-enabled for the next character. Can anyone tell me what is wrong with this code? Thanks.
/* DMA Control Table */
#pragma data_alignment=1024
uint8_t controlTable[1024];
static void DMA_Enable( void )
{
/* Configuring DMA module */
MAP_DMA_enableModule();
MAP_DMA_setControlBase(controlTable);
/* Assigning Channel 3 to EUSCIA1RX*/
MAP_DMA_assignChannel(DMA_CH3_EUSCIA1RX);
/* Disabling channel attributes of alternate DMA channel which will not be used in the basic DMA mode */
// MAP_DMA_disableChannelAttribute(DMA_CH3_EUSCIA1RX, UDMA_ATTR_ALTSELECT | UDMA_ATTR_USEBURST | UDMA_ATTR_REQMASK);
/* Setting control parameters: 'UDMA_SIZE_8' and 'UDMA_SRC_INC_8' are selected coz UART TX/RX data buffer size limited to one character */
// primary channel
MAP_DMA_setChannelControl(DMA_CH3_EUSCIA1RX | UDMA_PRI_SELECT, UDMA_SIZE_8 | UDMA_SRC_INC_NONE | UDMA_DST_INC_8 | UDMA_ARB_1);
/* Setting channel transfers */
MAP_DMA_setChannelTransfer(DMA_CH3_EUSCIA1RX | UDMA_PRI_SELECT, UDMA_MODE_BASIC,
(void*) MAP_UART_getReceiveBufferAddressForDMA(UART_IN_USE_BASE), s_RxBuffer, 10);
/* Assigning interrupts */
MAP_DMA_assignInterrupt(DMA_INT2, 3);
MAP_Interrupt_setPriority( INT_DMA_INT2, 0x00 );
MAP_Interrupt_enableInterrupt(INT_DMA_INT2);
MAP_DMA_enableInterrupt(INT_DMA_INT2);
/* Enable DMA channel */
MAP_DMA_enableChannel(3);
}
void DMA_INT2_IRQHandler(void)
{
MAP_DMA_setChannelTransfer(UDMA_PRI_SELECT | DMA_CH3_EUSCIA1RX,
UDMA_MODE_BASIC,
(void*)MAP_UART_getReceiveBufferAddressForDMA(UART_IN_USE_BASE), s_RxBuffer,
10);
// Reenable the DMA Rx Transfer
MAP_DMA_enableChannel( 3 );
}