2017-09-01 05:02 PM
I'm implementing a delay line and saving its buffer to SDRAM (starting from address0xC0000000)
#define AUDIO_REC_START_ADDR (SDRAM_WRITE_READ_ADDR + SRAM_WRITE_READ_ADDR_OFFSET)
#define AUDIO_BUFFER_IN AUDIO_REC_START_ADDR
#define AUDIO_BUFFER_OUT (AUDIO_BUFFER_IN + (AUDIO_BLOCK_LENGTH * 2 * sizeof(q15_t)))
#define DELAY_BUFFER_START (AUDIO_BUFFER_OUT + (AUDIO_BLOCK_LENGTH * 2 * sizeof(q15_t)))
#define DELAY_MAX_SECONDS 1
#define DELAY_BUFFER_LENGTH (DEFAULT_AUDIO_IN_FREQ * 2 * DELAY_MAX_SECONDS) // stereo�?�?�?�?�?�?
If I write to the delay buffer in SDRAM and immediately read from it, the data is fine, but if I need to read from the buffer in following cicles of the main loop (as needed for the delay line) the data turns out to be corrupted.
What is the best way of storing data in SDRAM so that those locations are not overwritten?
#sdram #stm32f7462017-09-01 05:23 PM
Why is it so difficult to program a simple data file?
#define SDRAM __attribute__((section('.qsdram')))
SDRAM uint16_t audio_data[audio_zize];
2017-11-12 05:42 PM
Late reply... anyway the strange behaviour I get is that when Ireference the arrays in sdramvianamed section
__attribute__((section('.sdram')))
the data is distorted, despite the arrays having the same addresses as when they were mapped manually.
Maybe I didn't add the sdram section correctly in the LinkerScript (attached)
________________ Attachments : STM32F746NGHx_FLASH.ld.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hy15&d=%2Fa%2F0X0000000b5m%2FEwRAG_k.FIpIk0lfPigiR4IK9BvOcTb2N0qV57bW2i8&asPdf=false