BackupGGCode / propgcc

GCC for the Parallax Propeller Microcontroller
Other
0 stars 0 forks source link

COG mode printf end of line problem. #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. make hello.c file

#include <stdio.h>
#include <propeller.h>
int main(void)
{
    int n = 0;
    /* loop forever */
    while(1) 
    {   /* use waitcnt so program will fit in a COG */
        waitcnt(CLKFREQ+CNT);
        printf("Hello World %d\n", n);
        n++;
    }
    return 0;
}

2. propeller-elf-gcc -mcog -Os hello.c; propeller-load -r -t a.out
3. load and run

What is the expected output? What do you see instead?

Expected:
propeller-elf-gcc -mlmm -Os hello.c; propeller-load -r -t a.out
[ Entering terminal mode. Type ESC or Control-C to exit. ]
Hello World 0
Hello World 1
Hello World 2

See:
propeller-elf-gcc -mcog -Os hello.c; propeller-load -r -t a.out
[ Entering terminal mode. Type ESC or Control-C to exit. ]
�Hello World 0
              Hello World 1
                           Hello World 2

Please use labels and text to provide additional information.

Original issue reported on code.google.com by jsden...@gmail.com on 14 Feb 2012 at 10:07

GoogleCodeExporter commented 9 years ago
I've changed the putchar routine in cog/cogserial.c to output a carriage return 
along with any line feeds.

Original comment by ersm...@hfx.eastlink.ca on 15 Feb 2012 at 1:12