Skip to content
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

Add FLY_SUPER8 and FLY_D8 board #27580

Merged
merged 18 commits into from
Mar 5, 2025

Conversation

Fly3DTeam
Copy link
Contributor

@Fly3DTeam Fly3DTeam commented Dec 10, 2024

Submitting a Pull Request
Added marlin support for FLY_D5,FLY_DP5 ,FLY_D7 ,FLY_D8 ,FLY_D8_PRO,FLY_SUPER8 ,FLY_SUPER8_PRO ,FLY_CDY3
Description
Below are links to motherboard information.
FLY_D5 :https://mellow.klipper.cn/docs/category/fly-d5
FLY_DP5 :https://mellow.klipper.cn/docs/ProductDoc/MainBoard/fly-d/fly-dp5/
FLY_D7 :https://mellow.klipper.cn/docs/ProductDoc/MainBoard/fly-d/fly-d7/
FLY_D8 :https://mellow.klipper.cn/docs/ProductDoc/MainBoard/fly-d/fly-d8-f407/
FLY_D8_PRO :https://mellow.klipper.cn/docs/ProductDoc/MainBoard/fly-d/fly-d8-h723/
FLY_SUPER8 :https://mellow.klipper.cn/docs/ProductDoc/MainBoard/fly-super/fly-super8/
FLY_SUPER8_PRO : https://mellow.klipper.cn/docs/ProductDoc/MainBoard/fly-super/fly-super8-pro/
FLY_CDY3:https://mellow.klipper.cn/docs/ProductDoc/MainBoard/fly-cdy/fly-cdy-v3/

Related Issues
D5/DP5/D7, Currently, the UART mode of TMC cannot be used.

@rondlh
Copy link
Contributor

rondlh commented Dec 15, 2024

@Fly3DTeam Why are you not adding the Fly D8 Pro?

add FLY_D5,  FLY_DP5,  FLY_D7,  FLY_D8_PRO,  FLY_SUPER8_PRO,  FLY_CDY_3 BOARD
@Fly3DTeam
Copy link
Contributor Author

@Fly3DTeam Why are you not adding the Fly D8 Pro?

Added

@Fly3DTeam
Copy link
Contributor Author

D5/DP5/D7, Currently, the UART mode of TMC cannot be used.

@rondlh
Copy link
Contributor

rondlh commented Dec 21, 2024

@Fly3DTeam Why are you not adding the Fly D8 Pro?

Added

That's great, well done. It's probably best for most users to link to the English pages.

The schematic given for the Fly D8 Pro (STM32H723) is wrong, it's the schematic of the D8 (STM32F407).
https://mellow.klipper.cn/en/docs/ProductDoc/MainBoard/fly-d/fly-d8-h723/schematic
D8 Pro Wrong Schematic

@rondlh
Copy link
Contributor

rondlh commented Dec 21, 2024

I had a quick look at the D9 Pro pinout, it seems correct except for the temperature section:

// Temperature Sensors
#define TEMP_0_PIN                          PC2   // Analog Input
#define TEMP_1_PIN                          PC3   // Analog Input
#define TEMP_2_PIN                          PC5   // Analog Input
#define TEMP_BED_PIN                        PB0   // Analog Input

#define TEMP_3_PIN                          PC3   // Analog Input
#define TEMP_4_PIN                          PC5   // Analog Input

You could also add the FDCAN pins:

#define FDCAN_RX           PB8
#define FDCAN_TX           PB9

You can define the driver UART and SPI pins like this:

#define X_STEP_PIN                          PE5
#define X_DIR_PIN                           PA8
#define X_ENABLE_PIN                        PA15
#if AXIS_HAS_SPI(X)
  #define X_CS_PIN                          PC9
#endif
#if AXIS_HAS_UART(X)
  #define X_SERIAL_RX_PIN                   PC9
  #define X_SERIAL_RX_PIN       X_SERIAL_TX_PIN
#endif

Is there a bootloader to flash the Marlin firmware via a USB stick in one of the USB ports?
Most boards can flash via a onboard SD Card slot, but the D8 Pro doesn't have one, using the onboard USB port would be even more user friendly.

@Fly3DTeam
Copy link
Contributor Author

I had a quick look at the D9 Pro pinout, it seems correct except for the temperature section:

