This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Newlib, syscall.c and printf


Thank's for your answer Federico,

I try with 8192 bytes of stack and this code and printf not work.

extern unsigned int _HEAP_START;
extern unsigned int _HEAP_END;
int main(void)
{
    char txt[20];
    float fVal = 3.141596;
    setvbuf(stdin, NULL, _IONBF, 0);
    setvbuf(stdout, NULL, _IONBF, 0);
    setvbuf(stderr, NULL, _IONBF, 0);

InitHW();

    lcd_gotoxy(0,0);
    snprintf(txt, 20, "Start: %X", (unsigned int)&_HEAP_START);
    _write(0, txt, strlen(txt));    // work

    lcd_gotoxy(0,1);
    snprintf(txt, 20, "End:   %X", (unsigned int)&_HEAP_END);
    lcd_print(txt); // work

    lcd_gotoxy(0,2);
    printf("Hi %.2f\n", fVal);    // not work
    fflush(stdout);
    while (1)
        ;
    return 0;
}

Thank's for your answer.

Sergio

El 08/02/2011 11:03 a.m., Federico Terraneo escribió:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/08/2011 02:23 PM, Hard Maker wrote:
I'm using 1 KB of system stack and have 60KB free of heap. Anyone has
this problem?

Hi, I'm not a newlib developer, just an user.
I've been using newlib with stm32 for quite some time, and printf works,
but takes up nearly 2KB of stack. Maybe the problem is this.


-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNUU0qAAoJECkLFtN5Xr9fLhsIAJ88Gor7LdTDv8sS1bt0gQys
rqUMTkh+3eF2bX7i65G2zqa0iaMREELZlTNI7IxVDUwRTU7yaVrpPc6kiHrfOxwZ
FpxHYclhWWe9yDGCS+gzWtpiHZG8lYVVKc9kaqbLsH3MEhnP169wfzDmUyDa6zKC
BVzYvc3Shymi8zDdKXAOPOnwI1voYzhrGK6HHQOP4ZAXh9BNoWXNiYuoRY/kMj7F
D4KuvK8fC02YhTPqxQm0ZqpIc9AnrZk5OIZK5VxtjGX+1kjpfxJIRtzNkPgW+M/w
HsTo5iWMFnFBefPN3FjBTukt1P6BozdU/QGkV5ZDaWLp6bq2QfTg1TgEnEWOg0A=
=+2ZR
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]