p3p / pio-framework-arduino-lpc176x

10 stars 18 forks source link

Fix UART3 on lpc176x, ie: BTT SKR 1.4, BTT SKR 1.4 TURBO #33

Closed Minims closed 4 years ago

Minims commented 4 years ago

Fix UART3 on SKR Board with lpc1768 and lpc1769 look @ https://github.com/bigtreetech/BIGTREETECH-SKR-V1.3/issues/221

p3p commented 4 years ago

Although this works around an issue on those specific boards, changing the default pins associated with the UART3 peripheral changes the behaviour that may be assumed by other boards, to fix this properly a way to configure this will need to be added.

ruedli commented 4 years ago

a way to configure this will need to be added.

Correct, the pins can have 4 functions, selected by Funcnum 0..3, but these functions cannot be selected from Marlin config files as far as I know:

image

I assume - from the MARLIN perspective: I2S is not relevant, and Timer2 channel 0/1 are obtained from another pin. Selecting as I/O pin could be relevant fro some 3D printer board implementations (as well as the Timer2 pins in more rare cases).

ruedli commented 4 years ago

Basically, functions are multiplexed to many pins. In the case of UART3 Pin 7/6 under Funcnum 3 image

and also Pin 46/47, Funcnum 2: image

finally Pin 82/85, under Funcnum 3: image

The last one is used by Bigtreetech.

ruedli commented 4 years ago

I added "configurable" selection of pins, also configured the other UARTs that have different pin out options. Because I only knew how to contribute through git by locally comitting / pushing to my mirror, I created a pull request #41 I tested it got BTT SKR 1.4 Turbo, and could use the Serial3 just by setting a corresponding symbol in Marlin.

The advantage is, while now we can get what is needed for the BTT board, it does not impact other boards: they simply should not set the #define.

p3p commented 4 years ago

41 merged