2022-02-11 05:27 AM
I keep the important information in 32 byte. But every block have 32 byte .There are more than 300 block and every block have 32 bytes of data. So I've 32*300 byte data. How can I keep in the RAM successfully. Sould I Keep with array (uint32_t) or pointer (malloc, alloc functions) ? Which one is logical and how ? I am using stm32f4 with 192kb RAM so RAM is surely enough. When I use this values I want to clear-free the memory.
2022-02-11 05:47 AM
I would use a global variable here, if your data is structured something like
struct record { int x; int y; /* more */ };
struct record data[300];
for( int i=0; i<300; ++i ) {
data[i].x = 42;
}
Embedded programming should be as static as possible, so no malloc if not neccessary. You don't want to run out of resources at run-time.
hth
KnarfB