The Pico Example code is usually C or C++ code, perhaps some Assembler code, and intended to be compiled using the Pico SDK. If it's compiled to not use USB serial output one won't be able to capture USB serial output no matter what one does.Try running the program with python -u
Looking at - https://github.com/raspberrypi/pico-examples/blob/master/multicore/hello_multicore/CMakeLists.txt -
It doesn't seem that USB serial is enabled as it is for the 'hello_usb' example which would fit the first of my reasons for not seeing anything.
And looking at - https://github.com/raspberrypi/pico-examples/blob/master/multicore/hello_multicore/multicore.c -
It seems to me, even when USB output is enabled, it would have completed any output before a USB serial connection was even established, which would fit the second of my reasons for not seeing anything.
If I had written the example code I would have expected most makers and new users to be using USB serial rather than UART, and would have ensured all examples support USB or UART, and even 'semi-hosting', so all examples would work as anticipated and be useful no matter what users were using.
That would avoid new users getting confused as to why examples don't work as expected and having to ask on the forum, would save others the time and effort of having to repeatedly explain why it hasn't worked.
In fact I'd have written the Pico SDK so it could use USB serial and/or UART and/or semi-hosting so the example code could be simpler than it is, and work the same no matter what was used.
But I didn't write the example code, or Pico SDK, and Raspberry Pi appears to have taken a different view.
I haven't used the VS Code Pico Extension but isn't there some option which allows users to specify what's wanted for 'stdin/stdout'; nothing, or some selection or combination of USB, UART and 'semi-hosting' ?
Statistics: Posted by hippy — Fri Oct 25, 2024 1:49 pm