Tool/software: Code Composer Studio
I use TMS570LS3137 ic. I want to use this chip sci communication with DMA as slave. The DMA source code is based on the link ( https://e2e.ti.com/support/microcontrollers/hercules/f/312/t/807027?tisearch=e2e-sitesearch&keymatch=tms570lc3137%2520sci%2520with%2520dma )
The system action
1. SCI communication action
- Rx(receive) always on and connected with Tx(transmit) line : So when the Tx data send, Rx data get.
- Tx(transmit) act is controlled by gpio. When bit is set, tx act.
2. Commucation setting(example)
- Sending data size : 20 bytes
- Preiod : 20ms
- After receiving the data, Chip send response same size data to master.
- Dma Test setting -
1. DMA setting receive and transmit - DMA_CH0 as Tx, DMA_CH1 as Rx (It follow the link source code)
2. Enable the interrupt (BTC) with halcogen, and Set Enable interrupt when receving. - dmaEnableInterrupt(DMA_CH1, BTC);
3. In the interrupt, there are two actions,
(1) Data correct - when the dma is started with sci communication start
1) dmadisable
2) DmaReset : dmaREG->GCTRL = 1U;
3) Resetting DMA Tx
4) SCI Tx on
5) somedelay
6) DMAenable
7) wait tx finish : while(dmaGetInterruptStatus(DMA_CH0, BTC) != TRUE);
8) dmaDisable
9) some delay - because communication is more slower than MCU
10) SCI Tx off
11) DmaReset : dmaREG->GCTRL = 1U;
12) Setting DMA Rx
13) DMA enable
(2) Data fail - when the dma is started while sci communication
1) DMAdisable
2) wait some delay
3) DMAReset : dmaREG->GCTRL = 1U; (Because i don't know where the dma point is located.)
4) Setting DMA Rx
5) DMAenable
Then, I just want to dma with No reset and Re setting. (In fail case, there is no way to act without DMA reset, but in tx action - I think it is possible action without DMA Reset)
I test sci act without DMA Reset in "Data correct" as followes
(1) Data correct - when the dma is started with sci communication start
1) dmadisable
2) SCI Rx DMA interrupt diasble
3) SCI Tx on
4) some delay
5) DMAenable
6) wait tx finish : while(dmaGetInterruptStatus(DMA_CH0, BTC) != TRUE);
7) dmaDisable
8) some delay - because communication is more slower than MCU
9) SCI Tx off
11) SCI Rx DMA interrupt diasble
12) DMA enable
Then, firmware is stopped in 5) - while(dmaGetInterruptStatus(DMA_CH0, BTC) != TRUE);
I think Rx dma is act when TX dma transmittion. Would you guide me how i can solve this problem?