// Temperature Sensors
#define TEMP_0_PIN                          PC2   // Analog Input
#define TEMP_1_PIN                          PC3   // Analog Input
#define TEMP_2_PIN                          PC5   // Analog Input
#define TEMP_BED_PIN                        PB0   // Analog Input

#define TEMP_3_PIN                          PC3   // Analog Input
#define TEMP_4_PIN                          PC5   // Analog Input

You could also add the FDCAN pins:

#define FDCAN_RX           PB8
#define FDCAN_TX           PB9

You can define the driver UART and SPI pins like this:

#define X_STEP_PIN                          PE5
#define X_DIR_PIN                           PA8
#define X_ENABLE_PIN                        PA15
#if AXIS_HAS_SPI(X)
  #define X_CS_PIN                          PC9
#endif
#if AXIS_HAS_UART(X)
  #define X_SERIAL_RX_PIN                   PC9
  #define X_SERIAL_RX_PIN       X_SERIAL_TX_PIN
#endif

Is there a bootloader to flash the Marlin firmware via a USB stick in one of the USB ports? Most boards can flash via a onboard SD Card slot, but the D8 Pro doesn't have one, using the onboard USB port would be even more user friendly.

A schematic diagram shared by D8 and D8PRO. Because the 100-pin chip of F4 is slightly different from that of H7, please refer to the pin diagram in the documentation manual.
The USB-A port on the D8 motherboard has no function in Marlin.
D8 can only be burned using the DFU of typr-c.

@rondlh
Copy link
Contributor

rondlh commented Dec 23, 2024

A schematic diagram shared by D8 and D8PRO. Because the 100-pin chip of F4 is slightly different from that of H7, please refer to the pin diagram in the documentation manual.
The USB-A port on the D8 motherboard has no function in Marlin.
D8 can only be burned using the DFU of typr-c.

Ok, thanks for the reply, DFU will always work, USB firmware flashing would be very appreciated by many users.

I see a few issues in the variant board definition.
Flashing Marlin will overwrite the Catapult bootloader, that's not needed. Marlin could be loaded at 0x08020000, and let Catapult jump to it.

board_build.offset          = 0x20000
board_upload.offset_address = 0x08020000

and enable the FDCAN port (add to build_flags):
-DHAL_FDCAN_MODULE_ENABLED
I also noticed that lots of devices are disabled in PeripheralPins.c. Marlin needs this information to find the devices as defined in the pins definition. By disabling the devices the capabilities of the board are reduced. FDCAN, I2C and Ethernet are completely disabled, and there is only one USART enabled, which is LPUART1. LPUART1 is not accessibly by the DMA1/2 controllers, so the DMA serial features will not work. It would be nice if all devices that are accessible on the board, and are not conflicting with the hardware could be accessed.

@rondlh
Copy link
Contributor

rondlh commented Dec 24, 2024

The given pinout for D8 Pro EXT1 and EXT2 connectors seem to be wrong.
https://mellow.klipper.cn/en/assets/images/pin-91312b3636a6305d33dccc17255c8191.webp

How about this:
EXT1 EXT2 Fly D8 PRO STM32H723
(FLY D8 PRO EXT1 EXT2 PINOUT)

So I guess the FLY D8 pinout is also wrong:
https://mellow.klipper.cn/en/assets/images/pin-ae9c179d27d60ed7f9611392a65abd59.webp

@rondlh
Copy link
Contributor

rondlh commented Jan 6, 2025

I tried to compile Marlin based on the provided files for the Fly D8 Pro and Fly Super 8 Pro. Both configurations cannot compile.
Have these configurations been tested?

@Fly3DTeam
Copy link
Contributor Author

I tried to compile Marlin based on the provided files for the Fly D8 Pro and Fly Super 8 Pro. Both configurations cannot compile. Have these configurations been tested?

image

@rondlh
Copy link
Contributor

rondlh commented Jan 7, 2025

I tried to compile Marlin based on the provided files for the Fly D8 Pro and Fly Super 8 Pro. Both configurations cannot compile. Have these configurations been tested?

image

I set the serial ports correctly before compilation, that is not the cause of the compilation error.
Also the previously mentioned peripheral issues have not been fixed, so even if the code compiles, the board cannot work properly. This needs more testing.

Thanks for correcting the EXP port pinouts. Unfortunately the D8 PRO EXP1 still has an obvious mistake, at least if I check it on a D8 Pro V1.1, perhaps it's correct for a V1.0 board.

