Facing Compilation error undefined reference to `_sbrk'

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Facing Compilation error undefined reference to `_sbrk'

1,111 Views
Prithviraj_k
Contributor I

Hello, I am using S32G399A Series ,
Earlier i was successfully able to build package but now i was trying to integrate HSE in it due to which i had to add hse sections in linker file [board-gnu.ldscript ].linker error.PNGI have attached the image of the error .Could you please check this and let me know if you need further details.

0 Kudos
Reply
6 Replies

1,104 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @Prithviraj_k 

Thanks for your post.

Would you mind introducing more about the background?

1. What project was built? Is it a custom application or examples from NXP?

2. Which version of the software packages(HSE, goldvip, etc.) involved?

 

BR

Chenyin

0 Kudos
Reply

1,100 Views
Prithviraj_k
Contributor I

Hello @chenyin_h ,

1.I am Building the Custom changes done on BSW Application over the GoldVip Package
2. Hse FW Version is 2_64 

We are using GCC Compiler of 9.2 
. TARGET = CORTEXM
. DERIVATE = S32G399
. TOOLCHAIN = gnu
. TOOLPATH_COMPILER = C:/NXP/S32DS.3.5/S32DS/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi
. TRESOS_BASE = D:/EB_BSW/EB_GVIP/EB_GVIP
. PLUGINS_BASE = D:/EB_BSW/EB_GVIP/EB_GVIP/plugins.

If you need more Details please let me know .Thanks

0 Kudos
Reply

1,000 Views
Prithviraj_k
Contributor I

Hello @chenyin_h ,

Please let me know if there is any Update on this issue.

0 Kudos
Reply

995 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @Prithviraj_k 

I feel sorry for the late reply due on leave.

From the log you shared, seems the heap is introduced since sbrk is involved, the linker does not find the definition of sbrk,  no sure if your application rely on the heap for allocating memory?

Which version GoldVIP is used?

 

BR

Chenyin

0 Kudos
Reply

975 Views
Prithviraj_k
Contributor I

Hello @chenyin_h ,

The RTD Version :SW32G_RTD_4.4_4.0.2 
I have found a NXP Query with similiar issue  : https://community.nxp.com/t5/Kinetis-Design-Studio/New-KDS-3-problem-undefined-reference-to-sbrk/m-p...

So i have tried to enable the LD Flags by using LINK_OPT += --specs=$(TOOLPATH_COMPILER)/arm-none-eabi/newlib/lib/nosys.specs and after making the above changes in makefile i am getting below error .

Capture.PNG

 



0 Kudos
Reply

969 Views
chenyin_h
NXP Employee
NXP Employee

Hello, @Prithviraj_k 

Thanks for your reply.

The symbol "end" needs to be defined in your linker file, which is used to set the location of the heap. It usually depends on your own implementation.

 

BR

Chenyin

0 Kudos
Reply