This has been partially covered in other threads (including this one https://sebiik.github.io/community.axoloti.com.backup/t/two-questions-arrays-and-where-to-put-them-solved/4252/28 ), I think, but the specifics are confusing me.
I have some structs saved to a binary file. The struct is defined as:
struct lpcTables {
uint16_t subtype;
uint8_t num_k;
uint8_t energy_bits;
uint8_t pitch_bits;
uint8_t kbits[10];
uint8_t energytable[64];
uint8_t pitchtable[64];
int16_t ktable[10][64];
uint8_t interp_coeff[8];
};
lpcTables *lpf_coeffs_data;
and there are 8 of them rolled into the binary file.
I want to load this data into SDRAM, but I'm not sure how exactly to do this.
I currently have this in my Init Code:
// FatFS file_erroror message container
FRESULT file_error;
FIL bin;
LogTextMessage("Attempting to load binary data");
// Attempt to open binary file, and keep return status in file_error var
file_error = f_open(&bin, "attr_table", FA_READ | FA_OPEN_EXISTING);
// Exit if binary file not found
if(file_error != FR_OK) {
LogTextMessage("Unable to open binary data file");
return;
}
/////////////////////////////
// Allocate array in SDRAM //
/////////////////////////////
LogTextMessage("Allocating space in SDRAM for LPC Coefficents tables");
static lpcTables lpc_coeffs_data_sdram[attr_poly][11872] __attribute__ ((section (".sdram")));
// Set pointer to SDRAM array
LogTextMessage("Setting pointer to LPC Coefficents tables");
lpf_coeffs_data = &lpc_coeffs_data_sdram[parent -> polyIndex][0];
I get this error message in the console:
region `sdram' overflowed by 8612096 bytes
collect2: error: ld returned 1 exit status
make: *** [/Users/adrin009/Documents/axoloti/build/xpatch.bin] Error 1
shell task failed, exit value: 2
Compiling patch failed ( /Users/adrin009/Library/Mobile
I managed to load a binary before, but that was just a straight array of bytes. This time, I want to load structured data, and I can't work out how to do it.
Sorry if this is really basic stuff, but it's confusing the hell out of me..
a|x