Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[st-util] Can not get piped output on Windows #665

Closed
4 tasks done
john5f35 opened this issue Feb 8, 2018 · 0 comments · Fixed by #763
Closed
4 tasks done

[st-util] Can not get piped output on Windows #665

john5f35 opened this issue Feb 8, 2018 · 0 comments · Fixed by #763

Comments

@john5f35
Copy link

john5f35 commented Feb 8, 2018

  • Operating system: Windows 7 & 10
  • Stlink tools version: v1.3.1
  • Stlink commandline tool name: st-util
  • Target chip (and optional board): e.g STM32L476vg (STM32Fxxx Discovery)

In launching st-util as a child process on Windows, when the board is connected and st-util is in server/long-running mode, the parent process can't seem to be able to get any output from stdout and stderr from pipe. This is tested to be happening with NodeJS and Python 3. However when the board is not plugged in and st-util exits with error, the parent process is then able to catch output from pipes.

This is weird and troublesome since we won't be able to do output validation on st-util.

Example NodeJS script:

function log_child(proc_path: string, args: [string]) {
    let p = spawn(proc_path, args);
        p.stdout.on("data", (data) => {
            console.log(`[child:stdout]${data.toString()}`);
        });
        p.stderr.on("data", (data) => {
            let str = data.toString();
            console.log(`[child:stderr]${str}`);
        });
}
promise_child("st-util.exe", [""]);

Expected/description:
Expected things like:

[child:stdout]st-util 1.3.1
[child:stderr]2018-02-08T16:54:42 INFO src\common.c: Loading device parameters....
[child:stderr]2018-02-08T16:54:42 INFO src\common.c: Device connected is: L4 device, id 0x10076415
[child:stderr]2018-02-08T16:54:42 INFO src\common.c: SRAM size: 0x18000 bytes (96 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 2048 bytes
[child:stderr]2018-02-08T16:54:42 INFO src\gdbserver\gdb-server.c: Chip ID is 00000415, Core ID is  2ba01477.
[child:stderr]2018-02-08T16:54:42 INFO src\gdbserver\gdb-server.c: Listening at *:4242...

but gets nothing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants