MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.26k stars 19.23k forks source link

[BUG] - Setting "SERIAL_PORT_2 3" errors out due to conflict #25477

Closed c0dyhi11 closed 1 year ago

c0dyhi11 commented 1 year ago

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

When setting #define SERIAL_PORT_2 3 in Configuration.h the build fails due to "... conflict with another pin ..." (More info in output blow)

If I don't set #define SERIAL_PORT_2 3 everything else compiles just fine, but I can't use the USB port on the board to connect to OctoPrint.

If I follow these same steps with branch bugfix-2.0.x these issues don't happen.

Error output is below in Steps to Reproducebelow

Bug Timeline

Validated this is still a problem with a fresh clone 10min ago, and I see a redit post from 10x days ago complaining. So I'm guessing this issue is around 2x weeks old.

Expected behavior

That everything builds nicely.

Actual behavior

The build fails with errors.

Steps to Reproduce

  1. Clone branch bugfix-2.1.x
  2. Copy files from here to the Marlin directory:
  3. Update platformio.ini:
    default_envs = STM32F103RET6_creality
  4. Update Marlin/Configuration.h:
    #define SERIAL_PORT_2 3
  5. Run the build:
    platformio run --silent -e STM32F103RE_creality
  6. Get Error:
    
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/HAL.cpp:27:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/HAL_SPI.cpp:27:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/MarlinSerial.cpp:27:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/Servo.cpp:27:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/eeprom_bl24cxx.cpp:32:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/eeprom_flash.cpp:27:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/eeprom_if_iic.cpp:32:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/eeprom_sdcard.cpp:31:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/eeprom_wired.cpp:27:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/fast_pwm.cpp:27:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/eeprom_sram.cpp:27:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/fastio.cpp:27:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/sdio.cpp:27:
    Marlin/src/HAL/STM32/../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/tft/../../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/tft/gt911.cpp:26:
    Marlin/src/HAL/STM32/tft/../../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/tft/../../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/tft/tft_fsmc.cpp:27:
    Marlin/src/HAL/STM32/tft/../../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    In file included from Marlin/src/HAL/STM32/tft/../../../inc/MarlinConfig.h:50,
                 from Marlin/src/HAL/STM32/tft/tft_ltdc.cpp:26:
    Marlin/src/HAL/STM32/tft/../../../inc/../HAL/STM32/inc/SanityCheck.h:80:6: error: #error "Serial Port 3 TX IO pins conflict with another pin on the board."
    80 |     #error "Serial Port 3 TX IO pins conflict with another pin on the board."
      |      ^~~~~
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/HAL_SPI.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/HAL.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/MarlinSerial.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/Servo.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/eeprom_bl24cxx.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/eeprom_flash.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/eeprom_if_iic.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/eeprom_sdcard.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/eeprom_wired.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/eeprom_sram.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/fast_pwm.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/fastio.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/sdio.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/tft/gt911.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/tft/tft_fsmc.cpp.o] Error 1
    *** [.pio/build/STM32F103RE_creality/src/src/HAL/STM32/tft/tft_ltdc.cpp.o] Error 1
    =========================================================== [FAILED] Took 5.68 seconds ===========================================================

Environment Status Duration


STM32F103RE_creality FAILED 00:00:05.683 ====================================================== 1 failed, 0 succeeded in 00:00:05.683 ======================================================



### Version of Marlin Firmware

v2.1.2

### Printer model

Creality Ender 3 Pro 

### Electronics

v4.2.7 Board

### Add-ons

CR Touch (Creality Branded BL Touch) & Creality Filament Runout Sensor

### Bed Leveling

UBL Bilinear mesh

### Your Slicer

Cura

### Host Software

OctoPrint

### Don't forget to include

- [ ] A ZIP file containing your `Configuration.h` and `Configuration_adv.h`.

### Additional information & file uploads

I didn't attach my `Configuration.h` and `Configuration_adv.h` as this issue is triggered with the default from [HERE](https://github.com/MarlinFirmware/Configurations/tree/bugfix-2.1.x/config/examples/Creality/Ender-3%20Pro/CrealityV427) with the one line modified in `Configuration.h` above. 
ellensp commented 1 year ago

The error is correct, Previous version of Marlin did not check for this conflict so many people got it wrong.

You have BOARD_CREALITY_V427 With SERIAL_PORT_2 3

These are the two pins use for hardware UART 3

UART3_TX_PIN PB10 // default uses LCD connector UART3_RX_PIN PB11 // default uses LCD connector

You have #define CR10_STOCKDISPLAY which uses the the LCD connector

This is in Conflict with the Encoder pins

define EXP3_03_PIN PB10

define BTN_EN1 EXP3_03_PIN <- this is UART3_TX_PIN

If you wish to use UART 3, you should disable the following CR10_STOCKDISPLAY SHOW_CUSTOM_BOOTSCREEN CUSTOM_STATUS_SCREEN_IMAGE

UART 3 has nothing to do with the USB cable, that is UART 1

ellensp commented 1 year ago

This Issue Queue is for Marlin bug reports and development-related issues, and we prefer not to handle user-support questions here. (As noted on this page.) For best results getting help with configuration and troubleshooting, please use the following resources:

After seeking help from the community, if the consensus points to a bug in Marlin, then you should post a bug report.

bob-anthony commented 1 year ago

SERIAL_PORT 1 should be sufficient to enable USB communication. Make sure your USB cable is data-capable and that you've defined HOST_ACTION_COMMANDS

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.