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

export both pico hardware UARTs via picoprobe? #101

Open
milipropasm opened this issue Sep 26, 2023 · 14 comments
Open

export both pico hardware UARTs via picoprobe? #101

milipropasm opened this issue Sep 26, 2023 · 14 comments

Comments

@milipropasm
Copy link

Is this impossible, something I could easily add, or a major feature request?
I'm working with poll-based USB and LWIP and it would be really useful to see separate console windows for several 'concurrent' activities...
Andy

@lurch
Copy link
Contributor

lurch commented Sep 26, 2023

#52 talks about "sends debug output to a secondary CDC" which perhaps points you in the right direction? 🤷‍♂️

@milipropasm
Copy link
Author

Excellent thanks, will have a better look at that 2moro and see if I can kludge something, and if I might be able to produce a commit-worthy form.

@milipropasm
Copy link
Author

milipropasm commented Sep 28, 2023

Hmm, below definitely wrong, pls ignore.

"OK, so this is decidedly non-trivial:
I was hoping that the CMSIS_5 debug part of picoprobe used bit-banging or custom PIO code on non-UART GP pins, however the probe's hardware UART1 is already used for this, being connected to target pico's SWCK/SWIO ports.
This means that the picoprobe can only bridge UART0 via USB-CDC, which it already does.
The only way I can see to meet my requirement is to create additional software UART(s) using PIO which could then be bridged by replacing tud_cdc_* calls with their tud_cdc_n_* variants.
As I have two projects on the go ATM and zero experience of pico PIOs, I have to stop here.
Thanks to lurch for the initial pointer tho,
Andy"

@lurch
Copy link
Contributor

lurch commented Sep 28, 2023

the probe's hardware UART1 is already used for this, being connected to target pico's SWCK/SWIO ports.

You do realise that UART1 can be muxed to multiple different GPIO pins? 🙂
https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#pinout-and-design-files

@milipropasm
Copy link
Author

Yep, but always worth checking... my problem was going cross-eyed comparing GPn "pin" numbers with hardware pin numbers whilst comparing against pin 'offsets' in the code, so I totally missed that debug/SWD/CMIS was using already SPI0 not UART1. So yes, this actually is possible after all, simply by enabling uart mode on GP0 and GP1 and then using the tud_cdc_n_* variants in cdc_uart.c
will give it all a try 2moro...

@milipropasm
Copy link
Author

Right, that's done and working (with THREADED 1)

Tested openocd .elf upload and UART (cmake ..)
Tested openocd .elf upload and UARTs (cmake -DEXTRA_UART=1 ..)
Couldn't test at all with THREADED 0: openocd timed-out and uart took an age to initialise.

I currently have the unstaged changes in the working directory created 13:11 28th sept by:

git clone https://github.com/raspberrypi/picoprobe.git
cd picoprobe
git submodule update --init

I have zero experience contributing with git/github but found this (gulp):
https://github.com/MarcDiethelm/contributing/blob/master/README.md
if you have a simpler guide I would be v happy...

@lurch
Copy link
Contributor

lurch commented Sep 30, 2023

https://docs.github.com/en might be a good starting-point?

@milipropasm
Copy link
Author

So am I creating a branch from master or develop?

@milipropasm
Copy link
Author

Anticipating your 'Doh!', I'm looking for a confirmation before I begin work on something I really don't want to have to do twice...

@lurch
Copy link
Contributor

lurch commented Sep 30, 2023

So am I creating a branch from master or develop?

I dunno, that's probably a question for @P33M

@milipropasm
Copy link
Author

OK, thanks anyway. Have created a develop pull request #102 - should have done it from here, but live and learn...

@lurch
Copy link
Contributor

lurch commented Oct 1, 2023

should have done it from here

Nope, in GitHub issues and Pull Requests are two separate things; so you've done the right thing 🙂

@lurch
Copy link
Contributor

lurch commented Oct 1, 2023

(It's entirely up to you how you want to manage this issue, since you created it; but FYI the usual convention is that the issue stays open until the associated PR gets merged)

@milipropasm milipropasm reopened this Oct 2, 2023
@lurch lurch linked a pull request Oct 2, 2023 that will close this issue
@milipropasm
Copy link
Author

#103 will close this

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

Successfully merging a pull request may close this issue.

2 participants