Hi,
I search a small example for SPI Master and DMA transfer.
So that I can receive e.g. 15 bytes with DMA and get a transfer end interrupt/callback when it is finished.
Thanks in advanced !
Hello roywI couldn't find the implementation of SPI with DMA as of now, but you might want to check out the following thread which mentions a comparison between DMAC and DTC: https://renesasrulz.com/mcu-mpu/ra/f/forum/19850/ra-dmac-and-dtcIf that seems like DTC can be relevant to your application, please check out the following thread and example:https://renesasrulz.com/mcu-mpu/ra/f/forum/19608/spi-dtc (For stack configuration)RA4M1 SPI using DTC Example Kindly let me know if that's helpful or not, in the meantime I'll keep looking for more relevant resources.-JayeshIf this response, or one provided by another user, answers your question, please verify the answer. Thank you!RenesasRulz Forum Moderatorhttps://renesasrulz.com/https://academy.renesas.com/https://en-support.renesas.com/knowledgeBase/
Thank you ,
I think DMA is for me the better solution, because I need a very fast firmware. The ADC convert the signals periodly and than I have only some µs for reading and calculating values.
I will try it with DTC, but DMA is my favorite ...
I'm still looking for more relevant resources but I just found an implementation of UART with DMAC on RA4M1 attached as a zip in the following thread. Again, not exactly what you asked for but mentioning it here as it could serve as a reference for implementing DMAC with SPI.renesasrulz.com/.../dma-access-using-sci-uart-in-ra4m1-series-controllerHowever, the version of the FSP is quite outdated in the above example so please refer to the latest FSP manual along with the example.-JayeshIf this response, or one provided by another user, answers your question, please verify the answer. Thank you!RenesasRulz Forum Moderatorhttps://renesasrulz.com/https://academy.renesas.com/https://en-support.renesas.com/knowledgeBase/
Have you an example for SPI Master with DMA / DTC ?
FSP4.0 supports DTC and DMAC transfer interface in the driver
Add the r_spi driver to your project
Add the DMAC transfer driver to the stack:
Hello royw. As mentioned by Richard, the latest release of FSP added support for SPI with DMAC.
And if you are looking for SPI with DTC, the example code named "r_sci_spi" uses DTC by default. Please check that out here:
https://github.com/renesas/ra-fsp-examples/tree/master/example_projects/ek_ra4m1/sci_spi/sci_spi_ek_ra4m1_ep
-Jayesh
If this response, or one provided by another user, answers your question, please verify the answer. Thank you!Renesas Engineering Community Moderatorshttps://community.renesas.com/https://academy.renesas.com/en-support.renesas.com/.../
Now I use the 4.0 and there is DMAC supported. But I don't get a SPI DMA transmission to work. here my HAL_ENTRY :
void hal_entry(void){
unsigned char txByte[] = {0,1,2,3,4,5,6,7,8,9}; unsigned char rxByte[] = {0,1,2,3,4,5,6,7,8,9};
/* Initialize SPI driver */ g_spi_master.p_api->open (&g_spi_master_ctrl, &g_spi_master_cfg); /* Initialize SPI TX DMAC driver */ g_transferSPI0_tx_cfg.p_info->p_dest = (void*)&R_SPI0->SPDR ; g_transferSPI0_tx_cfg.p_info->p_src = (void*)&txByte ; g_transferSPI0_tx_cfg.p_info->length = 10; /* Initialize SPI RX DMAC driver */ g_transferSPI0_rx_cfg.p_info->p_dest = (void*)&rxByte ; g_transferSPI0_rx_cfg.p_info->p_src = (void*)&R_SPI0->SPDR ;
g_transferSPI0_tx.p_api->open(&g_transferSPI0_tx_ctrl , &g_transferSPI0_tx_cfg); g_transferSPI0_rx.p_api->open(&g_transferSPI0_rx_ctrl , &g_transferSPI0_rx_cfg);
g_transferSPI0_tx.p_api->enable(&g_transferSPI0_tx_ctrl); g_transferSPI0_tx.p_api->softwareStart(&g_transferSPI0_tx_ctrl,TRANSFER_START_MODE_SINGLE);
while(1) {
}
and here my settings :
I can't see a SPI transfer on the Pins on my board. How I start the transmission with DMAC for e.g. 10 bytes ?
What is wrong or missing ?
Thanks in advanced