Renesas RSK64M demo build errors (undefined external symbol _sprintf)

There are 33 errors when trying to build the RX600_RX64M_RSK_Renesas_e2studio demo. The root cause is a call to the undefined sprintf() function in MessageBufferAMP.c (2 instances) and MessageBufferDemo.c (6 instances).

Commenting these calls out results in a successful build and loading the program onto the RSK+RSK64M development board correctly blinks the LED.

E0562310: Undefined external symbol "_sprintf" referenced in ".\Source\Common_Demo_Source\Minimal\MessageBufferAMP.obj
E0562310: Undefined external symbol "_sprintf" referenced in ".\Source\Common_Demo_Source\Minimal\MessageBufferDemo.obj

Renesas E2 Studio Version 3.0.1.09
FreeRTOS version 10.3.1 release

You do not need hardware to reproduce this issue. Simply download the latest E2 studio from Renesas website [Windows only] and import the RX64M demo as described on the FreeRTOS website (https://www.freertos.org/RX64M_RTOS_Renesas_GCC_e2studio.html). The initial build fails.

Work-around (in-progress): In the E2 Studio IDE, select Project > Properties > Standard Library > Contents and then check the box marked “stdio.h”. This resolves the 2 sprintf linker errors, but does not resolve other 31 linker errors such as "Description Resource Path Location Type
E0562310: Undefined external symbol “_vStreamBufferDelete” referenced in “.\Source\Common_Demo_Source\Minimal\MessageBufferDemo.obj”

Hmm, sounds like the project needs updating to the latest tools - especially as you say updating the compiler options fixes the sprintf() issue (sprintf being a standard library function, rather than a FreeRTOS function). Thanks for reporting.

Thanks for the reply Richard. I did get the demo working today, but I can’t simply push my local changes to GitHub because my workspace is based on the FreeRTOS zip file as opposed to a git clone of the master branch.

Until I have time to make a GitHub account and push the changes, here is my complete work-around for future readers:

  1. Add stdio.h to your libc build.
    E2 Studio IDE > Project > Properties > Standard Library > Contents: Check the box marked “stdio.h” to resolve the “undefined external symbol sprintf” linker errors.

  2. Import stream_buffer.c into your project.
    E2 Studio IDE > Right Click “Source” directory > Import > Import… > General > File System > Next > Browse… > Select “stream_buffer.c” source file > Advanced: Check the box marked “Create links in workspace” > Finish. This resolves the various linker errors related to undefined stream buffer symbols.