Hello everyone:
I want to receive 10 bytes by the serial port with the help of the DMA0 module, I attach the code and images of configuration.
The problem is when I send the 10 bytes continuos I don't receive anything, But when I send one byte by one it is ok. Is it correct the funcionality?
So I try to configurate other channel to do a echo, the other channel is CH1 (attached images of configuration). When I receive the 10 byte (one by one), active the transfer of the channel 1 to send data to the USART0->TXDAT, and it's work...
So the problem I guess it is only for the CHANNEL0 (that is for the receive data by DMA)
has someone an idea what it is the problem? because I tried some things but I didn't find the solution.
#include <stdio.h>
#include "board.h"
#include "peripherals.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "LPC845.h"
#include "fsl_debug_console.h"
/* TODO: insert other include files here. */
uint8_t dstAddr[1024];
uint8_t rx0_dma_done = 0;
uint8_t tx0_dma_done = 0;
/* TODO: insert other definitions and declarations here. */
void dma0_callbacks(struct _dma_handle *handle, void *param, bool transferDone, uint32_t tcds){
if(tcds == kDMA_IntA){
rx0_dma_done = 1;
}
}
void dma0_callbacks_ch1(struct _dma_handle *handle, void *param, bool transferDone, uint32_t tcds){
if(tcds == kDMA_IntA){
tx0_dma_done = 1;
}
}
/*
* @brief Application entry point.
*/
int main(void) {
/* Init board hardware. */
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();
#ifndef BOARD_INIT_DEBUG_CONSOLE_PERIPHERAL
/* Init FSL debug console. */
BOARD_InitDebugConsole();
#endif
PRINTF("Request RX USART0\n");
//DMA_StartTransfer(&DMA0_CH0_Handle);
DMA_StartTransfer(&DMA0_CH0_Handle);
/* Force the counter to be placed into memory. */
volatile static int i = 0 ;
/* Enter an infinite loop, just incrementing a counter. */
while(1) {
if(rx0_dma_done){
rx0_dma_done = 0;
DMA_StartTransfer(&DMA0_CH1_Handle);
}
if(tx0_dma_done){
tx0_dma_done = 0;
DMA_StartTransfer(&DMA0_CH0_Handle);
}
}
return 0 ;
}





Thanks!