This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Checking variable space, possibility of dynamic memory allocation

I am sampling a signal and would like to store values in an array. Array is storing 50000 samples values. I would like to know the space occupied by this array variable how can i know ? where can I know ?

In general i presumed if i am storing as uint16_t it would be; each sample takes 2 bytes, 2*50,000= 100KBytes. Is this true for ARM Compiler?or Am i wrong?

Also, If i declare them dynamically, where do they get stored ?

I am using STM32F4 DK.

-
Thanks,
Ashok

Parents
  • uint16_t elements will also take 2 bytes in the ARM universe. See sizeof()
    Dynamic memory is allocated from the HEAP
    The heap size is declared in the startup.s file, RAM would need to be large enough to accomodate or linker will throw an error.

Reply
  • uint16_t elements will also take 2 bytes in the ARM universe. See sizeof()
    Dynamic memory is allocated from the HEAP
    The heap size is declared in the startup.s file, RAM would need to be large enough to accomodate or linker will throw an error.

Children
No data