Thank you for taking the time to explain. I’m with you, i understand the problems you’re listing, I just don’t understand why the alias lookup has to interfere with any of it, since it works fine without aliasing.
No alias) Pin PC11 → We’re already using that → Special behavior
Expected alias behavior) Resolve the alias → Pin PC11 → We’re already using that → Special behavior
Current alias behavior) Resolve the alias → Nope PC11 is already defined as another alias → Dead.
You don’t need to contact the micro controller to resolve an alias, it’s a simple map, right? Why isn’t that a step before the pin validation that happens anyway?
Thus, “shared pins that don’t look like shared pins” is not a simple change.
In my mind (obviously i have none of the insight you have, I understand if you don’t want to waste time entertaining mr. smooth brain here, so if i’m just being dumb, i accept that), the aliases should be resolved to their pin names as a separate step. That way you have consistent behavior, and only need validation in one place, instead of having to implement validation twice (or not at all, as is the case currently, they just disallow multiple aliases pointing to the same pin when they’re used in the config, you can define them just fine). What’s the problem with that approach?
Beyond the technical challenges there is the issue of support and debugging. Fundamentally, the code does something notably different on a “shared pin” and obscuring that a pin is shared in the config seems like a misfeature to me.
If the pin aliases were resolved to their pin names as a step in constructing the loaded configuration (the one that appears in the log), that would be less of an issue.
I understand you would like to handle boards that are fundamentally different as if they are the same. I am unconvinced that it is practical or desirable to do so.
Currently impractical and messy, but not impossible (we have a working config). Very much desirable, i’ve been hesitant to add the SKR e3 mini and duet boards, because they’re so messy to abstract (and Duets because of the lack of flashing that can be automated), because the tools we’re given do not allow it. I’ve received countless requests, and now that one came along with a user contributed Voron V0.1 config, i had to give in. Currently we’re working with a quirks file include, and it physically hurts me.
I would also add that I’m not sure what the gain of x_uart_pin
and y_uart_pin
aliases that point to the same pin is. Ultimately one would still need to declare different uart_address
fields anyway. So, these boards can’t be treated as similar regardless of pin aliases.
I think showing is easier than telling in this case.
SKR 3 config
SKR MINI E3 V3.0 config
Since the mini e3 has soldered 2209’s, the tmc2209 sections can be defined in the board config. Right now i need a “quirks file” later in the configuration to set the uart_pins manually to PC11, after all overrides are done. It’s … really messy. The uart address and tx_pin can be set to their defaults by overriding includes, for example in case of toolboard support so that’s not an issue, if it wasn’t for the fact that I can’t reuse e_uart_pin for tx_pin in [tmc2209 extruder] because of the current alias limitation.