How to use the complete DMA buffer area?
I like to know how to use the complete DMA buffer area (of where the unallocatable part is going)
When using the default fx3.ld linker script, I can allocate a maximum of 13 x 16Kb Dma buffers with CyU3PDmaChannelCreate, any requests for more buffer will fail.
When reading the fx3.ld and the FX3 Memory Map section of the programmers manual, I come to the conclusion there is 256Kb available for dma buffers. So where is the remaining 3 x 16Kb?
The default memory map used for FX3 applications is as follows:
Descriptor area Base: 0x40000000 Size: 12KB
Code area Base: 0x40003000 Size: 180KB
Data area Base: 0x40030000 Size: 32KB
Driver heap Base: 0x40038000 Size: 32KB (0x8000) (Update cyfxtx.c to change this.)
Buffer area Base: 0x40040000 Size: 256KB (0x40000) (Update cyfxtx.c to change this.)
I also adapted the fx3.ld and cyFxTx.c to change the allocatable DMA buffer area to 336Kb.
When I use these settings, I manage to allocate 18*16Kb Dma buffers with CyU3PDmaChannelCreate (in my application this is a buffer of 1.6ms)
I expect to get 21 x 16KByte buffers. So again I am missing 3 x 16Kbyte...
Adapted CyFxtc.c (set USE_CUSTOMLD compile flag to use)
----------------
#ifdef USE_CUSTOMLD
#define CY_U3P_MEM_HEAP_BASE ((uint8_t *)0x40024000) // custom. Must match fx3.ld in current dir
#else
#define CY_U3P_MEM_HEAP_BASE ((uint8_t *)0x40038000)
#endif
Adapted fx3.ld
---------------
/*
Descriptor area Base: 0x40000000 Size: 12KB
Code area Base: 0x40003000 Size: Reduced to 116KB (0x1D000)
Data area Base: 0x40020000 Size: Reduced to 16KB (0x04000)
Driver heap Base: 0x40024000 Size: 32KB (0x8000) (Update cyfxtx.c to change this.)
Buffer area Base: 0x4002C000 Size: 336KB (0x54000) (Update cyfxtx.c to change this.)
*/
...
SYS_MEM : ORIGIN = 0x40003000 LENGTH = 0x1D000
DATA : ORIGIN = 0x40020000 LENGTH = 0x4000
Any suggestions?
|