Hi xiangjun_rong,
I modified SDK example "lpcxpresso55s69_powerquad_fir_fast" to present problem. I use every solution that you provide:
1. TMPBASE is in shared memory
pqConfig.tmpBase = (uint32_t *) PowerQuadTemp;
PQ_SetConfig(DEMO_POWERQUAD, &pqConfig);
2. SRAM4 is checked that is not used
Linker output:
" SRAM_4: 0 GB 16 KB 0.00%"
Map file:
SRAM_4 0x20040000 0x00004000 xrw
3. Only user accessible addres are used 0xE000_3000 and 0xE000_1000
// First 4K not used as is reserved for PowerQuad
#define EXAMPLE_PRIVATE_RAM_0 ((float *)0xE0000000)
// Memory that can be used by user, divided in 4K blocks
#define EXAMPLE_PRIVATE_RAM_1 ((float *)0xE0001000)
#define EXAMPLE_PRIVATE_RAM_2 ((float *)0xE0002000)
#define EXAMPLE_PRIVATE_RAM_3 ((float *)0xE0003000)
// Move first data table that will be next moved back to buffer and compared, placed from 4kB of memory
PQ_MatrixScale(DEMO_POWERQUAD, POWERQUAD_MAKE_MATRIX_LEN(16, EXAMPLE_DATA_LEN / 16, 0), 1.0f, s_firstData,
EXAMPLE_PRIVATE_RAM_1);
PQ_WaitDone(DEMO_POWERQUAD);
// Move second data table in private PowerQuad memory, placed from 12kB of memory
// If this block is commented, example works, no overwrite
PQ_MatrixScale(DEMO_POWERQUAD, POWERQUAD_MAKE_MATRIX_LEN(16, EXAMPLE_DATA_LEN / 16, 0), 1.0f, s_secondData,
EXAMPLE_PRIVATE_RAM_3);
PQ_WaitDone(DEMO_POWERQUAD);
// Move back first data table from memory placed form 4kB of memory
PQ_MatrixScale(DEMO_POWERQUAD, POWERQUAD_MAKE_MATRIX_LEN(16, EXAMPLE_DATA_LEN / 16, 0), 1.0f , EXAMPLE_PRIVATE_RAM_1,
PowerQuadOutput);
PQ_WaitDone(DEMO_POWERQUAD);
Example move two different tables into two separated places of PowerQuad private memory EXAMPLE_PRIVATE_RAM_1 and EXAMPLE_PRIVATE_RAM_3. Next move back first table EXAMPLE_PRIVATE_RAM_1 to other shared buffer and compare that is the same as saved.
This example works if use of "EXAMPLE_PRIVATE_RAM_3" is commented. Moved tables are the same, but if add moving of second table to EXAMPLE_PRIVATE_RAM_3 this fails.
If any more question please ask.
I add project in attachment, maybe this will help investigate problem.
Best Regards,
Mateusz Litwin