Hi, first post here.
I'm writing a program for a microcontroller that must load parameters into several peripheral devices over I2C. The parameters are constant and only used as part of the initialization sequence for the device. The amount of data is on the order of thousands of bytes.
My problem is I don't know the best way of loading in a large number of constants into a c program.
I tried just declaring an array
but once I get about 256 bytes in the array I get a stack overflow error.Code:ParameterArray[1024] = {byte0, byte1,....byte1023};
I could break the data up into several smaller arrays but that seems really inefficient, especially if I want to change the data.
I also tried using malloc(), but I can't figure out how to initialize the data without entering every byte separately.
Since this is in a micro I'd like all the data and program to be in one file. i.e. I don't want to read from a separate data file.
If it helps I'm using a Renesas 8C/25 micro with 32K of ROM and 2K RAM.
I appreciate any help.
SK