-
Notifications
You must be signed in to change notification settings - Fork 281
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
rpipico: configurable ttys #1063
Conversation
cf17040
to
2f96efd
Compare
That does create yet more things for the user to get wrong, and makes it ever harder to have a build that someone can just try. It's been easier on the other ports that do this as they can probe hardware or you end up typing stuff at the boot: prompt (so you could print to several and declare whoever you type at console). Is it reasonable to wait a couple of seconds at boot and see if there is a USB connect and if not boot with serial as the console ? |
It is reasonable. |
plt_param is probably the best option. You can also then set the parameters you want to indicate if there is a usb console and how many tty ports are present. See "setboot". I really don't like the make config stuff, it's just guaranteeing a load more bug/queries from everyone trying to figure out yet another layer of indirection on configuring the device. So my preference is strongly
Let the user specify the number of ports on the command line (or with setboot). So you'd then boot with USB, log in "setboot whatever" and it's done and consistent with the other ports. |
You're the boss :) So current suggestion is:
I just took a look at the code once more, and So I would have to initialize devtty with defaults as I described above, then do it again inside I will prototype it the way I described it, but it'll likely need to change based on your response. |
2f96efd
to
7c621d5
Compare
I pushed the prototype for you to take a look at. It's not fully functional yet, I still have few issues with USB console. |
Sorry for the delay, it does seem to work fine with default boot, but there are some issues with locking when changing the parameters in cmdline, and I've seen few Hard Faults running the system. I have a very busy week, but I hope to finish it the following week. |
12945ab
to
a14ee2e
Compare
Who knew that using 5v SD card reader can lead to issues... I think it's working now. |
a14ee2e
to
d72f20b
Compare
@EtchedPixels Sorry for a ping, doing it just in case if you missed the update. If not, I'm sorry, I wont' do it again :) FYI something broke on pico platform when you updated |
Weird.. I don't see anything else assuming the size and I imagine you did the obvious things like build from clean ? |
Yeah, I'm also not sure what's going on. But it looks like some memory corruption.
I did. And commit prior to that one works, but not after. |
Now that I'm thinking about it. I did run |
But outside of the segfault issue, do you have any feedback for this PR specifically? |
Looks good to me other than pinning down the fault problem (which is probably unrelated anyway) |
90dccd6
to
03ff288
Compare
Thanks |
Fixes: #1062
Because not everybody is able to connect UART as boot console for Pi Pico, I added the ability to reconfigure the order of tty's.Amount of ifdefs has been growing a lot, so I added smallmktty
tool that parses config and generatesdevttyconf.c
anddevttyconf.h
that maps devices appropriately. Format is very simple:For now there's still a problem of USB ACM not connecting fast enough to get all boot messages printed. I could make it so it waits for any key before boot, but then unattended boot is broken. Should I add it as another option as well?Version 2:
Stage 1:
On startup
devtty_init
will wait for USB host connection, and if present before timeout expires, it will configure USB consoles first, UART second. So boot messages will be printed using detected device.Stage 2:
At root FS mount
plt_param
will get executed either from CMDLINE or from MBR.Boot arg in the format
tty=[usb|uart]N,...
will be parsed and tty's will get reconfigured once again.For example, given
tty=uart1,usb1,usb2
the following mapping will be configured/dev/tty1
-uart1
/dev/tty2
-usb1
/dev/tty3
-usb2