[SOLVED] sprintf - no conversion of long long unsigned ?

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

  • [SOLVED] sprintf - no conversion of long long unsigned ?

    Hi,

    i had a first trial with embOS using

    - embOS V502a
    - Cortex-M
    - STM32F051_STM32F051R8_SK example from the embOS BoardSupport Folder
    - Segger Embedded Studio for ARM V4.12 (64Bit)

    and realized the following problem:

    /* CODE INSIDE A TASK */
    unsigned long long SerialNumber = 123456789012345;
    char buffer[50];

    sprintf(buffer, "%llu", SerialNumber);
    /**********/

    produces - while using embOS - the result : buffer[0] => u (only the character "u") ??
    and without embOS the result is correct : buffer content == 123456789012345


    What could be the reason for that behavior?


    The stack is big enough to handle the sprintf without crashing the RTOS.
    The flags inside solution OPTIONS / CODE for the Printf/Scanf are always set to:
    Printf Integer Support = Long Long
    Printf Width/Precision Supported = Yes
    Wide Characters Supported = Yes

    Thank you for your support!

    Marco Seitter
  • Dear Mr. Seitter,

    most likely the "Printf Integer Support = Long Long" option is not set correctly in your project.
    Could you please double check that?
    You could also contact the embOS support directly via our support email address (which you can find in the embOS manual in chapter "Support").
    If you like you can send us your project and we'll check it.

    Best regards,
    Til
    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 Til!

    Thank you for that very fast response!

    I want to apologize!
    Everything about "Printf Integer Support = Long Long" option was set correctly - but only at "Solution Options" not inside "Project Options".

    After setting the flags there too all went well!!
    It was my misunderstanding that "Solution Options" will overwrite "Project Options".

    Best regards
    Marco Seitter
  • Hi Marco,

    no need to apologize.
    That's what I assumed since I did the same mistake in the past :) .

    Please let us know if we can be of any further help.

    Best regards,
    Til
    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.