undefined reference to `_pvHeapStart' when including stdio.h

cancel
Showing results for 
Search instead for 
Did you mean: 

undefined reference to `_pvHeapStart' when including stdio.h

436 Views
dave_harmonjr
Contributor III

I am working with a MKW41Z. I am trying to use some string functions in stdio, sprintf(), to put some strings together to send over bluetooth. When I first tried to use it I got a lot of undefined errors because there was nothing at the beginning of the linkerfile such as GROUP(libcr_nohost.a libcr_c.a libcr_eabihelpers.a). I added that in and I was no longer getting a ton of undefined references but yet I still have a a single undefined reference to `_pvHeapStart' which will not allow my program to compile. I am not sure how to resolve this. I tried turning on managed linker settings and following nxps guide to change the library to redlib no host / semi host and neither worked and gave me a tons of undefined references.  I ended up changing it back to use the linkerfile. The linker file is the one included with the ble uart freertos example project in the sdk. I am not sure what to do to get this to work.

This was the guide I was following which appears to be dated a bit. Not sure if it no longer works with the current sdk/mcuxpresso.

Using your own linker scripts 

I have attached the project with the group() in the linkerscript and stdio.h included in wirelessuart.c

 

Labels (1)
0 Kudos
2 Replies

325 Views
dave_harmonjr
Contributor III

Ended up just removing stdio.h and sprintf works. Apparently the implicit reference it has works? Using it with floats however causes a hardfault and corruption. I ended up using a float to string conversion function gcvt() to convert it with no issues.

0 Kudos

325 Views
Sebastian_Del_Rio
NXP TechSupport
NXP TechSupport

Hi David, I hope you're doing well!

 

When using the different wireless stacks for the KW41, it's highly recommended to use UART as the debug console instead of the standard Semihosting, as the latter can cause issues with the timing requirements of the Stacks.

 

Please let us know if you have any further issues.

 

Take care, best regards,

Sebastian

0 Kudos