"mpfs-rpmsg-bm"demo bulid with "undefined reference to `sprintf' "error #132
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You can see declaration (just statement that something somewhere implementes it), but that's not definition (the real implementation). If you tell the linker to not use the default libraries, then they will not be defined. There are multiple ways to address the missing printf implementation, for example:
|
Beta Was this translation helpful? Give feedback.
-
Hi @EricZhangjie , The mpfs-rpmsg demos in the polarfire-soc-amp-examples directory are compiled in standalone mode (no stdlib), that's the reason why there's no standard implementation of sprintf. However there is an ee_vsprintf function included in the project which can be used for the same purpose. Example: There are also some additional helper functions which will write the string directly to UART after formatting. For example: For more information please refer to the ee_vsprintf implementation within the project: |
Beta Was this translation helpful? Give feedback.
Hi @EricZhangjie ,
The mpfs-rpmsg demos in the polarfire-soc-amp-examples directory are compiled in standalone mode (no stdlib), that's the reason why there's no standard implementation of sprintf. However there is an ee_vsprintf function included in the project which can be used for the same purpose.
Example:
ee_vsprintf(info_string, "timer_cnt = %d, \r\n",timer_cnt);
There are also some additional helper functions which will write the string directly to UART after formatting. For example:
https://github.com/polarfire-soc/polarfire-soc-amp-examples/blob/main/mpfs-rpmsg-freertos/src/application/inc/pingpong_demo.c#L157
For more information please refer to the ee_vsprintf implementation wi…