dear experts:
i sue S32K344 to config ADC with DMA, but error occurs after initialed.
the configuration is show below
i just config ADC2 with DMA using instance0 channel0 with scater mode
after initialed , when OS start first task, an error intterrupt occurs.
in this moment , i did not run any adc conversion task.
can any body give me some ways to investigate the issue ?
Hi,
settings in screenshots look correct. Maybe you can check scatter-gather configuration with respect of driver user manual, to have right number of SG elements and proper linking of those.
Anyway, DMA SBE error may happen in case source address points to memory range that is inaccessible - it means either access to reserved memory space or to disabled or un-clocked peripheral or protected by any kind of protection leading in bus error (MPU, XRDC).
BR, Petr
hi,PetrS,
thanks for your reply. I found sth that maybe useful for the issue. for the performance, i changed the ld file and put *(.mcal_bss_no_cacheable) into DTCM. so, the variables in dma_ip_pbcfg.c were placed into DTCM.
if i place them back to no_cacheable sram, the DMA can work correctly.
but i have changed the MPU setting , the AP of DTCM region is 011
and i did not found any description which the DMA can not access the DTCM
can you give me more advice?
Hi,
DMA can access DTCM via backdoor access, not through the core-coupled path. This access is slower and non-deterministic compared to core access. DMA uses the AHB slave interface to reach DTCM, which is part of the system bus architecture. See AN13388 chapter 4. Tightly Coupled Memory for more info; https://www.nxp.com/webapp/Download?colCode=AN13388&location=null
So question could be if it brings any benefit in your application and if rather keep DMA accessed data in normal SRAM.
BR, Petr
hi,PetrS:
thanks for your reply. i will try to change the mcl_memap.h and ld file to keep the variables used by DMA in sram.
but i really want to find out why the current code can not work correctly. the reuslt buffer used by Adc_SetupResultBuffer is in DMA, but i used the backdoor to access.
but the error of DMA is SBE not DBE
and the source address is determined by adc
is there any other method to solve this?
best regards!
Hi,
yes in case of result buffer access error the DBE should be set.
Here most probably the SBE error comes when DMA is reading new TCD if Scatter-Gather is used. If TCDs are put in DTCM as well, its SG Address should also use backdoor offset.
BR, Petr
Hi,
last tip...check TCD content at time of error, if there are expected values.
BR, Petr