Hi all,
since this is my first post, I want to thank all of you for the valuable information in this forum!
I am pretty new to the innards of MCUs esp. memory segments, DMA etc. Unfortunately I am stuck at a problem in this area.
I created a patch to write data to MCP4728 via I2C using an DMA buffer. Running the code from FLASH works perfectly fine.
When I switched to use SRAM via the bootloader, it no longer works. I think it might be related to the memory region used by the DMA buffer. I am using the default configuration , which puts the buffer into SRAM.
#define DMA_BUFF_SIZE 8
static uint8_t DMA_BUFFER_MEM_SECTION mcp4728_output_buffer[DMA_BUFF_SIZE];
Excerpt from daisy_core.h:
/** Macro for area of memory that is configured as cacheless
This should be used primarily for DMA buffers, and the like.
*/
#define DMA_BUFFER_MEM_SECTION __attribute__((section(".sram1_bss")))
Can someone explain to me, how to move the buffer to a different memory location? Or are there other pitfalls when using SRAM for the code I might have overlooked?
Thanks a lot!