Skip to content

following newline problem #726

@Wirtos

Description

@Wirtos

The code doesn't output anything via serial usb, but works in case fflush is there:

int main() {
    stdio_init_all();
    tusb_init();
    while (!tud_cdc_connected()) { sleep_ms(100); } 
    fprintf(stdout, "any string"); // same with fwrite
    // flush(stdout);
    puts(""); // print a newline
    return 0;
}

The following code also works fine:

int main() {
    stdio_init_all();
    tusb_init();
    while (!tud_cdc_connected()) { sleep_ms(100); } 
    fprintf(stdout, "any string\n");
    return 0;
}

Is the problem caused by some crt implementation detail?
Host: Windows 11
Command: putty (plink -serial -sercfg 115200,8,n,1,N COM2)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions