sprintf crashing

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

  • sprintf crashing

    Unfortunately sprintf is crashed. Any idea ?
    Our target is:
    1. embOS for TI MSP430 (build Debug (D)) with IAR workbench ver. 5.10.4 (5.10.4.50168)
    2. MSP430F5437 CPU with internal developed board

    3. start project which we use is Start_F5438
    Thx
  • Hello,

    we are not aware of any problems with sprintf() and embOS.

    I tried to reproduce the problem with IAR simulator and our embOS start project but I cannot see any problem here.
    My task looks like this:

    C Source Code

    1. char s[20];
    2. static void HPTask(void) {
    3. sprintf(s, "Test = %d", 123);
    4. while (1) {
    5. LED_ToggleLED0();
    6. OS_Delay (50);
    7. }
    8. }


    What exactly happens when you talk about a crash?
    Did you try to call sprintf() without embOS?
    Is the character array as first paramter for sprintf() bigh enough?

    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.
  • Yes, depending on the string functions like printf() and sprintf() uses a lot of stack.
    Please ensure that your task stack size is big enough.
    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.