I want to use malloc_debug libray with IAR Toolchain

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
kach_4703581
Level 1
Level 1
Welcome!

Hi,

          I want to know malloc usage for my applicaion. For that I try to add malloc_debug libray to my sample applicaion snip.scan.

          I am using IAR Embedded Workbench IDE - Arm 8.50.6

I am following the below steps

                                               1. Add the components in the scan.mk file  below for our reference

NAME := App_Scan

$(NAME)_SOURCES := scan.c

$(NAME)_COMPONENTS += test/malloc_debug

GLOBAL_DEFINES += WICED_ENABLE_MALLOC_DEBUG

                                             2. snip.scan-ISM43340_M4G_L44-iar IAR = 1   ------ Build the target

                                          

I got below errors.

Warning[Lt009]: Inconsistent wchar_t size

            tx_thread_initialize.o(ThreadX.ARM_CM4.iar.release.a) and 288 other

                      objects in ThreadX.ARM_CM4.iar.release.a and 235 other

                      libraries have wchar_t size 16 bits

            crt0_IAR.o and 197 other objects, some of them in STM32F4xx.a and

                      179 other libraries have wchar_t size 32 bits

Error[Li005]: no definition for "__builtin_return_address" [referenced from

          malloc_debug.o(Lib_malloc_debug.a)]

Error[Li005]: no definition for "__real_malloc" [referenced from

          malloc_debug.o(Lib_malloc_debug.a)]

make.exe[1]: *** [build/snip.scan-ISM43340_M4G_L44-iar/binary/snip.scan-ISM43340_M4G_L44-iar.elf] Error 2

tools/makefiles/wiced_elf.mk:315: recipe for target 'build/snip.scan-ISM43340_M4G_L44-iar/binary/snip.scan-ISM43340_M4G_L44-iar.elf' failed

make: *** [main_app] Error 2

Makefile:351: recipe for target 'main_app' failed

There is no definition for __real_malloc , __builtin_return_address . I try to add standard header files but issue not resolved.  My doubt is anything we need to add in malloc_debug.mk file  for IAR Tool chain purpose. Please reply to this query. If we implement this feature It will helpful  for trace the heap in our application

0 Likes
1 Reply
Aditi_B
Moderator
Moderator
Moderator
500 replies posted 5 questions asked 250 replies posted

Hello,

What is the WICED STUDIO IDE version are you using?

Thanks

Aditi

0 Likes