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.34k stars 19.25k forks source link

[BUG] Sort out FSMC DMA for STM32F1xx #27460

Open SMH17 opened 1 month ago

SMH17 commented 1 month ago

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

Yes, and the problem still exists.

Bug Description

I faced issues with DMA of an STM32F1xx based boards and FSMC with latest version of Marlin, after investigating the issue I have seen that this code has been added, this changes the DMA channel used by FSMC(that was correctly set to DMA2_Channel1 before) and it seems intended to fix the analogous issue on GD32Fxx clones, but since GD32xxx clones aren't exactly drop in replacements for STM32F1xxx MCUs and there are design differences, attempting to fix the issue on GD32Fxxx reckless merging code in STM32 HAL without any proper distinction, inevitably causes problems on the regular STM32Fxxx microcontrollers and hard to debug mess to codebase.

I haven't checked if similar approach has been used also for other GD32 MCUs.

thinkyhead commented 1 month ago

I went ahead and reverted that particular change, which may leave a conflicting DMA in place between FSMC and some other functions. If there is real interest in sorting this out and figuring out a good way to ensure there are never conflicting or shared DMA channels, let's aim for that. The solution was originally suggested in #27385 by @konradmb.