Hi,
I am attempting to create a minibuffer in SRAM for our own project and I consulted EFM32WG datasheet to choose a memory address. It should be located between 0x20000000 and 0x20007fff according memory map:
I realized that defined AM_BACKUP_DOMAIN_START_ADDRESS (0x40081120) in Firmware-Basic project is for some variables to be declared in the backup domain sector of SRAM, but according to the memory map, that address correspond to something related to the BURTC.
Is something in the memory map that has been changed?
Thanks in advance!
To use the internal SRAM just declare the buffer as a global static array and the complier/linker will put it in the right place (it knows about the internal 32 KB SRAM but not about the external 256 KB SRAM).
Hi,
Yes, the backup domain is a small area of SRAM that maintains its contents when the processor is EM4. We use this for all the configuration settings.
The external SRAM is mapped to the EBI (external binary interface) region 0. The audiomoth.h file defines two constants: #define AM_EXTERNAL_SRAM_START_ADDRESS 0x80000000
#define AM_EXTERNAL_SRAM_SIZE_IN_BYTES (256 * 1024)
You can just define a pointer to this address and use it as an array. For example, as below to store signed 16-bit values:
int16_t *buffer= (int16_t*)AM_EXTERNAL_SRAM_START_ADDRESS;
buffer[0] = -1;
You shouldn't make any assumptions about the initial memory contents and be sure to call AudioMoth_enableExternalSRAM() to power it up before using it.
Alex