Endre
Newbie level 5
- Joined
- Jan 4, 2015
- Messages
- 10
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 85
Hi,
I have the following code which 1st makes an UART transmit with the polled driver function. This works, the message arrives to the terminal ("Welcome! (polled transmit)").
Then it attempts to transmit an other string ("Welcome! (DMA transmit)") with PDMA. Nothing happens, the function returns, but the message is not transmitted.
Here is the code:
What can be the problem?
I have the following code which 1st makes an UART transmit with the polled driver function. This works, the message arrives to the terminal ("Welcome! (polled transmit)").
Then it attempts to transmit an other string ("Welcome! (DMA transmit)") with PDMA. Nothing happens, the function returns, but the message is not transmitted.
Here is the code:
Code:
static inline void print(const char * msg) {
MSS_UART_polled_tx_string(&g_mss_uart0, (const uint8_t*)msg);
}
static void welcome() {
uint16_t len;
const char * welcomeDMA = "Welcome! (DMA transmit)\n";
MSS_UART_init(
&g_mss_uart0,
MSS_UART_460800_BAUD, /*MSS_UART_19200_BAUD,*/ /* MSS_UART_921600_BAUD, */
MSS_UART_DATA_8_BITS | MSS_UART_NO_PARITY | MSS_UART_ONE_STOP_BIT
);
print("Welcome! (polled transmit)\n");
for(len = 0; welcomeDMA[len]; len++);
/* g_mss_uart0.hw_reg.FCR = 8; */ /* ENABLE_TXRDY_RXRDY */ /* already done by init */
PDMA_init();
/* PDMA_set_priority_ratio(PDMA_ROUND_ROBIN); */
PDMA_set_priority_ratio(PDMA_RATIO_HIGH_LOW_1_TO_1);
PDMA_configure(
PDMA_CHANNEL_0,
PDMA_TO_UART_0,
PDMA_LOW_PRIORITY | PDMA_BYTE_TRANSFER | PDMA_INC_SRC_ONE_BYTE /* uint32_t channel_cfg */,
PDMA_DEFAULT_WRITE_ADJ
);
PDMA_start(
PDMA_CHANNEL_0,
(uint32_t)welcomeDMA,
PDMA_UART0_TX_REGISTER,
len
);
/* while (1); */ /* maybe FreeRTOS damages the DMA? */
}
What can be the problem?