rondlh
rondlh previously requested changes Jan 7, 2025
Copy link
Contributor

@rondlh rondlh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Fly D8 Pro configuration does not work well, it needs actual testing. Compilation doesn't work, even when the compilation issues are fixed the configuration has clear issues related to the device configuration and available peripherals.

Copy link
Contributor

@rondlh rondlh Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The D8 Pro configuration does not work well. Lot's of issues, needs testing...

On the D8 pro, can you get all stepper drivers to work with your configuration? Serial and SPI on all 8 steppers? I cannot, which is a known issue for the STM32H7, and there are solutions/workarounds.
Have a look at the BTT SKR 3.0, I'm using something closer to that configuration with good results. 新年好!

@rondlh
Copy link
Contributor

rondlh commented Jan 9, 2025

D5/DP5/D7, Currently, the UART mode of TMC cannot be used.

Does the SPI mode for TMC work?

What's the reason UART mode for TMC doesn't work?

@Fly3DTeam
Copy link
Contributor Author

D5/DP5/D7,目前无法使用 TMC 的 UART 模式。

TMC 的 SPI 模式是否有效?

TMC 的 UART 模式不起作用的原因是什么?

SPI is valid. We guess it may be due to a timer, which keeps getting stuck at the test drive.

@rondlh
Copy link
Contributor

rondlh commented Jan 28, 2025

Are you sure about the PB2 pin on EXT1 of the D8 Pro?
It's is shown here: https://mellow.klipper.cn/en/assets/images/pin-1652261e2a5a0010adec2b02087c5fff.webp
I think it wrong, could you please verify?
新年好

@ellensp
Copy link
Contributor

ellensp commented Jan 28, 2025

According to Images on https://www.aliexpress.com/item/1005007765975184.html

pins

You can magnify it and barely make out that the H7 has PB2, while the F4 has PB1

So presuming the silkscreen is correct... I agree that EXP1_02_PIN on Marlin/src/pins/stm32h7/pins_FLY_D8_PRO.h seem to be wrong.

Currently it has

/**
 *        ------                ------
 *  PB11 | 1  2 | PE7     PB14 | 1  2 | PB13
 *  PA14 | 3  4 | PA13    PA9  | 3  4 | PB12
 *  PB10   5  6 | PE15    PA10   5  6 | PB15
 *  PE14 | 7  8 | PA0     PE13 | 7  8 | RESET
 *   GND | 9 10 | 5V       GND | 9 10 | --
 *        ------                ------
 *         EXP1                  EXP2
 */
#define EXP1_01_PIN                         PB11
#define EXP1_02_PIN                         PE7

Looks like it should be

/**
 *        ------                ------
 *  PB11 | 1  2 | PB2     PB14 | 1  2 | PB13
 *  PA14 | 3  4 | PA13    PA9  | 3  4 | PB12
 *  PB10   5  6 | PE15    PA10   5  6 | PB15
 *  PE14 | 7  8 | PA0     PE13 | 7  8 | RESET
 *   GND | 9 10 | 5V       GND | 9 10 | --
 *        ------                ------
 *         EXP1                  EXP2
 */
#define EXP1_01_PIN                         PB11
#define EXP1_02_PIN                         PB2

@rondlh
Copy link
Contributor

rondlh commented Jan 29, 2025

