I'm pretty new to programming for embedded applications (besides some Arduino stuff) and I'm working with the CC3220SF microcontroller from Texas Instruments.
Currently I have a program that is constantly polling a device and storing the result. I would like to store 100,000 of these samples (each is 2 bytes) giving me 200kb of data to store. I'm not really sure how I should go about doing this, as trying to just make an array of size [100][1000] just crashes the device.
How should I go about storing this data for later use?
#define MAX_ARR_LENGTH 1000
#define MAX_ARR_DEPTH 100
// Later in the collection function:
uint16_t measurmentsArr[MAX_ARR_DEPTH][MAX_ARR_LENGTH] = {0};
unsigned int arr_length = 0;
unsigned int arr_depth = 0;
// And later, after a data point has
// been verified as useful:
if (arr_length < MAX_ARR_LENGTH){
measurmentsArr[arr_depth][arr_length++] = angle;
} else {
arr_length = 0;
measurmentsArr[arr_depth++][arr_length] = angle;
}
This ^^^ way works for small arrays, but like I said I need to store 200kb... I know the CC3220SF has 512kb for use, how do I best write/read to that?
Respectfully, -James