Problem with USB port communication when flashing Klipper

Basic Information:

Printer Model:
MCU / Printerboard:
Host / SBC
klippy.log

In the Klipper firmware configuration, the port only shows signs of life with the ‘CAN bus on PA11/PA12’ setup, but unfortunately, it still doesn’t work. The other ports are completely dead.

The printer is a Cambrian Max with an STM32F103RCT6 chip. The board is similar to the MKS Robin E3, except that it lacks a dedicated CH340C USB module. I had the exact same issue with the USB port when flashing Marlin. Recently, I managed to get a working configuration for Marlin, as shown below.

I would guess that there probably needs to be an option to select USART1 PA11/PA12, but that option isn’t available. Does anyone have any ideas on how to get this working? Thanks in advance.

# 

# "AtomStack FB5 V2.0 (STM32F103RCT6 ARM Cortex-M3)

# 

$$
env:STM32F103RC_atomstack_USB
$$

extends                     = common_STM32F103RC_variant
; board                     = genericSTM32F103RC
; board_build.variant         = MARLIN_F103Rx
board_build.encrypt_mks     = Robin_e3.bin
board_build.offset          = 0x5000
board_upload.offset_address = 0x08005000
build_flags                 = ${common_STM32F103RC_variant.build_flags}
; -DMCU_STM32F103RC -DHAL_SD_MODULE_ENABLED
; -DSS_TIMER=4
-DTIMER_SERVO=TIM5
-DUSE_USB_FS
-DUSBD_IRQ_PRIO=5
-DUSBD_IRQ_SUBPRIO=6
-DUSBD_USE_CDC_MSC
monitor_speed               = 250000
; upload_protocol             = stlink"

Welcome hubwoz,

It is available.

Like you did in your picture, mark “Communication interface…” and hit enter. A new submenu should appear and you should be able to choose PA11/PA12.

“—>” in kiauh indicates a submenu.

Unfortunately, that option isn’t available (Serial (on USART1 PA11/PA12). Unless it can be changed somewhere else.

I can’t add a photo.

The available options are:

  1. ( ) USB (on PA11/PA12)
  2. (X) Serial (on USART1 PA10/PA9) -
  3. ( ) Serial (on USART1 PB7/PB6)
  4. ( ) Serial (on USART2 PA3/PA2)
  5. ( ) Serial (on USART2 PD6/PD5)
  6. ( ) Serial (on USART3 PB11/PB10)
  7. ( ) Serial (on USART3 PD9/PD8)
  8. ( ) CAN bus (on PA11/PA12)
  9. ( ) CAN bus (on PA11/PB9)
  10. ( ) CAN bus (on PB8/PB9)
  11. ( ) CAN bus (on PD0/PD1)

Did you try that one?

I tried all options. Whatever happens only happens on CAN bus (on PA11/PA12). So I suppose that the ports would be okay, but the communication would have to be serial and not CAN

mmmhh…

You chose 20KiB offset. I think STM32F103RCT6 uses 28KiB. Could that be a problem?

(!PB11) GPIO pins to set at micro-controller startup

It’s working now

So this was the solution and you still used the 20KiB offset?

Settings are as per the attached image. The !PB11 GPIO pins were the key.

Could you post a klippy.log? That will make the solution clear.