I have 3x Fly D8 Pro V1.1 (H723), the board says "V1.1" which is NOT shown in the image provided in the link above (https://mellow.klipper.cn/en/assets/images/pin-1652261e2a5a0010adec2b02087c5fff.webp).
On my boards EXP1 Pin2 is PE7 (confirmed with CubeIDE and a LED).
PE7 is also stated in the Marlin pins-file and in the provided Klipper config:

aliases:
    EXP1_1=PB11, EXP1_3=PA14,  EXP1_5=PB10, EXP1_7=PE14, EXP1_9=<GND>,
    EXP1_2=PE7,  EXP1_4=PA13,  EXP1_6=PE15, EXP1_8=PA0 , EXP1_10=<5V>,
    # EXP2 header
    EXP2_1=PB14, EXP2_3=PA9,  EXP2_5=PA10,  EXP2_7=PE13,  EXP2_9=<GND>,
    EXP2_2=PB13, EXP2_4=PB12, EXP2_6=PB15,  EXP2_8=<RST>, EXP2_10=<NC>,

So I think that the provided pinout picture, schematic and silkscreen are all wrong.

Additionally, the provided board variant files cause lots of issue for me. Many devices are disabled, and some devices are added on GPIOF, which is not present on the 100 pin chip. This needs a good review.

@Fly3DTeam
Copy link
Contributor Author

我有 3 个 Fly D8 Pro V1.1 (H723),板子上写着“V1.1”,上面链接中提供的图像中没有显示 (https://mellow.klipper.cn/en/assets/images/pin-1652261e2a5a0010adec2b02087c5fff.webp)。在我的板上,EXP1 Pin2 是 PE7(通过 CubeIDE 和 LED 确认)。 PE7 也在 Marlin pins-file 和提供的 Klipper 配置中声明:

aliases:
    EXP1_1=PB11, EXP1_3=PA14,  EXP1_5=PB10, EXP1_7=PE14, EXP1_9=<GND>,
    EXP1_2=PE7,  EXP1_4=PA13,  EXP1_6=PE15, EXP1_8=PA0 , EXP1_10=<5V>,
    # EXP2 header
    EXP2_1=PB14, EXP2_3=PA9,  EXP2_5=PA10,  EXP2_7=PE13,  EXP2_9=<GND>,
    EXP2_2=PB13, EXP2_4=PB12, EXP2_6=PB15,  EXP2_8=<RST>, EXP2_10=<NC>,

所以我认为提供的引脚图片、原理图和丝印都是错误的。

此外,提供的板变体文件给我带来了很多问题。许多器件被禁用,一些器件被添加到 GPIOF 上,而 GPIOF 上没有 100 引脚芯片。这需要一个好的审查。

I checked and found that the pinout is wrong and a fix has been arranged. What do you mean by "some devices are added to GPIOF"?

@rondlh
Copy link
Contributor

rondlh commented Feb 19, 2025

I checked and found that the pinout is wrong and a fix has been arranged. What do you mean by "some devices are added to GPIOF"?

About the variant for Fly D8 Pro (H723):
Currently there are no devices in the list using GPIOF, so there is no problem. I'm not sure if it was fixed or I was looking at the wrong file.

About PeripheralPins.c, there is still an issue. Below a sample. Most devices are commented out, which makes them inaccessible to Marlin. Like the UART TX pin, only LPUART1 is left which is not supported by SERIAL_DMA. The same pins can also be used as USART1, which supports SERIAL_DMA, but those lines are commented out.
USART3 is available on EXP1 (PB10 and PB11), but commented out, so Marlin cannot use it.
FDCAN is completely commented out, but the board has a CAN transceiver and connector, but it cannot be used.
Devices that cannot be used because of pin conflicts should be commented out, other devices should remain. So for example for the FDCAN pins, only the correct lines should be left, the other lines can be commented out, this way Marlin will automatically select the correct pins and the user has a smooth experience.

Question: Can all stepper drivers use serial and SPI stepper communication? I tried it previously, but could not get any of the E-stepper to work.

Below some lines of PeripheralPins.c to illustrate the issues mentioned:

WEAK const PinMap PinMap_UART_TX[] = {
  // {PA_0,       UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
  // {PA_2,       USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
  {PA_9,       LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_LPUART)},  // EXP2_03_PIN
  // {PA_9_ALT1,  USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
  // {PA_12,      UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_UART4)},
  // {PA_15,      UART7,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)},
  // {PB_4,       UART7,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART7)},
  // {PB_6,       LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART)},
  // {PB_6_ALT1,  UART5,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)},
  // {PB_6_ALT2,  USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
  // {PB_9,       UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
  // {PB_10,      USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
  // {PB_13,      UART5,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_UART5)},
  // {PB_14,      USART1,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)},
  // {PC_6,       USART6,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART6)},
  // {PC_10,      UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
  // {PC_10_ALT1, USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
  // {PC_12,      UART5,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
  // {PD_1,       UART4,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
  // {PD_5,       USART2,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
  // {PD_8,       USART3,  STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
  // {PD_15,      UART9,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_UART9)},
  // {PE_1,       UART8,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART8)},
  // {PE_3,       USART10, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF11_USART10)},
  // {PE_8,       UART7,   STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART7)},
  {NC,         NP,      0}
};

@thinkyhead
Copy link
Member

@Fly3DTeam — Overall this is good! There are just two fixes that would make this better for users…

  • At the moment this is limited to a narrow set of standard pinouts and functions. You can selectively uncomment more items in PeripheralPins.h so users will be able to apply FLY boards to any application they want. I would try to do this myself, but I will probably miss some things.
  • You may have already sorted this out, but let me know. For boards with a bootloader —especially if it provides flashing the firmware from the SD Card or USB Flash Drive— set the build/upload address after the bootloader. If there are specific bootloaders you've prepared for these boards, we should include links to those in the pins files.

It will be great to have these boards included in the 2.1.3 release. Have a look at these final details, and let me know when it is ready!

@rondlh
Copy link
Contributor

rondlh commented Feb 23, 2025

  • You may have already sorted this out, but let me know. For boards with a bootloader —especially if it provides flashing the firmware from the SD Card or USB Flash Drive— set the build/upload address after the bootloader. If there are specific bootloaders you've prepared for these boards, we should include links to those in the pins files.

About the FLy D8 Pro, it comes with the Katapult bootloader, which will be overwritten by Marlin in the current configuration (both start from 0x08000000). Katapult will continue boot from 0x082000000, so Marlin could be stored there to preserve the bootloder. Unfortunately the board does not have a SD card slot, and the 3 USB ports cannot be used to flash a firmware from a USB stick because of the onboard hub which has the upstream port at the USB Type C port which means that the STM32H723 USB can only work in device mode.
I believe Marlin cannot use Katapult, so the Marlin firmware needs to be flashed through DFU or the ST-link connector.
I am developing a bootloader that can flash from an external SD Card or MAX3421 USB host adapter connected to the EXP2 port (SPI2).

@Fly3DTeam
Copy link
Contributor Author

— 总的来说,这很好!只有两个修复程序可以更好地为用户服务......

  • 目前,这仅限于一组狭窄的标准引脚分配和功能。您可以选择性地取消注释更多项目,以便用户能够将 FLY 板应用于他们想要的任何应用程序。我会尝试自己做这件事,但我可能会错过一些事情。PeripheralPins.h
  • 你可能已经解决了这个问题,但请告诉我。对于带有 bootloader 的电路板 — 特别是如果它提供从 SD 卡或 USB 闪存驱动器刷新固件 — 在 bootloader 之后设置 build/upload 地址。如果你为这些板子准备了特定的 bootloaders,我们应该在 pins 文件中包含指向这些的链接。

如果这些板包含在 2.1.3 版本中,那就太好了。看看这些最后的细节,什么时候准备好了就告诉我!

For motherboards without SD card slots, we usually use DFU+STM32CubeProgrammer to burn marlin firmware (the link to the method has been added to the pin file of the corresponding motherboard)
The bootloader flashing method and download address of the motherboard with SD card have been added to the corresponding motherboard pin file
Thank you

@thinkyhead
Copy link
Member

It's not unusual for board contributions to be built on the output from STM32CubeProgrammer in the initial submission. So this looks fine as a first version to me, and we'll make adjustments for wider applications as we learn more and users get more experience with these boards. I will clean up the build to make sure CI tests are passing, and should have this merged very soon.

@rondlh
Copy link
Contributor

rondlh commented Mar 1, 2025

I just gave the D8 Pro (STM32H723) another try. I encountered timer conflicts. After I solve those(-DTIMER_SERVO=TIM5 -DTIMER_TONE=TIM2) I found all 8 stepper drivers (3x SPI + 5x uart) communicating correctly.
The pins file seems correct, but the EXP1 pinout at the provided website is still wrong.

@thinkyhead thinkyhead dismissed rondlh’s stale review March 1, 2025 21:20

I've updated the timers on the D8 Pro build environment. Any others? We can add comments in pins files to correct bad documentation from the manufacturer.

@rondlh
Copy link
Contributor

rondlh commented Mar 4, 2025

I've updated the timers on the D8 Pro build environment. Any others? We can add comments in pins files to correct bad dofcumentation from the manufacturer.

For the rest everything seems to be working fine out of the box now.
I also deleted the timer definition in the pins file (D8 Pro).

// Avoid conflict with fans and TIMER_TONE
#define TEMP_TIMER  3
#define STEP_TIMER  5

The Marlin pins file is correct, and that is what counts.

@thinkyhead thinkyhead merged commit 05a4608 into MarlinFirmware:bugfix-2.1.x Mar 5, 2025
66 checks passed
thinkyhead added a commit to MarlinFirmware/MarlinDocumentation that referenced this pull request Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants