Skip to content

High performance SPI (50 MHz) with DMA on LPSPI2 on NXP MIMXRT1061 #70580

Answered by DerekSnell
asteriskSF asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @asteriskSF ,
Yes, it sounds like the cache is likely the cause of this. In the RT1xxx architecture, the caches are only used on the busses of the Cortex-M7 CPU, and Zephyr enables these by default. Other masters in the SOC like the DMA do not access the cache. Therefore, any shared RAM locations like your SPI buffers need to be in non-cached memory. Otherwise, the CPU and DMA may not be using the same data.

Starting with Zephyr v3.5, you can use the devicetree attribute DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE) to disable the cache for a specific MPU region, like in the OCRAM. Some examples of using this attribute include the mem_attr test, or this RT1170 overlay.

Let us know if that resolves …

Replies: 9 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@asteriskSF
Comment options

Comment options

You must be logged in to vote
2 replies
@asteriskSF
Comment options

@asteriskSF
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@DerekSnell
Comment options

Answer selected by asteriskSF
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants