SDMMC and BOOT_SRAM
I wanted to follow up on the SDMMC and BOOT_SRAM setup I ended up using here just in case others have questions and stop here to read through this tutorial.
I used the technique noted here
#define DSY_TEXT __attribute__((section(".text")))
static DSY_TEXT SdmmcHandler sdcard;
static DSY_TEXT FatFSInterface fsi;
static DSY_TEXT AudioDesc audioDesc;
Notes:
- The AudioDesc is a class setup that manages all of the file IO for reading out audio descriptions of what is happening on my sequencer. I wanted to ensure that this is also running out of the SRAM space because this contains all of the file (FIL) that cannot be in DTCMRAM.
- File system interface also needs to be in the SRAM space and not DTCMRAM
- I chose to also put the Sdmmc handler there as well, but I do not believe this is required but it works having it there as well.
For reference: here is my linker script section:
.text :
{
. = ALIGN(4);
_stext = .;
*(.text)
*(.text*)
*(.rodata)
*(.rodata*)
*(.glue_7)
*(.glue_7t)
KEEP(*(.init))
KEEP(*(.fini))
. = ALIGN(4);
_etext = .;
} > SRAM
With all of the above I am able to use the BOOT_SRAM config and still have all of the files stream for the SD Card and work as expected.
Hope this helps give you another option on ensuring the SDMMMC works when in the BOOT_SRAM config.