@Paul, can we talk about the memorymap?
I think it may be better to move DMAMEM behind the heap. Heap-start: 0x20200000, DMA-start 0x20200000 + SIZEOF(OCRAM) - SIZEOF(DMAMEM) ( with correct granularity)
Problem is (I think, if I understand that correctly!!!), the MPU can divide a region into 8 subregions with eqal size only.
So if we place DMAMEM before Heap, and let's say DMAMEM is 153600 Bytes, and Heap starts after that, the first part of heap has to have the same cache-setting as DMA.
If we reverse that, and place DMAMEM after Heap, we have basically the same situation, but if we move the region a bit down we can have the DMAMEM as intended and only a small part of the upper heap (which is not used with a bit luck) with wrong cache-setting.
I think it may be better to move DMAMEM behind the heap. Heap-start: 0x20200000, DMA-start 0x20200000 + SIZEOF(OCRAM) - SIZEOF(DMAMEM) ( with correct granularity)
Problem is (I think, if I understand that correctly!!!), the MPU can divide a region into 8 subregions with eqal size only.
So if we place DMAMEM before Heap, and let's say DMAMEM is 153600 Bytes, and Heap starts after that, the first part of heap has to have the same cache-setting as DMA.
If we reverse that, and place DMAMEM after Heap, we have basically the same situation, but if we move the region a bit down we can have the DMAMEM as intended and only a small part of the upper heap (which is not used with a bit luck) with wrong cache-setting.