I'm using ADUCM3029 as a microcontroller, when I call the and execute a dynamic allocation a bus fault exception is generated.
the call I'm trying is
float * pk; pk=(float * )malloc(50*4);
and the debugger shows this exception:
A precise data access error has occurred (CFSR.PRECISERR, BFAR) at data address 0xcacf7204.
Exception occured at PC = 0x7006, LR = 0xa195
See the call stack for more information.
The stack is calling __iar_dlmalloc, is the function malloc is falsly linked.
Why didn't I receive any reply?
I've tried doing that and it works in ADUcM3029. May I see your code?
Also, why do you want to do dynamic allocation using malloc?
I need to allocate a buffer to be used by many functions.
concerning the code:
#include <arm_math.h>#include <ADuCM3029.h>#include <string.h>#include <stdio.h>#include <string.h>#include <stdlib.h> /* calloc, exit, free */
float * pk; pk=(float * )malloc(50*4);*/
I think it is due to a stack overflow, before calling these two functions I intialized two float arrays of 256, for DSP. I have put the malloc call before these declaration and it passes.
How can I enlarge Heap to fit my buffers?