I am working with the STM32F7 MCU in a project where I need to compute and create a LUT with the values of a signal which I will finally send to the DAC.
The problem with the LUT is that the size will be known only at run-time because it depends on some parameters sent to the MCU from a PC.
I was searching info about how to implement that in C and the answer seems to be always the same: malloc()
.
I also read that malloc()
is not a good way to allocate memory when working with embedded systems so I am wondering whether is there any way to implement such functionality in C not using malloc()
(initialize an array using a variable calculated at run-time).