嗨:
最近在使用CC1310做项目,目前还在调试硬件资源阶段,遇到了一些问题,帮忙看看。
void uatr_init(); // this function works well without uDMA
void dma_init(){
uint32_t status = PRCMPowerDomainStatus(PRCM_DOMAIN_PERIPH);
if(PRCM_DOMAIN_POWER_ON != status){
PRCMPowerDomainOn(PRCM_DOMAIN_PERIPH);
while(PRCM_DOMAIN_POWER_ON != PRCMPowerDomainStatus(PRCM_DOMAIN_PERIPH));
}
PRCMPeripheralRunEnable(PRCM_PERIPH_UDMA);
PRCMLoadSet();
while(!PRCMLoadGet());
uDMAEnable(UDMA0_BASE);
uDMAChannelEnable(UDMA0_BASE,UDMA_CHAN_UART0_TX);
uint8_t buffer[1024];
uDMAControlBaseSet(UDMA0_BASE,buffer); // I am a little puzzled by this function
uDMAChannelAttributeEnable(UDMA0_BASE,UDMA_CHAN_UART0_TX,
UDMA_ATTR_ALTSELECT|UDMA_ATTR_HIGH_PRIORITY);
uDMAChannelControlSet(UDMA0_BASE,UDMA_PRI_SELECT, UDMA_SIZE_8 |UDMA_SRC_INC_8| UDMA_ARB_8|UDMA_DST_INC_NONE );
// UARTDMAEnable(UART_BASE,UART_DMA_TX); // if i call this function ,the mcu will not run ,i donot know why
}
// use this function to transfer data
void set_dma_auto_transfer(const uint8_t *src,uint32_t len)
{
uDMAChannelTransferSet(UDMA0_BASE,UDMA_PRI_SELECT,
UDMA_MODE_BASIC, // on a resquest
(uint8_t *)src,
(uint32_t*)(UART_BASE + UART_O_DR),len);
uDMAChannelRequest(UDMA0_BASE,UDMA_CHAN_UART0_TX);
}
when I call this function ,it cannot transfer any data…..
there are some mistakes in my codes,but i still cannot findout where the mistakes are,can you halp me?
Alvin Chen:
http://dev.ti.com/tirex/content/simplelink_cc13x0_sdk_1_30_00_06/docs/tidrivers/doxygen/html/_u_d_m_a_c_c26_x_x_8h.html