HI :
experts,we want to use S32R45 and DDR3, could you help me where to find the example project or use case?
Hi WenChao,
NXP can give some initial support to you here but the most effective way of seeking S32R45 support is to contact your local NXP FAE or sales representative directly. S32R45 and other radar specific products are not actively supported on the NXP Community as we have a separate internal support ticket system for radar business.
For now I can share some files as an example usage of the FastDMA for DRAM <> SRAM transfers in the context of S32R45 Linux BSP and the RadarSDK. These files can be used to build a FastDMA kernel driver module that can be used from a Linux application software.
The FastDMA kernel module exposes the memory to user space. The module creates filesystem entry in /dev/rsdk_fdma. This can be used to access directly the fastDMA registers from an application.
The files attached to this message are licensed by NXP LA_OPT_EVAL_DEMO_ONLY license and by downloading and/or using the files you are agreeing to the license terms.
Best regards,
Gary
Hi Gary,
I'm trying to implement fastDMA into my S32R45 SDK(built by yocto). I met some problems followed your replay. I don't really understand 'the root of your RSDK install directory' & where to put patch file. I searched my SDK project, but did not found any dir similar to rsdk install directory. I also modified rsdk recipe with patch, but it didn't work as well.
Can you explain it detailedly? Thank you.
Best regards,
Binks
Hi Binks,
The RSDK is a separate software product from the Linux BSP, it contains drivers and example applications. Some of the drivers have kernel module components and to rebuild these one needs to have both the RSDK sources and Linux kernel sources available (kernel modules must be built using header files referenced in the sources for the exact kernel the modules will be used with).
So you need to acquire the RSDK for S32R45, it can be downloaded from your NXP Software Account in the same area as the Linux BSP - S32R45 Standard Software. When you download and install it the root directory "rsdk" is revealed, here is where you place the FastDMA kernel module source folder. Please read the RSDK release notes and user manual for instructions on how to build RSDK driver kernel modules, these same instructions also apply to FastDMA module since the makefile is composed in a similar way. For example you will supply the path to your Linux kernel sources on the command line when invoking the FastDMA makefile.
Don't confuse this with the Linux BSP Yocto RSDK recipe/layer, that is used to build the Linux kernel including customisations needed by Linux BSP. Once this is built the sources can be used to build kernel modules against, such as FastDMA and RSDK drivers.
Best regards,
Gary
Hello Brinton_H,
The maximum size of single FastDMA transfer is limited by the Transfer Record LINE_SIZE field which is 21 bits wide giving 2^21 bytes = 2 MB so a 2 MB contiguous transfer can be made with single DMA operation.
I assume the data block you need to transfer is not contiguous in memory so you need to use multiple transfers of smaller LINE_SIZE to complete the full transfer. To do this you need to use either the separate eDMA module or CPU software to trigger a subsequent TR following completion of a FastDMA transfer. You can use the IRQ_EN register to enable the eDMA request trigger (this allows FastDMA to trigger eDMA which has the ability to write FastDMA registers to trigger a subsequent FastDMA transfer) or enable an interrupt to CPU where the handler code can trigger another FastDMA transfer.
Best regards,
Gary
Hi GaryRK,
Thank you for your reply, now FastDMA can work, but there are some problems. For example, the transmission of 8M (the actual data amount is much larger than this), my current scheme is the whole CPU to do, first configure 4 TR(each maximum 2M), and then cycle 4 times to start the transmission and wait for the completion of the transmission. FastDMA_wait_done this function is blocked waiting, the full CPU participation also has a large time overhead, not enough to meet the demand. If I want to use the eDMA and FDMA scheme you mentioned, do you have a sample? If so, could you provide me with one? Thank you very much!
Best regards,
Brinton_H
Hi Gary,
The problem solved! FDMA does work! I understand your replay now. I modified dts with your basic patch, and then built fdma module independently. My workmate varified it with rsdk application release. We found it deliver data with great speed.
Best regards,
BinksH
HI GaryRK:
thank U very much, I git the patch file in widows environment, there is an error that is space before tab in indent.
0001-RFECapture-FastDMA-test-integrated.patch:202: space before tab in indent.
size = mParamVC.bufLineLen * mParamVC.bufNumLines + 15;
0001-RFECapture-FastDMA-test-integrated.patch:203: space before tab in indent.
FastDMA_config_tr(DMA_CH, (uint32_t)dram.physical_addr, (uint32_t)sram.physical_addr, SRAM_TO_DRAM, size, size, tr); should RFECapture case work in linux environment?
Hi Wenchao,
You are welcome. I think the error in the patching process is because you are using Windows and it has different line endings compared with Linux systems (CR+LF vs LF). Please try using these options with the patch command on command line:
--ignore-space-change --ignore-whitespace --whitespace=nowarn file.patch
If this doesn't work please try to apply the patch on Linux environment (either Linux OS or Cygwin/Msys2) and check the output by compiling RFECapture.