[SOLVED] the gnu linker bug for new version of segger

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] the gnu linker bug for new version of segger

    dear:
    now i am use the segger studio of v7.3. the gnu linker is used for cortex-m33 but this is some error like "prinops.c:(.text.libc.vfprintf_l+0x5c): undefined reference to `__SEGGER_RTL_vfprintf'".
    and segger linker is ok。
    how to solver this problem for gnu linker ? :thumbup:
  • Hello,

    Thank you for your inquiry.

    Most likely the library I/O type is not correctly set in the project.
    Please take a look here for more information: https://wiki.segger.com/Embedded_Studio_Library_IO


    Best regards,
    SebastianB
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • hi:
    thank your reply.

    you,re right. According to the documentation, SEGGER_RTT_printf can be used. But there,re two question。

    One problem is that the current SEGGER_RTT_printf formatting output has too many restrictions (such as outputting long long), and the application is not compatible with the previous one as below.

    /*********************************************************************
    *
    * SEGGER_RTT_printf
    *
    * Function description
    * Stores a formatted string in SEGGER RTT control block.
    * This data is read by the host.
    *
    * Parameters
    * BufferIndex Index of "Up"-buffer to be used. (e.g. 0 for "Terminal")
    * sFormat Pointer to format string, followed by the arguments for conversion
    *
    * Return values
    * >= 0: Number of bytes which have been stored in the "Up"-buffer.
    * < 0: Error
    *
    * Notes
    * (1) Conversion specifications have following syntax:
    * %[flags][FieldWidth][.Precision]ConversionSpecifier
    * (2) Supported flags:
    * -: Left justify within the field width
    * +: Always print sign extension for signed conversions
    * 0: Pad with 0 instead of spaces. Ignored when using '-'-flag or precision
    * Supported conversion specifiers:
    * c: Print the argument as one char
    * d: Print the argument as a signed integer
    * u: Print the argument as an unsigned integer
    * x: Print the argument as an hexadecimal integer
    * s: Print the string pointed to by the argument
    * p: Print the argument as an 8-digit hexadecimal integer. (Argument shall be a pointer to void.)
    */

    The second problem is that there is no sprinf function?
  • Hi,

    Did you setup the project correctly for long long printing support? (Code > Printf/Scanf > Printf Integer Support set to "Long Long")

    "sprintf" does of course exist and may simply be used after including "stdio.h".

    Could you check whether the application was prepared correctly?

    Best regards,
    SebastianB
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • hi:
    thanks ,i solve it.

    Using Segger's own linker script will automatically link __SEGGER_RTL_vfprintf and __SEGGER_RTL_vfscanf.
    But I use the linker written by GNU format which cannot automatically link __SEGGER_RTL_vfprintf and __SEGGER_RTL_vfscanf.