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

How to debug through malloc function?

Hi All,

I am using EFM32GG11 cpu and have problem with malloc function. It crashes on the first call.

I have specified stack and heap areas in the scatter file.

I would like to debug through malloc function. I am using the standart C library linked to my keil MDK 5 project,

How could i build c runtime and link it to my project?

Thanks,

Parents
  • The Heap/Stack are more usually defined in startup.s

    ;*******************************************************************************
    ;
    ; Amount of memory (in bytes) allocated for Stack
    ; Tailor this value to your application needs
    ; <h> Stack Configuration
    ;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
    ; </h>
    
    Stack_Size      EQU     0x0800
    
                    AREA    STACK, NOINIT, READWRITE, ALIGN=3
    Stack_Mem       SPACE   Stack_Size
    __initial_sp
    
    
    ; <h> Heap Configuration
    ;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
    ; </h>
    
    Heap_Size       EQU     0x2000
    
                    AREA    HEAP, NOINIT, READWRITE, ALIGN=3
    __heap_base
    Heap_Mem        SPACE   Heap_Size
    __heap_limit
    
    ;*****************************************************************************
    

Reply
  • The Heap/Stack are more usually defined in startup.s

    ;*******************************************************************************
    ;
    ; Amount of memory (in bytes) allocated for Stack
    ; Tailor this value to your application needs
    ; <h> Stack Configuration
    ;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
    ; </h>
    
    Stack_Size      EQU     0x0800
    
                    AREA    STACK, NOINIT, READWRITE, ALIGN=3
    Stack_Mem       SPACE   Stack_Size
    __initial_sp
    
    
    ; <h> Heap Configuration
    ;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
    ; </h>
    
    Heap_Size       EQU     0x2000
    
                    AREA    HEAP, NOINIT, READWRITE, ALIGN=3
    __heap_base
    Heap_Mem        SPACE   Heap_Size
    __heap_limit
    
    ;*****************************************************************************
    

Children